Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


OpenGL Texture Problem...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 guitarman310   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 January 2002 - 04:15 AM

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.

Sponsor:

#2 terminate   Members   -  Reputation: 259

Like
Likes
Like

Posted 08 January 2002 - 04:27 AM

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

#3 guitarman310   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 January 2002 - 04:32 AM

I found the problem...DUH!!! I was calling glBindTexture() inside of glBegin() and glEnd()...fixed it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS