v_sim.GlLights

Fields

None

Methods

class

new ()

add (light)

apply ()

available ()

free ()

getList ()

ref ()

remove (light)

removeAll ()

unref ()

Details

class v_sim.GlLights

A short way to access #_VisuGlLights objects.

classmethod new()
Returns:

a newly created v_sim.GlLights. Use v_sim.GlLights.free() to free such an object.

Return type:

v_sim.GlLights

Create a new v_sim.GlLights object. It contains no light when created. Use v_sim.GlLights.add() to add new lights and v_sim.GlLights.remove() to remove others.

add(light)
Parameters:

light (v_sim.GlLight) – a v_sim.GlLight object.

Returns:

True if v_sim.GlLights.apply() should be called.

Return type:

bool

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.

apply()
Returns:

True if OpenGL context has been changed.

Return type:

bool

Apply all stored informations about lights to the current OpenGL context.

available()
Returns:

True if the maximum number of lights allowed by OpenGL implementation is not reached yet.

Return type:

bool

Inquire if one can add more lights to the scene.

New in version 3.8.

free()

Free memory occupied by the given environnement.

getList()
Returns:

a list of v_sim.GlLight objects. Should not be freed.

Return type:

[v_sim.GlLight]

Retrieve the list of known v_sim.GlLight used by the given environnement.

ref()
Returns:

itself.

Return type:

v_sim.GlLights

Increase the ref counter.

New in version 3.7.

remove(light)
Parameters:

light (v_sim.GlLight) – a v_sim.GlLight object.

Returns:

True if v_sim.GlLights.apply() should be called.

Return type:

bool

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

removeAll()
Returns:

True if the v_sim.GlLights.apply() should be called.

Return type:

bool

Empty the list of stored lights. All stored lights objects are freed.

unref()

Decrease the ref counter, free all memory if counter reachs zero.

New in version 3.7.