Graphics¶
Functions for working with the graphics context and scheduling redisplays.
-
void *puglGetContext(PuglView *view)¶
Get the graphics context.
This is a backend-specific context used for drawing if the backend graphics API requires one. It is only available during an expose.
Cairo: Returns a pointer to a cairo_t.
All other backends: returns null.
-
PuglStatus puglPostRedisplay(PuglView *view)¶
Request a redisplay for the entire view.
This will cause an expose event to be dispatched later. If called from within the event handler, the expose should arrive at the end of the current event loop iteration, though this is not strictly guaranteed on all platforms. If called elsewhere, an expose will be enqueued to be processed in the next event loop iteration.
-
PuglStatus puglPostRedisplayRect(PuglView *view, PuglRect rect)¶
Request a redisplay of the given rectangle within the view.
This has the same semantics as
puglPostRedisplay()
, but allows giving a precise region for redrawing only a portion of the view.