Archived

This topic is now archived and is closed to further replies.

lc_gta

multitexturing

Recommended Posts

lc_gta    122
Hi all, this is my first attempt at multitexturing and i can''t quite get it to work. Here''s a bit of my code:
  
glVertexPointer(3, GL_FLOAT, 0, vertsBin0);

glClientActiveTextureARB(GL_TEXTURE0_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, scene.texture_container[4]->GetTexID());
glTexCoordPointer(2, GL_FLOAT, 0, tex2Bin0);

glClientActiveTextureARB(GL_TEXTURE1_ARB);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, scene.texture_container[0]->GetTexID());
glTexCoordPointer(2, GL_FLOAT, 0, texBin0);

glDrawArrays(GL_TRIANGLES, 0, bin0count);
  
the second texture is the only one that shows up. I''m sure i''m missing something fairly obvious but most tutorials and samples i''ve been able to find don''t use vertex arrays. any suggestions?? -Lance

Share this post


Link to post
Share on other sites
zedzeek    528
u need
glClientActiveTextureARB();
+
glActiveTextureARB();

after one u set the vertex array info + after the other u set the texture info

http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
_the_phantom_    11250
quote:
Original post by lc_gta
the second texture is the only one that shows up. I''m sure i''m missing something fairly obvious but most tutorials and samples i''ve been able to find don''t use vertex arrays. any suggestions??



http://www.gamedev.net/community/forums/topic.asp?topic_id=60011

The answer to ya problem should be there

Share this post


Link to post
Share on other sites