Unofficial OpenGL Software Development Kit
0.5.0
|
#include <Mesh.h>
A list of rendering commands to be used by a Mesh.
This class is part of the setup process for creating a Mesh. It stores a series of OpenGL rendering commands which will be used when rendering a particular Mesh. The series of commands will be used in the order given.
Indexed rendering commands (glDrawElements
and its ilk) will use the element buffer that is stored in the VAO used by the Mesh to render. You do not provide the element buffer to these functions.
The rendering command functions mimic their OpenGL counterparts where possible.
Public Member Functions | |
RenderCmdList () | |
Creates an empty RenderCmdList. | |
~RenderCmdList () | |
Destroys the object. | |
void | DrawArrays (GLenum primitive, GLint startIndex, GLsizei vertexCount) |
Adds a glDrawArrays command to the list of rendering commands. More... | |
void | DrawElements (GLenum primitive, GLsizei vertexCount, GLenum dataType, GLintptr byteOffset, GLint baseVertex=0) |
Adds a glDrawElements -style command to the list of rendering commands. More... | |
void | PrimitiveRestartIndex () |
Subsequent indexed rendering functions will not use a primitive restart index. | |
void | PrimitiveRestartIndex (GLuint index) |
Subsequent indexed rendering functions will use the given index as the primitive restart index. More... | |
void glmesh::RenderCmdList::DrawArrays | ( | GLenum | primitive, |
GLint | startIndex, | ||
GLsizei | vertexCount | ||
) |
Adds a glDrawArrays
command to the list of rendering commands.
primitive | The OpenGL primitive type to render. |
startIndex | The first index in the vertex arrays to render. |
vertexCount | The number of vertices to render. |
void glmesh::RenderCmdList::DrawElements | ( | GLenum | primitive, |
GLsizei | vertexCount, | ||
GLenum | dataType, | ||
GLintptr | byteOffset, | ||
GLint | baseVertex = 0 |
||
) |
Adds a glDrawElements
-style command to the list of rendering commands.
If there is a currently set restart index (with PrimitiveRestartIndex(GLuint) ), then it will be rendered with that as the restart index.
primitive | The OpenGL primitive type to render. |
vertexCount | The number of vertices to render. |
dataType | The OpenGL data type of the indices (GL_UNSIGNED_SHORT , etc). |
byteOffset | The offset from the beginning of the index buffer to where OpenGL will begin to pull data. |
baseVertex | An integer offset to be added to each index before fetching from the buffer. The restart index check happens before adding baseVertex to the index. |
void glmesh::RenderCmdList::PrimitiveRestartIndex | ( | GLuint | index | ) |
Subsequent indexed rendering functions will use the given index as the primitive restart index.
The primitive restart index will affect all indexed rendering functions (like glDrawElements
) until it is changed with a later call to this function. To stop using the restart index, use PrimitiveRestartIndex().