Function
Gdkcairo_draw_from_gl
since: 3.16
Declaration [src]
void
gdk_cairo_draw_from_gl (
cairo_t* cr,
GdkWindow* window,
int source,
int source_type,
int buffer_scale,
int x,
int y,
int width,
int height
)
Description [src]
This is the main way to draw GL content in GTK+. It takes a render buffer ID
(source_type == #GL_RENDERBUFFER) or a texture id (source_type == #GL_TEXTURE)
and draws it onto cr with an OVER operation, respecting the current clip.
The top left corner of the rectangle specified by x, y, width and height
will be drawn at the current (0,0) position of the cairo_t.
This will work for all cairo_t, as long as window is realized, but the
fallback implementation that reads back the pixels from the buffer may be
used in the general case. In the case of direct drawing to a window with
no special effects applied to cr it will however use a more efficient approach.
For #GL_RENDERBUFFER the code will always fall back to software for buffers with alpha components, so make sure you use #GL_TEXTURE if using alpha.
Calling this may change the current GL context.
Available since: 3.16
Parameters
cr-
Type:
cairo_tA cairo context.
The data is owned by the caller of the function. window-
Type:
GdkWindowThe window we’re rendering for (not necessarily into).
The data is owned by the caller of the function. source-
Type:
intThe GL ID of the source buffer.
source_type-
Type:
intThe type of the
source. buffer_scale-
Type:
intThe scale-factor that the
sourcebuffer is allocated for. x-
Type:
intThe source x position in
sourceto start copying from in GL coordinates. y-
Type:
intThe source y position in
sourceto start copying from in GL coordinates. width-
Type:
intThe width of the region to draw.
height-
Type:
intThe height of the region to draw.