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_FRAGCOLOR_VERTCOLOR_VERT_MVPCOLOR_VERT_MVP_MANOSFRAG_PHONGFRAG_PHONG_MATERIALSIMPLE_TEXTURE_FRAGSIMPLE_TEXTURE_PHONG_FRAGSIMPLE_TEXTURE_PHONG_VERTSIMPLE_TEXTURE_VERTSIMPLE_TEXTURE_VERT_MVPSTATIC_SKYBOX_FRAGSTATIC_SKYBOX_VERTTEXTURE_3D_FRAGTEXTURE_3D_PHONG_FRAGTEXTURE_3D_PHONG_VERTTEXTURE_3D_VERTVERT_PHONG_MVPVERT_PHONG_MVP_ARMATUREeventManagerGet the ECSSManager of the component.
float1fDictfloat3fDictfloat4fDictfragment_sourceglididGet the ID of the component.
mat3fDictmat4fDictnameGet the name of the component.
parentGet the parent of the component.
texture3DDicttextureDicttypeGet the type of the component.
vertex_sourceworldManagerGet Component’s ECSSManager