renderingMode

renderingMode — Controls the way OpenGL renders objects.

Synopsis

enum                VisuRenderingModeId;
void                openGLInit_renderingMode            (void);
gboolean            openGLSet_globalRenderingMode       (VisuRenderingModeId value);
VisuRenderingModeId  openGLGet_globalRenderingOption    (void);
gboolean            openGLGet_renderingFromName         (const char *name,
                                                         VisuRenderingModeId *id);
const char**        openGLGet_allRenderingModes         (void);
const char**        openGLGet_allRenderingModesI18n     (void);
void                openGLApply_renderingMode           (VisuRenderingModeId mode);

Description

This modules creates an interface to access to the way OpenGL renders the objects (glPolygonMode() and glShadeModel() functions). There are then three rendering modes available in V_Sim: wireframe, flat and smooth. They are controls by an enum RenderingModeId. When openGLApply_renderingMode() is called, the current rendering mode is changed for all future drawing calls that uses polygons.

Details

enum VisuRenderingModeId

typedef enum
  {
    Wireframe,
    Flat,
    Smooth,
    SmoothAndEdge,
    nb_renderingModes,
    followGeneralSetting
  } VisuRenderingModeId;

Implemented mode to draw objects.

Wireframe

objects are rendered with lines only ;

Flat

objects are rendered with polygons whose colours are uniform on each polygon ;

Smooth

objects are rendered with polygons whose colours are shaded to be smooth all along the object.

SmoothAndEdge

objects are rendered with lines hightlighting the contours of polygons.

nb_renderingModes

number of rendering mode.

followGeneralSetting

use this value not to choose any rendering mode.

openGLInit_renderingMode ()

void                openGLInit_renderingMode            (void);

This method is used by opengl.c to initialise this module (declare config file options...). It should not be called elsewhere.


openGLSet_globalRenderingMode ()

gboolean            openGLSet_globalRenderingMode       (VisuRenderingModeId value);

This function change the value of the parameter renderingOption. It controls how V_Sim renders objects, in wireframe for example.

value :

an integer to represent the method of rendering.

Returns :

TRUE if the signal OpenGLAskForReDraw should be emitted.

openGLGet_globalRenderingOption ()

VisuRenderingModeId  openGLGet_globalRenderingOption    (void);

This function retrieve the value of the parameter renderingOption.

Returns :

the identifier of the current rendering option.

openGLGet_renderingFromName ()

gboolean            openGLGet_renderingFromName         (const char *name,
                                                         VisuRenderingModeId *id);

This function retrieve the rendering mode id associated to the name.

name :

a string ;

id :

a location to store the resulting id.

Returns :

TRUE if the name exists.

openGLGet_allRenderingModes ()

const char**        openGLGet_allRenderingModes         (void);

This function retrieve al the names of available rendering modes.

Returns :

an array of string, NULL terminated that is private (not to be freed).

openGLGet_allRenderingModesI18n ()

const char**        openGLGet_allRenderingModesI18n     (void);

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

openGLApply_renderingMode ()

void                openGLApply_renderingMode           (VisuRenderingModeId mode);

Change the rendering mode of current OpenGL context.

mode :

an integer.