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’s only available during an expose.
Cairo: Returns a pointer to a cairo_t.
All other backends: returns null.
-
PuglStatus puglObscureRegion(PuglView *view, int x, int y, unsigned width, unsigned height)¶
“Obscure” a region so it will be exposed in the next render.
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 isn’t strictly guaranteed on all platforms. If called elsewhere, an expose will be enqueued to be processed in the next event loop iteration.
The region is clamped to the size of the view if necessary.
- Parameters:
view – The view to expose later.
x – The top-left X coordinate of the rectangle to obscure.
y – The top-left Y coordinate of the rectangle to obscure.
width – The width of the rectangle to obscure.
height – The height coordinate of the rectangle to obscure.
-
PuglStatus puglObscureView(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 isn’t strictly guaranteed on all platforms. If called elsewhere, an expose will be enqueued to be processed in the next event loop iteration.