Jump to content
  • Advertisement


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


Can ANYONE tell me how to load more than one TEXTURE?

This topic is 6428 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I don''t know or CANNOT get it right to load more than one bitmap either one is loadied or the other is loaded but certainly not both at the same time and that causes a big probl;em so can anyone please tell or teach me in some detail how to load more than one bitmap at a time please??? Greatly appreciated!!!

Share this post

Link to post
Share on other sites
Firstly you need namespace for your n textures:


where n is the number of texture names required and texnames is a pointer to an array of n unsigned ints where opengl will save the free texture names.

for each texture you have to do the following:

glBindTexture(GL_TEXTURE_2D,texnames[x]); // I think you''re using 2-dimensional textures, else write GL_TEXTURE_1D or GL_TEXTURE_3D

// GL_REPEAT for texture repeating, GL_CLAMP for clamping

// (you could use GL_NEAREST instead of GL_LINEAR)

// load the texture....

where x means the number (not the gl name) of the texture, texnames[x] is the texture number (x should run from 0 to n-1 for n textures)

now you''ve loaded the textures. if you want to use texture nr. y for a polygon, you have to bind it:


// code for drawing the polygon

now the code to delete the textures from texture memory:


I hope this helps.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!