set up vertex array pointers
This commit is contained in:
parent
e8776bb719
commit
aafacfb3f9
@ -117,6 +117,16 @@ void Viewer::display()
|
|||||||
gluLookAt(0, -m_dist, 0, 0, 0, 0, 0, 0, 1);
|
gluLookAt(0, -m_dist, 0, 0, 0, 0, 0, 0, 1);
|
||||||
glMultMatrixf(m_rotationMatrix);
|
glMultMatrixf(m_rotationMatrix);
|
||||||
m_obj.bindBuffers();
|
m_obj.bindBuffers();
|
||||||
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
|
glEnableClientState(GL_NORMAL_ARRAY);
|
||||||
|
int stride = m_obj.getStride();
|
||||||
|
glVertexPointer(3, GL_FLOAT, stride, (GLvoid *) m_obj.getVertexOffset());
|
||||||
|
glNormalPointer(GL_FLOAT, stride, (GLvoid *) m_obj.getNormalOffset());
|
||||||
|
if (m_obj.doTextures())
|
||||||
|
{
|
||||||
|
glTexCoordPointer(2, GL_FLOAT, stride,
|
||||||
|
(GLvoid *) m_obj.getTextureCoordOffset());
|
||||||
|
}
|
||||||
SDL_GL_SwapBuffers();
|
SDL_GL_SwapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user