gtk_openGLWidget

gtk_openGLWidget — defines an OpenGL capable GtkWidget.

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── VisuUiGlWidget

Implemented Interfaces

VisuUiGlWidget implements AtkImplementorIface and GtkBuildable.

Description

This is a simple implementation of GtkGlExt to create an OpenGL surface that is a full GtkWidget. When creating such a widget, one should give then a VisuUiGlWidgetRedrawMethod() to tell the widget how to redraw itself when needed.

The current implementation is working on X11 (built-in or with GtkGlExt) and Win32.

Functions

visu_ui_gl_widget_new ()

GtkWidget *
visu_ui_gl_widget_new (gboolean contextIsDirect);

Create a new OpenGL area inside a GTK widget. If contextIsDirect then it tries to initialise the OpenGL context to a direct one.

Parameters

contextIsDirect

a boolean.

 

Returns

a newly created widget.


visu_ui_gl_widget_setModel ()

void
visu_ui_gl_widget_setModel (VisuUiGlWidget *render,
                            VisuGlExtSet *model);

This method is used to defined a redraw method for the OpenGL area. By doing this the area will automatically redraw itself when necessary. Before doing it it calls visu_ui_gl_widget_setCurrent(), and after it calls swapGl().

Parameters

render

a VisuUiGlWidget object ;

 

model

a VisuGlExtSet object.

 

visu_ui_gl_widget_setCurrent ()

gboolean
visu_ui_gl_widget_setCurrent (VisuUiGlWidget *render,
                              gboolean force);

Make this object current. This means that all future OpenGL primitive will be rendered on this surface. If force is TRUE, the GL routine is actually called whereas in other cases, if render believe being already current, nothing is done.

Parameters

render

a VisuUiGlWidget object ;

 

force

a boolean.

 

Returns

TRUE if succeed.


visu_ui_gl_widget_class_getCurrentContext ()

VisuUiGlWidget *
visu_ui_gl_widget_class_getCurrentContext
                               ();

Class routine that returns the OpenGL widget which has the current context.

Returns

the VisuUiGlWidget with the current OpenGL context.

[transfer none]

Types and Values

VisuUiGlWidget

typedef struct _VisuUiGlWidget VisuUiGlWidget;

Short name to address VisuUiGlWidget_struct objects.


VisuUiGlWidgetClass

typedef struct _VisuUiGlWidgetClass VisuUiGlWidgetClass;

Short name to address VisuUiGlWidgetClass_struct objects.