opengl

opengl — This part is responsible for the pseudo3D rendering through OpenGl and gives methods to adapt the view.

Synopsis

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);

Description

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).

Details

visu_gl_getAntialias ()

gboolean            visu_gl_getAntialias                ();

Get the value of the antialiasing parameter.

Returns :

wether or not the antialising for lines is activated.

visu_gl_getImmediate ()

gboolean            visu_gl_getImmediate                ();

Get the value of the immediateDrawing option.

Returns :

the value of the immediateDrawing option.

visu_gl_getLights ()

VisuGlLights *      visu_gl_getLights                   ();

V_Sim proposes a wrapper around the OpenGL light definitions.

Returns :

the set of current lights.

visu_gl_getStereo ()

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).

visu_gl_getStereoAngle ()

float               visu_gl_getStereoAngle              ();

Retrieve the angle of the eyes in the stereo output.

Returns :

the angle.

visu_gl_getStereoCapability ()

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.

visu_gl_getTrueTransparency ()

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.

visu_gl_init ()

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.


visu_gl_initContext ()

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.


visu_gl_initGraphics ()

void                visu_gl_initGraphics                ();

Internal use only. Call at startup to call OpenGL initialisation routines.

Since 3.6


visu_gl_redraw ()

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.

view :

a VisuGlView object with the camera settings. [transfer none]

lists :

a VisuGlExt array or NULL. [element-type v_sim.GlExt][transfer none][allow-none]

visu_gl_setAntialias ()

gboolean            visu_gl_setAntialias                (gboolean 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.

visu_gl_setColor ()

void                visu_gl_setColor                    (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.

visu_gl_setHighlightColor ()

void                visu_gl_setHighlightColor           (float material[5],
                                                         float rgb[3],
                                                         float alpha);

This method try to set a colour that will contrast with rgb.

material :

a 5 elements array with the material properties ;

rgb :

a 3 elements array with the color values.

alpha :

the alpha channel.

visu_gl_setImmediate ()

gboolean            visu_gl_setImmediate                (gboolean bool);

If true all changes are applied only when the refresh button is pushed.

bool :

a boolean to set or not the immediateDrawing option.

Returns :

TRUE if the value is changed.

visu_gl_setStereo ()

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()).

status :

a boolean.

visu_gl_setStereoAngle ()

gboolean            visu_gl_setStereoAngle              (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.

visu_gl_setTrueTransparency ()

gboolean            visu_gl_setTrueTransparency         (gboolean status);

If true the rendering is done twice to respect the transparency.

status :

a boolean.

Returns :

TRUE if redraw should be done.