Work on new OpenGL example - Splitting into several files.
This commit is contained in:
@ -95,4 +95,24 @@ OpenGLSurfacePatch BuildOpenGLSurfacePatch(IndexedSurfacePatch& isp)
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void renderRegionVertexBufferObject(const OpenGLSurfacePatch& openGLSurfacePatch)
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, openGLSurfacePatch.vertexBuffer);
|
||||
glVertexPointer(3, GL_FLOAT, 36, 0);
|
||||
glNormalPointer(GL_FLOAT, 36, (GLvoid*)12);
|
||||
glColorPointer(3, GL_FLOAT, 36, (GLvoid*)24);
|
||||
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, openGLSurfacePatch.indexBuffer);
|
||||
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_NORMAL_ARRAY);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
|
||||
glDrawElements(GL_TRIANGLES, openGLSurfacePatch.noOfIndices, GL_UNSIGNED_INT, 0);
|
||||
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
}
|
Reference in New Issue
Block a user