Top | ![]() |
![]() |
![]() |
![]() |
One can defines several lights in OpenGL. The
VisuGlLights is an object that stores several of them and
that can be applied to the current OpenGL context using
visu_gl_lights_apply()
. The lights that are created with
visu_gl_light_newDefault()
are ambiant light with a white colour. The
multiplier coefficient is use to soften lights when several are
used together. It is used as a factor for all light parameters
(ambient, diffuse...) ecept the specular one.
VisuGlLights * visu_gl_lights_new ();
Create a new VisuGlLights object. It contains no light when created.
Use visu_gl_lights_add()
to add new lights and
visu_gl_lights_remove()
to remove others.
VisuGlLights *
visu_gl_lights_ref (VisuGlLights *env
);
Increase the ref counter.
Since: 3.7
void
visu_gl_lights_unref (VisuGlLights *env
);
Decrease the ref counter, free all memory if counter reachs zero.
Since: 3.7
void
visu_gl_lights_free (VisuGlLights *env
);
Free memory occupied by the given environnement.
gboolean
visu_gl_lights_available (VisuGlLights *env
);
Inquire if one can add more lights to the scene.
Since: 3.8
gboolean visu_gl_lights_add (VisuGlLights *env
,VisuGlLight *light
);
This method adds the given light
to the list of known lights declared
in the given environnement. The light is not copied and should not be freed
when stored in the environnement.
gboolean visu_gl_lights_remove (VisuGlLights *env
,VisuGlLight *light
);
This method removes the given light
from the list of known lights declared
in the given environnement. The light
argument is first removed and then freed
by a call to g_free()
.
GList *
visu_gl_lights_getList (VisuGlLights *env
);
Retrieve the list of known VisuGlLight used by the given environnement.
a list of VisuGlLight objects. Should not be freed.
[transfer none][element-type VisuGlLight*]
gboolean
visu_gl_lights_removeAll (VisuGlLights *env
);
Empty the list of stored lights. All stored lights objects are freed.
gboolean
visu_gl_lights_apply (VisuGlLights *env
);
Apply all stored informations about lights to the current OpenGL context.
VisuGlLight * visu_gl_light_newDefault ();
Create a new light with default value (white color and position in the front, right, top position of the screen).