![]() |
![]() |
![]() |
COGL Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
CoglClipStackState; void cogl_clip_push (float x_offset, float y_offset, float width, float height); void cogl_clip_push_from_path (void); void cogl_clip_push_from_path_preserve (void); void cogl_clip_push_window_rect (float x_offset, float y_offset, float width, float height); void cogl_clip_pop (void); void cogl_clip_stack_save (void); void cogl_clip_stack_restore (void); void cogl_clip_ensure (void);
To support clipping your geometry to rectangles or paths Cogl exposes a stack based API whereby each clip region you push onto the stack is intersected with the previous region.
typedef struct { /* Stack of stacks */ GSList *stacks; gboolean stack_dirty; gboolean stencil_used; } CoglClipStackState;
void cogl_clip_push (float x_offset, float y_offset, float width, float height);
Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the current model-view matrix.
The rectangle is intersected with the current clip region. To undo
the effect of this function, call cogl_clip_pop()
.
|
left edge of the clip rectangle |
|
top edge of the clip rectangle |
|
width of the clip rectangle |
|
height of the clip rectangle |
void cogl_clip_push_from_path (void);
Sets a new clipping area using the current path. The current path
is then cleared. The clipping area is intersected with the previous
clipping area. To restore the previous clipping area, call
cogl_clip_pop()
.
Since 1.0
void cogl_clip_push_from_path_preserve (void);
Sets a new clipping area using the current path. The current path
is then cleared. The clipping area is intersected with the previous
clipping area. To restore the previous clipping area, call
cogl_clip_pop()
.
Since 1.0
void cogl_clip_push_window_rect (float x_offset, float y_offset, float width, float height);
Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are not transformed by the current model-view matrix.
The rectangle is intersected with the current clip region. To undo
the effect of this function, call cogl_clip_pop()
.
|
left edge of the clip rectangle in window coordinates |
|
top edge of the clip rectangle in window coordinates |
|
width of the clip rectangle |
|
height of the clip rectangle |
void cogl_clip_pop (void);
Reverts the clipping region to the state before the last call to
cogl_clip_push()
.
void cogl_clip_stack_save (void);
Save the entire state of the clipping stack and then clear all
clipping. The previous state can be returned to with
cogl_clip_stack_restore()
. Each call to cogl_clip_push()
after this
must be matched by a call to cogl_clip_pop()
before calling
cogl_clip_stack_restore()
.
Since 0.8.2
void cogl_clip_stack_restore (void);
Restore the state of the clipping stack that was previously saved
by cogl_clip_stack_save()
.
Since 0.8.2