![]() |
![]() |
![]() |
V_Sim API - Reference Manual | ![]() |
---|---|---|---|---|
openglopengl — This part is responsible for the pseudo3D rendering through OpenGl and gives methods to adapt the view. |
void openGL_reDraw (const char **lists, gpointer data); void openGL_drawToEmpty (const char **lists, gpointer data); int setAntialias (int value); int getAntialias (); gboolean openGLGet_trueTransparency (); gboolean openGLSet_trueTransparency (gboolean status); const char** openGLGet_allRenderingModesI18n (); int openGLGet_immediate (); gboolean openGLGet_stereo (); float openGLGet_stereoAngle (); gboolean openGLGet_stereoCapability (); void openGLSet_immediate (int bool); void openGLSet_stereo (gboolean status); gboolean openGLSet_stereoAngle (float angle); void openGLInit_context (); void setOpenGlMaterial (float *material, float *rgba); int initOpengl ();
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).
void openGL_reDraw (const char **lists, gpointer data);
Basic drawing method : it clears the OpenGL area and call all lists if lists
is NULL, or draw only the given lists.
lists : |
a string array, NULL terminated. |
data : |
some associated data. |
void openGL_drawToEmpty (const char **lists, gpointer data);
Basic drawing method when no data is loaded: it draws the V_Sim logo.
lists : |
a string array, NULL terminated. |
data : |
some associated data. |
int setAntialias (int value);
To set the antialiasing on lines.
value : |
a boolean to activate or not the lines antialias. |
Returns : | TRUE if the signal OpenGLAskForReDraw should be emitted. |
int getAntialias ();
Get the value of the antialiasing parameter.
Returns : | wether or not the antialising for lines is activated. |
gboolean openGLGet_trueTransparency ();
The drawing can be done in one pass or two to respect transparency.
Returns : | TRUE if the drawing is done twice. |
gboolean openGLSet_trueTransparency (gboolean status);
If true the rendering is done twice to respect the transparency.
status : |
a boolean. |
Returns : | TRUE if redraw should be done. |
const char** openGLGet_allRenderingModesI18n ();
This function retrieve al the names (translated) of available rendering modes.
Returns : | an array of string, NULL terminated that is private (not to be freed). |
int openGLGet_immediate ();
Get the value of the immediateDrawing option.
Returns : | the value of the immediateDrawing option. |
gboolean openGLGet_stereo ();
Retrieve the status of the OpenGL surface.
Returns : | TRUE if the surface try to draw in stereo (may be TRUE,
even if openGLGet_stereoCapability() returns FALSE, in
that case the stereo capability is not used).
|
float openGLGet_stereoAngle ();
Retrieve the angle of the eyes in the stereo output.
Returns : | the angle. |
gboolean openGLGet_stereoCapability ();
Retrieve if the OpenGL window can render in stereo or not.
Returns : | TRUE if the OpenGL surface can draw in stereo. |
void openGLSet_immediate (int bool);
If true all changes are applied only when the refresh button is pushed.
bool : |
a boolean to set or not the immediateDrawing option. |
void openGLSet_stereo (gboolean status);
Change the type of rendering. The surface can be switch to stereo,
only if the OpenGL has stereo capabilities (see
openGLGet_stereoCapability()
).
status : |
a boolean. |
gboolean openGLSet_stereoAngle (float angle);
Change the angle of the eyes in the stereo output.
angle : |
a positive floating point value. |
Returns : | TRUE if redraw should be done. |
void openGLInit_context ();
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 setOpenGlMaterial (float *material, float *rgba);
This method call glMaterial to create the right shiningness, emission, diffuse...
material : |
a 5 elements array with the material properties ; |
rgba : |
a 4 elements array with the color values. |