Sign in to follow this  

Texture Question

This topic is 4111 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 dont understand something about textures, maby you guys can help. Say I wanted to have the same size squares on the screen with each of its own texture (I three textures in all -tex1,tex2,tex3- , how when I call i make it so i can have multiple quads and have em have different textures and have knows which texture object to use for that one , do i call the drawrect1 ...2 ...3 in the init() function so it can call what texture to use localy and then draw the square to which the texture is attached to. Like so..... void Initialize() { .... glEnable(GL_TEXTURE_2D); bitmapdata1 = LoadBitmapFile("tex1.bmp"), &bitmapinfoheader; glGenTexture(1, &tex1) glBitmap(GL_TEXTURE_2D, texture); ...... drawtex1(); .... } and do the same for tex2 and tex 3 in the func? thanks a bunch. ~Mad_Koder

Share this post


Link to post
Share on other sites
but when u have to functions that draw to different cubes like in the nehe example, how does it know which texture goes on that one? ( how does it know that you want bunnies.bmp to go on the first cube and osama.bmp to go on the second cube?)

Share this post


Link to post
Share on other sites
GLuint TexIDBunny;
GLuint TexIDOsama;

glGenTexture(1, &TexIDBunny);
glBindTexture(GL_TEXTURE_2D,TexIDBunny);
.... Load bunny texture .....

glGenTexture(1, &TexIDOsama);
glBindTexture(GL_TEXTURE_2D,TexIDOsama);
.... Load Osama texture .....

.....
... code ...


glBindTexture(GL_TEXTURE_2D,TexIDBunny);
... Draw quads with Bunny ...
...
...
glBindTexture(GL_TEXTURE_2D,TexIDOsama);
... Draw quads with Osama ...

Share this post


Link to post
Share on other sites

This topic is 4111 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this