Somehow, instead of level I'm seeing weird planes (picture below):
http://s6.ifotos.pl/img/bug3JPG_xnaxrhn.JPG
And this is what I'm trying to render:
http://s4.ifotos.pl/img/radiantsh_xnaxsns.JPG
At the rendering stage I'm rendering only brushes (polygon groups built from triangles) with this function:
void BSPMesh::RenderPolygonFace( int faceIndex )
{
tBSPFace *pFace = &m_pFaces[faceIndex];
glVertexPointer( 3, GL_FLOAT, sizeof(tBSPVertex), &m_pVerts[pFace->startVertIndex].vPosition );
glTexCoordPointer( 2, GL_FLOAT, sizeof(tBSPVertex), &m_pVerts[pFace->startVertIndex].vTextureCoord );
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
if(0)
{
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, m_textures[pFace->textureID] );
}
glDrawElements( GL_TRIANGLES, pFace->numOfIndices, GL_UNSIGNED_INT, &m_pIndices[pFace->startIndex] );
glDisableClientState( GL_VERTEX_ARRAY );
glDisableClientState( GL_TEXTURE_COORD_ARRAY );
}
I'm using OpenGL 2.0 on a Nvidia GF 7600GS - yeah it's pretty old card.