Top | ![]() |
![]() |
![]() |
![]() |
VisuGlVisuGl — This part is responsible for the pseudo3D rendering through OpenGl and gives methods to adapt the view. |
gboolean | antialias | Read / Write |
gboolean | immediate | Read / Write |
VisuGlLights * | lights | Read |
guint | mode | Read / Write |
gboolean | stereo | Read / Write |
gfloat | stereo-angle | Read / Write |
gboolean | true-transparency | Read / Write |
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 visu_gl_setColor (VisuGl *gl
,const float *material
,const float *rgba
);
This method call glMaterial to create the right shiningness, emission, diffuse...
gl |
a VisuGl object. |
|
material |
a 5 elements array with the material properties ; |
|
rgba |
a 4 elements array with the color values. |
void visu_gl_setHighlightColor (VisuGl *gl
,const float material[5]
,const float rgb[3]
,float alpha
);
This method try to set a colour that will contrast with rgb
.
gl |
a VisuGl object. |
|
material |
a 5 elements array with the material properties ; |
|
rgb |
a 3 elements array with the color values. |
|
alpha |
the alpha channel. |
VisuGlLights *
visu_gl_getLights (VisuGl *gl
);
V_Sim proposes a wrapper around the OpenGL light definitions.
void
visu_gl_applyLights (VisuGl *gl
);
If gl
has some defined lights, it setup the OpenGL context with
them and notify the "lights" parameter.
Since: 3.8
gboolean visu_gl_setAntialias (VisuGl *gl
,gboolean value
);
To set the antialiasing on lines.
gboolean
visu_gl_getAntialias (const VisuGl *gl
);
Get the value of the antialiasing parameter.
gboolean visu_gl_setImmediate (VisuGl *gl
,gboolean value
);
If true all changes are applied only when the refresh button is pushed.
gboolean
visu_gl_getImmediate (const VisuGl *gl
);
Get the value of the immediateDrawing option.
gboolean visu_gl_setTrueTransparency (VisuGl *gl
,gboolean status
);
If true the rendering is done twice to respect the transparency.
gboolean
visu_gl_getTrueTransparency (const VisuGl *gl
);
The drawing can be done in one pass or two to respect transparency.
gboolean
visu_gl_getStereoCapability (const VisuGl *gl
);
Retrieve if the OpenGL window can render in stereo or not.
gboolean visu_gl_setStereo (VisuGl *gl
,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()
).
gboolean
visu_gl_getStereo (const VisuGl *gl
);
Retrieve the status of the OpenGL surface.
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).
gboolean visu_gl_setStereoAngle (VisuGl *gl
,float angle
);
Change the angle of the eyes in the stereo output.
float
visu_gl_getStereoAngle (const VisuGl *gl
);
Retrieve the angle of the eyes in the stereo output.
gboolean visu_gl_setMode (VisuGl *gl
,VisuGlRenderingMode value
);
This function change the value of the parameter renderingOption. It controls how V_Sim renders objects, in wireframe for example.
VisuGlRenderingMode
visu_gl_getMode (const VisuGl *gl
);
This function retrieve the value of the parameter renderingOption.
guint visu_gl_addHint (VisuGl *gl
,guint value
);
Set some additional hints to gl
.
Since: 3.8
#define VISU_GL_OFFSCREEN 1 << 0
An hint mentioning that the OpenGL context is used for offscreen rendering.
Since: 3.8
struct VisuGlClass { VisuObjectClass parent; void (*initContext)(VisuGl* self); };
Common name to refer to a _VisuGlClass.
“antialias”
property“antialias” gboolean
antialias line.
Flags: Read / Write
Default value: FALSE
“immediate”
property“immediate” gboolean
immediate redraw after change.
Flags: Read / Write
Default value: TRUE
“mode”
property“mode” guint
global rendering mode.
Flags: Read / Write
Allowed values: <= 3
Default value: 2
“stereo”
property“stereo” gboolean
differenciate right and left buffer.
Flags: Read / Write
Default value: FALSE
“stereo-angle”
property“stereo-angle” gfloat
angle between left and right buffers.
Flags: Read / Write
Allowed values: [-45,45]
Default value: 5
“true-transparency”
property“true-transparency” gboolean
draw in two passes to improve transparency.
Flags: Read / Write
Default value: FALSE