Skip to main content
GameDev.net gamedev.net
🔒 Locked

Multitexturing with glDrawElements

Started by Crawl Jun 1, 2002 at 10:16 AM 2 replies 750+ views
Original Post
Crawl
Crawl
Can someone show me how to do multitexturing with glDrawElements(). I know this question has been asked before but a forum search didn't reveal anything...
    
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, sizeof(VERTEX), m_pVertexBuffer[0].u);
glDrawElements( GL_TRIANGLES, m_pNode->m_dwPolyCount, GL_UNSIGNED_SHORT, m_pNode->m_pPolys );
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
  
Is there any way to pass the texture coordinates for the second (or third, etc) texture layer to OpenGL....???? -Crawl [edited by - Crawl on June 1, 2002 11:17:51 AM]
--------
LousyPhreak
LousyPhreak
look at www.gametutorials.com they have quite decent tuts...
http://mitglied.lycos.de/lousyphreak/
Crawl
Crawl
Thanx, i see their BSP tutorial uses the technique, looked there before but probably not hard enough,.....
--------
Martee
Martee
You need to do something like this ...

      
glClientActiveTextureARB(GL_TEXTURE0_ARB);
glTexCoordPointer(... lightmaps ...);


glClientActiveTextureARB(GL_TEXTURE1_ARB);
glTexCoordPointer(... texcoords ...);


glDrawElements(...);


Oh ... and make sure that you enable GL_TEXTURE_COORD_ARRAY for each texture unit.

[edited by - Martee on June 1, 2002 1:39:42 PM]
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.