?
Hallo das kannst Du so erreichen.
Pseudocode:
gluBuild2DMipmaps(GL_TEXTURE_2D,(m_bpp>>3), m_width, m_height,mode,GL_UNSIGNED_BYTE,pMapMem);
void CTerrain::Render(CGLfont *pFnt)
{
if(!m_pVert) return;
if(!m_dib.GetBmih() || !m_nVBONormals || !m_nVBOVertices || !m_nVBOIdx || !m_pLastMap)
return;
if(m_TexOn)
{
glEnable(GL_TEXTURE_2D),
glBindTexture(GL_TEXTURE_2D, m_texid),
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBOTexCoords);
glTexCoordPointer(2, GL_FLOAT, 0, 0);
}
glEnableClientState(GL_NORMAL_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBONormals);
glNormalPointer(GL_FLOAT, 0, 0);
glEnableClientState(GL_VERTEX_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBOVertices);
glVertexPointer(3, GL_FLOAT, 0, 0);
if(!m_TexOn)
{
glEnableClientState(GL_COLOR_ARRAY);
glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBOColors);
glColorPointer(3, GL_FLOAT, 0, 0);
}
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, m_nVBOIdx);
glScalef(1,1,m_UsrScale);
glDrawElements(GL_TRIANGLES, m_idsz, GL_UNSIGNED_INT, 0);
glScalef(1,1,1);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
if(m_TexOn)
glDisableClientState(GL_TEXTURE_COORD_ARRAY),glDisable(GL_TEXTURE_2D);
}
Allerdings gibt es hier verschiedene umfangreiche Optionen, bei Fragen melden.
Beispiel:
http://youtu.be/pDi9gXCzTps