Class: Gtk::GLArea

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Overview

The ‘GtkGLAreaClass` structure contains only private data.

Instance Method Summary collapse

Instance Method Details

#attach_buffersnil

Ensures that the area framebuffer object is made the current draw and read target, and that all the required buffers for the area are created and bound to the frambuffer.

This function is automatically called before emitting the Gtk::GLArea::render signal, and doesn’t normally need to be called by application code.

Returns:

  • (nil)

#auto_renderTrueClass

Returns whether the area is in auto render mode or not.

Returns:

  • (TrueClass)

    true if the area is auto rendering, false otherwise

#auto_render=(auto_render) ⇒ TrueClass

If set to true the Gtk::GLArea::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 gtk_gl_area_queue_render() must be called. This mode is useful when the scene changes seldomly, but takes a long time to redraw.

Parameters:

  • auto_render (TrueClass)

Returns:

  • (TrueClass)

    auto-render

  • (TrueClass)

    auto-render

#auto_render?TrueClass

If set to true the Gtk::GLArea::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 gtk_gl_area_queue_render() must be called. This mode is useful when the scene changes seldomly, but takes a long time to redraw.

Returns:

  • (TrueClass)

    auto-render

#contextGdk::GLContext

The Gdk::GLContext used by the #GtkGLArea widget.

The Gtk::GLArea widget is responsible for creating the #GdkGLContext instance. If you need to render with other kinds of buffers (stencil, depth, etc), use render buffers.

Returns:

#context=(context) ⇒ Gdk::GLContext

The Gdk::GLContext used by the #GtkGLArea widget.

The Gtk::GLArea widget is responsible for creating the #GdkGLContext instance. If you need to render with other kinds of buffers (stencil, depth, etc), use render buffers.

Parameters:

Returns:

#errorGLib::Error

Gets the current error set on the area.

Returns:

  • (GLib::Error)

    the #GError or nil

#error=(error) ⇒ nil

Sets an error on the area which will be shown instead of the GL rendering. This is useful in the Gtk::GLArea::create-context signal if GL context creation fails.

Parameters:

  • error (GLib::Error)

    a new #GError, or nil to unset the error

Returns:

  • (nil)

#get_required_version(major, minor) ⇒ nil

Retrieves the required version of OpenGL set using gtk_gl_area_set_required_version().

Parameters:

  • major (Integer)

    return location for the required major version

  • minor (Integer)

    return location for the required minor version

Returns:

  • (nil)

#has_alphaTrueClass

Returns whether the area has an alpha component.

Returns:

  • (TrueClass)

    true if the area has an alpha component, false otherwise

#has_alpha=(has_alpha) ⇒ TrueClass

If set to true the buffer allocated by the widget will have an alpha channel component, and when rendering to the window the result will be composited over whatever is below the widget.

If set to false there will be no alpha channel, and the buffer will fully replace anything below the widget.

Parameters:

  • has_alpha (TrueClass)

Returns:

  • (TrueClass)

    has-alpha

  • (TrueClass)

    has-alpha

#has_alpha?TrueClass

If set to true the buffer allocated by the widget will have an alpha channel component, and when rendering to the window the result will be composited over whatever is below the widget.

If set to false there will be no alpha channel, and the buffer will fully replace anything below the widget.

Returns:

  • (TrueClass)

    has-alpha

#has_depth_bufferTrueClass

Returns whether the area has a depth buffer.

Returns:

  • (TrueClass)

    true if the area has a depth buffer, false otherwise

#has_depth_buffer=(has_depth_buffer) ⇒ TrueClass

If set to true the widget will allocate and enable a depth buffer for the target framebuffer.

Parameters:

  • has_depth_buffer (TrueClass)

Returns:

  • (TrueClass)

    has-depth-buffer

  • (TrueClass)

    has-depth-buffer

#has_depth_buffer?TrueClass

If set to true the widget will allocate and enable a depth buffer for the target framebuffer.

Returns:

  • (TrueClass)

    has-depth-buffer

#has_stencil_bufferTrueClass

Returns whether the area has a stencil buffer.

Returns:

  • (TrueClass)

    true if the area has a stencil buffer, false otherwise

#has_stencil_buffer=(has_stencil_buffer) ⇒ TrueClass

If set to true the widget will allocate and enable a stencil buffer for the target framebuffer.

Parameters:

  • has_stencil_buffer (TrueClass)

Returns:

  • (TrueClass)

    has-stencil-buffer

  • (TrueClass)

    has-stencil-buffer

#has_stencil_buffer?TrueClass

If set to true the widget will allocate and enable a stencil buffer for the target framebuffer.

Returns:

  • (TrueClass)

    has-stencil-buffer

#make_currentnil

Ensures that the Gdk::GLContext used by area is associated with the Gtk::GLArea.

This function is automatically called before emitting the Gtk::GLArea::render signal, and doesn’t normally need to be called by application code.

Returns:

  • (nil)

#newGtk::Widget

Creates a new Gtk::GLArea widget.

Returns:

#queue_rendernil

Marks the currently rendered data (if any) as invalid, and queues a redraw of the widget, ensuring that the Gtk::GLArea::render signal is emitted during the draw.

This is only needed when the gtk_gl_area_set_auto_render() has been called with a false value. The default behaviour is to emit Gtk::GLArea::render on each draw.

Returns:

  • (nil)

#set_required_version(major, minor) ⇒ nil

Sets the required version of OpenGL to be used when creating the context for the widget.

This function must be called before the area has been realized.

Parameters:

  • major (Integer)

    the major version

  • minor (Integer)

    the minor version

Returns:

  • (nil)

#use_esTrueClass

Retrieves the value set by gtk_gl_area_set_use_es().

Returns:

  • (TrueClass)

    true if the Gtk::GLArea should create an OpenGL ES context and false otherwise

#use_es=(use_es) ⇒ TrueClass

If set to true the widget will try to create a Gdk::GLContext using OpenGL ES instead of OpenGL.

See also: gdk_gl_context_set_use_es()

Parameters:

  • use_es (TrueClass)

Returns:

  • (TrueClass)

    use-es

  • (TrueClass)

    use-es

#use_es?TrueClass

If set to true the widget will try to create a Gdk::GLContext using OpenGL ES instead of OpenGL.

See also: gdk_gl_context_set_use_es()

Returns:

  • (TrueClass)

    use-es