OpenGL Texture Problem...

Started by
1 comment, last by guitarman310 22 years, 4 months ago
I have a class CTextureManager that handles all of my texture loading, unloading, etc. Here''s the problem, when I call CTextureManager::LoadBitmapTexture(...) and map the texture onto a primitive, it only uses the LAST texture I loaded for all of the objects in the scene. I only call glGenTextures once, in the constructor. Any help would be appreciated. My system is a Pentium III 800mhz, 512 RAM, Nvidia GeForce2 MX 400. Thanks in advance.
[source]#define JESUS 1[/source]
Advertisement
You need to save the Texture IDs from the textures and then Bind them as you go along with glBindTexture().

ex. glBindTexture(GL_TEXTURE_2D, texID);

At the beggining

Load 3 textures.

Your main loop should then be something like this

BInd Tex 1

Draw the grass

Bind Tex 2

Draw the Dirt

Bind Tex 3

Draw the water

--------------------------

Those who dance are considered insane by those who cannot hear the music.

Edited by - terminate on January 8, 2002 11:28:49 AM
Those who dance are considered insane by those who cannot hear the music.
I found the problem...DUH!!! I was calling glBindTexture() inside of glBegin() and glEnd()...fixed it.
[source]#define JESUS 1[/source]

This topic is closed to new replies.

Advertisement