Skip to main content
gamedev.net
🔒 Locked

Multitexturing and glTexCoordPointer

Started by Fear411 Feb 25, 2009 at 10:54 AM 2 replies 1.4k views
Original Post
Fear411
Fear411
Hey, I tried to do some multitexturing. But my Problem is that it doesnt work. First i create a Display List with the mesh information: glVertexPointer(3, GL_FLOAT, sizeof(Graphics::SVertex), mesh->getVertices()[0].position); glNormalPointer(GL_FLOAT, sizeof(Graphics::SVertex), mesh->getVertices()[0].normal); Graphics::CGLExtManager::glActiveTexture(GL_TEXTURE0); glTexCoordPointer(2, GL_FLOAT, sizeof(Graphics::SVertex), mesh->getVertices()[0].uv); glEnableClientState(GL_TEXTURE_COORD_ARRAY); Graphics::CGLExtManager::glActiveTexture(GL_TEXTURE1); glTexCoordPointer(2, GL_FLOAT, sizeof(Graphics::SVertex), mesh->getVertices()[0].uv); glEnableClientState(GL_TEXTURE_COORD_ARRAY); .... Then in my render loop: CGLExtManager::glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, entity->ent_texid[j]); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); CGLExtManager::glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, entity->ent_lighttexid[j]); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); What i am doing wrong? Thanks for helping.
bubu LV
bubu LV
You must use glClientActiveTexture function for setting active texture unit for glTexCoordPointer. glActiveTexture is for glBindTexture.
Fear411
Fear411
thanks, but it doesn't change anything.
Fear411
Fear411
i solved it. I had to call glEnable(GL_TEXTURE_2D) for each glBindTexture to activate the Layer.

Topic Locked

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

Sign in to reply to this topic.