Elements.pyGLV.GL.Shader.Shader

class Elements.pyGLV.GL.Shader.Shader(name=None, type=None, id=None, vertex_source=None, fragment_source=None, vertex_import_file=None, fragment_import_file=None)[source]

A concrete OpenGL-GLSL Shader container Component class

__init__(name=None, type=None, id=None, vertex_source=None, fragment_source=None, vertex_import_file=None, fragment_import_file=None)[source]

Initializes a Component object with optional name, type, and id parameters.

Args: - name (str, optional): The name of the component. Defaults to None. - type (str, optional): The type of the component. Defaults to None. - id (str, optional): The ID of the component. Defaults to None.

If name is None, then the component’s name is set to the name of its class. If type is None, the type is set to the name of the class. If id is None, a unique ID is generated using the uuid.uuid1() method.

The _parent, _children, _worldManager, and _eventManager attributes are set to None by default.

Returns: - None

Methods

__init__([name, type, id, vertex_source, …])

Initializes a Component object with optional name, type, and id parameters.

accept(system)

Accepts a class object to operate on the Component, based on the Visitor pattern.

add(object)

Add a Component object to the children of this Component.

disableShader()

enableShader()

getChild(index)

Get the child Component object at the given index.

getClassName()

Get the name of this Component class.

getNumberOfChildren()

Get the number of child Component objects for this Component.

init()

shader extra initialisation from raw strings or source file names

print()

prints out name, type, id, parent of this Component

remove(object)

Removes a Component object to the children of this Component.

update()

method to be subclassed for debuging purposes only, in case we need some behavioral or logic computation within the Component.

Attributes

COLOR_FRAG

COLOR_VERT

COLOR_VERT_MVP

COLOR_VERT_MVP_MANOS

FRAG_PHONG

FRAG_PHONG_MATERIAL

SIMPLE_TEXTURE_FRAG

SIMPLE_TEXTURE_PHONG_FRAG

SIMPLE_TEXTURE_PHONG_VERT

SIMPLE_TEXTURE_VERT

SIMPLE_TEXTURE_VERT_MVP

STATIC_SKYBOX_FRAG

STATIC_SKYBOX_VERT

TEXTURE_3D_FRAG

TEXTURE_3D_PHONG_FRAG

TEXTURE_3D_PHONG_VERT

TEXTURE_3D_VERT

VERT_PHONG_MVP

VERT_PHONG_MVP_ARMATURE

eventManager

Get the ECSSManager of the component.

float1fDict

float3fDict

float4fDict

fragment_source

glid

id

Get the ID of the component.

mat3fDict

mat4fDict

name

Get the name of the component.

parent

Get the parent of the component.

texture3DDict

textureDict

type

Get the type of the component.

vertex_source

worldManager

Get Component’s ECSSManager