Skip to main content
gamedev.net
🔒 Locked

glBindTexture-->BackDoor

Started by glX 1 reply 350+ views
Original Post
glX
glX
hi, Is there any kind of way that I can bind or change textures in-between glBegin() and glEnd.... You could have all textures in one texture and the just change the source xy.... but then the size would be to limited..... When you create a texture, you get an unsigned int index for that texture... is it possible to some how get a pointer to the acctual...texture??? and then be able to swap the textures with memcpy or something like that??? I''ve seen that someone wrote earlier that you could use mippmapping.. but that is kind of limiting for the numbers of textures right??? thanks,
Alex Mizrahi
Alex Mizrahi
quote:

Is there any kind of way that I can bind or change textures in-between glBegin() and glEnd....


No. It''s conceptual point of OpenGL.
But what for do you need this?
I think inserting glBegin/glEnd pair on texture switch is not hard, nor it slowdown rendering.

quote:

You could have all textures in one texture and the just change the source xy.... but then the size would be to limited.....



Most accelerators and software support 1024x1024 textures. I think it''s enough for a lot of smaller texures.

quote:

When you create a texture, you get an unsigned int index for that texture... is it possible to some how get a pointer to the acctual...texture??? and then be able to swap the textures with memcpy or something like that???


This int is only a handle. You cannot do memcpy, coz textures is transfered to accel(or selected as active if it''s inside accel) on glBindTexture.

quote:

I''ve seen that someone wrote earlier that you could use mippmapping.. but that is kind of limiting for the numbers of textures right???


Mipmaping is a technique for reducing texture flicker using textures with reduced size.
Prosper/LOADED
Prosper/LOADED
quote:
Original post by glX

When you create a texture, you get an unsigned int index for that texture... is it possible to some how get a pointer to the acctual...texture??? and then be able to swap the textures with memcpy or something like that???



Even if you could do this it would be much much much (did I precised *much* ?) slower than spliting your glBegin()/glEnd() into several ones.

Topic Locked

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

Sign in to reply to this topic.