55 SL_EXIT_MSG(
"No VBO generated for VAO in drawArrayAsColored.");
70 #if not defined(SL_GLES) && not defined(SL_EMSCRIPTEN)
71 if (pointSize != 1.0f)
73 glPointSize(pointSize);
82 #if not defined(SL_GLES) && not defined(SL_EMSCRIPTEN)
83 if (pointSize != 1.0f)
102 SL_EXIT_MSG(
"No VBO generated for VAO in drawArrayAsColored.");
117 #if not defined(SL_GLES) && not defined(SL_EMSCRIPTEN)
118 if (pointSize != 1.0f)
120 glPointSize(pointSize);
129 #if not defined(SL_GLES) && not defined(SL_EMSCRIPTEN)
130 if (pointSize != 1.0f)
#define SL_EXIT_MSG(message)
@ AT_position
Vertex position as a 2, 3 or 4 component vectors.
@ BU_static
Buffer will be modified once and used many times.
Singleton class for global render state.
Extension class with functions for quick line & point drawing.
Encapsulation of an OpenGL shader program object.
SLint uniformMatrix4fv(const SLchar *name, SLsizei count, const SLfloat *value, GLboolean transpose=false) const
Passes a 4x4 float matrix values py pointer to the uniform variable "name".
SLint uniform1f(const SLchar *name, SLfloat v0) const
Passes the float value v0 to the uniform variable "name".
SLint getUniformLocation(const SLchar *name) const
static SLGLProgramGeneric * get(SLStdShaderProg id)
Get program reference for given id.
Singleton class holding all OpenGL states.
SLMat4f modelMatrix
Init all states.
static SLGLState * instance()
Public static instance getter for singleton pattern.
SLMat4f viewMatrix
matrix for the active cameras view transform
SLMat4f projectionMatrix
matrix for projection transform
void currentMaterial(SLMaterial *mat)
void generateVertexPos(SLVVec2f *p)
Adds or updates & generates a position vertex attribute for colored line or point drawing.
void drawElementAsColored(SLGLPrimitiveType primitiveType, SLCol4f color, SLfloat pointSize, SLuint indexFirstVertex=0, SLuint countVertices=0)
Draws the VAO by element indices with the specified primitive with the color.
void drawArrayAsColored(SLGLPrimitiveType primitiveType, SLCol4f color, SLfloat lineOrPointSize=1.0f, SLuint indexFirstVertex=0, SLuint countVertices=0)
Draws the array as the specified primitive with the color.
SLGLVertexBuffer _vbo
NO. of vertices in array.
SLuint numVertices() const
void updateAttrib(SLGLAttributeType type, SLint elementSize, void *dataPointer)
Updates a specific vertex attribute in the VBO.
void drawElementsAs(SLGLPrimitiveType primitiveType, SLuint numIndexes=0, SLuint indexOffsetBytes=0)
Draws the VAO by element indices with a primitive type.
void setAttrib(SLGLAttributeType type, SLint elementSize, SLint location, void *dataPointer, SLGLBufferType dataType=BT_float)
Adds a vertex attribute with data pointer and an element size.
SLuint _numVertices
OpenGL id of transform feedback object.
void drawArrayAs(SLGLPrimitiveType primitiveType, SLint firstVertex=0, SLsizei countVertices=0)
Draws the VAO as an array with a primitive type.
void generate(SLuint numVertices, SLGLBufferUsage usage=BU_static, SLbool outputInterleaved=true, SLuint divisor=0)
Generates the VA & VB objects for a NO. of vertices.
SLint attribIndex(SLGLAttributeType type)
Returns the vector index if a vertex attribute exists otherwise -1.