Skip to main content

Type Alias: GtkGLAreaProps

GtkGLAreaProps = WidgetProps & object

Defined in: generated/jsx.ts:3878

Props for the GtkGLArea widget.

Type Declaration

NameTypeDescriptionDefined in
allowedApis?Gdk.GLAPIThe allowed APIs.generated/jsx.ts:3880
autoRender?booleanIf set to %TRUE the ::render signal will be emitted every time the widget draws. This is the default and is useful if drawing the widget is faster. If set to %FALSE the data from previous rendering is kept around and will be used for drawing the widget the next time, unless the window is resized. In order to force a rendering GLArea.queue_render must be called. This mode is useful when the scene changes seldom, but takes a long time to redraw.generated/jsx.ts:3893
hasDepthBuffer?booleanIf set to %TRUE the widget will allocate and enable a depth buffer for the target framebuffer. Setting this property will enable GL's depth testing as a side effect. If you don't need depth testing, you should call glDisable(GL_DEPTH_TEST) in your GtkGLArea::render handler.generated/jsx.ts:3902
hasStencilBuffer?booleanIf set to %TRUE the widget will allocate and enable a stencil buffer for the target framebuffer.generated/jsx.ts:3907
onCreateContext?(self) => Gdk.GLContext | nullEmitted when the widget is being realized. This allows you to override how the GL context is created. This is useful when you want to reuse an existing GL context, or if you want to try creating different kinds of GL options. If context creation fails then the signal handler can use GLArea.set_error to register a more detailed error of how the construction failed.generated/jsx.ts:3924
onRender?(context, self) => boolean | nullEmitted every time the contents of the GtkGLArea should be redrawn. The context is bound to the area prior to emitting this function, and the buffers are painted to the window once the emission terminates.generated/jsx.ts:3931
onResize?(width, height, self) => void | nullEmitted once when the widget is realized, and then each time the widget is changed while realized. This is useful in order to keep GL state up to date with the widget size, like for instance camera properties which may depend on the width/height ratio. The GL context for the area is guaranteed to be current when this signal is emitted. The default handler sets up the GL viewport.generated/jsx.ts:3945
ref?Ref<Gtk.GLArea>-generated/jsx.ts:3946
useEs?booleanIf set to %TRUE the widget will try to create a GdkGLContext using OpenGL ES instead of OpenGL.generated/jsx.ts:3912