![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
openglopengl — This part is responsible for the pseudo3D rendering through OpenGl and gives methods to adapt the view. |
gboolean visu_gl_getAntialias (); gboolean visu_gl_getImmediate (); VisuGlLights * visu_gl_getLights (); gboolean visu_gl_getStereo (); float visu_gl_getStereoAngle (); gboolean visu_gl_getStereoCapability (); gboolean visu_gl_getTrueTransparency (); void visu_gl_init (); void visu_gl_initContext (); void visu_gl_initGraphics (); void visu_gl_redraw (VisuGlView *view
,GList *lists
); gboolean visu_gl_setAntialias (gboolean value
); void visu_gl_setColor (float *material
,float *rgba
); void visu_gl_setHighlightColor (float material[5]
,float rgb[3]
,float alpha
); gboolean visu_gl_setImmediate (gboolean bool
); gboolean visu_gl_setStereo (gboolean status
); gboolean visu_gl_setStereoAngle (float angle
); gboolean visu_gl_setTrueTransparency (gboolean status
);
There is a last parameter which controls when render is done. There are two states : whenever a changing occurs (in fact when the OpenGLAskForReDraw signal is received) or only the OpenGLForceReDraw is received.
Except when high performances are required, this module never makes a redraw by itself, even when parameters such as the camera position are changed. The redraw must be asked by the client by emitting the OpenGLAskForReDraw signal or the OpenGLForceReDraw signal. This is to avoid situations when the client makes different changes but want just only one redraw at the end. All set methods return a boolean which informs the client of the opportunity to redraw after the set occurs. For example, if the client call a set change on theta or phi but the server returns FALSE, it means that not emission of OpenGLAskForReDraw is needed (for example because theta or phi had already these values).
gboolean visu_gl_getAntialias ();
Get the value of the antialiasing parameter.
Returns : |
wether or not the antialising for lines is activated. |
gboolean visu_gl_getImmediate ();
Get the value of the immediateDrawing option.
Returns : |
the value of the immediateDrawing option. |
VisuGlLights * visu_gl_getLights ();
V_Sim proposes a wrapper around the OpenGL light definitions.
Returns : |
the set of current lights. |
gboolean visu_gl_getStereo ();
Retrieve the status of the OpenGL surface.
Returns : |
TRUE if the surface try to draw in stereo (may be TRUE,
even if visu_gl_getStereoCapability() returns FALSE, in
that case the stereo capability is not used). |
float visu_gl_getStereoAngle ();
Retrieve the angle of the eyes in the stereo output.
Returns : |
the angle. |
gboolean visu_gl_getStereoCapability ();
Retrieve if the OpenGL window can render in stereo or not.
Returns : |
TRUE if the OpenGL surface can draw in stereo. |
gboolean visu_gl_getTrueTransparency ();
The drawing can be done in one pass or two to respect transparency.
Returns : |
TRUE if the drawing is done twice. |
void visu_gl_init ();
This initialises the drawing window and all the variables used by this module. It must be called once by the main program and should not be used otherwise.
void visu_gl_initContext ();
This method is called when an OpenGL surface is created for the first time. It sets basic OpenGL options and calls other OpenGLFunctions used in V_Sim.
void visu_gl_initGraphics ();
Internal use only. Call at startup to call OpenGL initialisation routines.
Since 3.6
void visu_gl_redraw (VisuGlView *view
,GList *lists
);
Basic drawing method : it clears the OpenGL area and call all lists if lists
is NULL
, or draw only the given lists.
|
a VisuGlView object with the camera settings. [transfer none] |
|
a
VisuGlExt array or NULL . [element-type v_sim.GlExt][transfer none][allow-none]
|
gboolean visu_gl_setAntialias (gboolean value
);
To set the antialiasing on lines.
|
a boolean to activate or not the lines antialias. |
Returns : |
TRUE if the signal OpenGLAskForReDraw should be emitted. |
void visu_gl_setColor (float *material
,float *rgba
);
This method call glMaterial to create the right shiningness, emission, diffuse...
|
a 5 elements array with the material properties ; |
|
a 4 elements array with the color values. |
void visu_gl_setHighlightColor (float material[5]
,float rgb[3]
,float alpha
);
This method try to set a colour that will contrast with rgb
.
|
a 5 elements array with the material properties ; |
|
a 3 elements array with the color values. |
|
the alpha channel. |
gboolean visu_gl_setImmediate (gboolean bool
);
If true all changes are applied only when the refresh button is pushed.
|
a boolean to set or not the immediateDrawing option. |
Returns : |
TRUE if the value is changed. |
gboolean visu_gl_setStereo (gboolean status
);
Change the type of rendering. The surface can be switch to stereo,
only if the OpenGL has stereo capabilities (see
visu_gl_getStereoCapability()
).
|
a boolean. |
gboolean visu_gl_setStereoAngle (float angle
);
Change the angle of the eyes in the stereo output.
|
a positive floating point value. |
Returns : |
TRUE if redraw should be done. |