Skip to main content
gamedev.net
🔒 Locked

texture mapping woes

Started by Muncher Mar 29, 2004 at 2:46 AM 6 replies 400+ views
Original Post
Muncher
Muncher
ARGGGGHHHH, i need expertise of the gamedev forums here! I am loading my and binding textures like this: AUX_RGBImageRec *fab; fab = auxDIBImageLoad("crap.bmp"); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,0); glTexImage2D(GL_TEXTURE_2D,0,3,fab->sizeX,fab->sizeY,0,GL_RGB,GL_UNSIGNED_BYTE,fab->data); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_CLAMP ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,GL_CLAMP ); which works fine, but when i have more that one texture (ie/ i load a texture and bind it as texture #1) then only last texture loaded actually works (ie/ texture #0 displays the OTHER texture)...... what gives?
Muncher
Muncher
Doh, now i just get white polys
Muncher
Muncher
I already am using glBindTexture(GL_TEXTURE_2D,texID) for my drawing code, the tex coords are fine... but the last texture loaded is the only one displayed, REGUARDLESS of the texture id i bind before it draw :\
_the_phantom_
_the_phantom_
in which case you must be loading any new textures into the old texture ID
Wudan
Wudan
That''s what it sounds like he''s doing.
JTippetts
JTippetts
Most likely.

Muncher: You need to generate a unique texture ID for every texture you try to bind. glGenTextures() will fill an array with unique texture IDs that are ready for use. You can setup an array with as many unsigned ints as you have textures and pass it to this function. Then, assign one texture to each ID in the array.


Golem
Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller

Topic Locked

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

Sign in to reply to this topic.