![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces |
VisuUiGlWidget; VisuUiGlWidgetClass; void (*VisuUiGlWidgetRedrawMethod) (VisuGlView *view
,GList *lists
); VisuUiGlWidget * visu_ui_gl_widget_class_getCurrentContext (); GArray * visu_ui_gl_widget_getPixmapData (VisuUiGlWidget *render
,int *width
,int *height
,gboolean offScreen
,gboolean hasAlpha
); GtkWidget * visu_ui_gl_widget_new (gboolean contextIsDirect
); void visu_ui_gl_widget_redraw (VisuUiGlWidget *render
); gboolean visu_ui_gl_widget_setCurrent (VisuUiGlWidget *render
,gboolean force
); void visu_ui_gl_widget_setRedraw (VisuUiGlWidget *render
,VisuUiGlWidgetRedrawMethod method
,VisuGlView *view
); void visu_ui_gl_widget_swapBuffers (VisuUiGlWidget *render
);
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.
typedef struct _VisuUiGlWidget VisuUiGlWidget;
Short name to address VisuUiGlWidget_struct objects.
typedef struct _VisuUiGlWidgetClass VisuUiGlWidgetClass;
Short name to address VisuUiGlWidgetClass_struct objects.
void (*VisuUiGlWidgetRedrawMethod) (VisuGlView *view
,GList *lists
);
Methods of this prototype are called when the redraw of the OpenGL zone should be done.
|
a VisuGlView object with the camera settings. |
|
a VisuGlExt array or NULL . [allow-none][type VisuGlExt*]
|
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] |
GArray * visu_ui_gl_widget_getPixmapData (VisuUiGlWidget *render
,int *width
,int *height
,gboolean offScreen
,gboolean hasAlpha
);
Create an image from the OpenGL area. The size can be changed, using width
and
height
. If these pointers contains positive values, then they are used to set the
size for the image. If not, the current size is used and stored in these pointers.
The boolean offScreen is used to tell if the image is taken from current context
or if an offscreen pixmap is created for the rendering.
|
a VisuUiGlWidget object ; |
|
a pointer to the desired width or -1 ; |
|
a pointer to the desired height or -1 ; |
|
a boolean ; |
|
if TRUE, the returned data is RGBA, else only RGB. |
Returns : |
image data, row by row. [transfer full] |
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.
|
a boolean. |
Returns : |
a newly created widget. |
void visu_ui_gl_widget_redraw (VisuUiGlWidget *render
);
Force redraw on the given surface, if a redraw method have been given (see
visu_ui_gl_widget_setRedraw()
).
|
a VisuUiGlWidget object. |
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.
|
a VisuUiGlWidget object ; |
|
a boolean. |
Returns : |
TRUE if succeed. |
void visu_ui_gl_widget_setRedraw (VisuUiGlWidget *render
,VisuUiGlWidgetRedrawMethod method
,VisuGlView *view
);
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
visu_ui_gl_widget_swapBuffers()
.
|
a VisuUiGlWidget object ; |
|
a redraw method ;. [scope call] |
|
the VisuGlView object. |
void visu_ui_gl_widget_swapBuffers (VisuUiGlWidget *render
);
Swap the buffers of the OpenGL area.
|
a VisuUiGlWidget object. |