bitwise
02-06-2005, 07:19 AM
I've got glCopyTexSubImage2D working in a "sprite" class I'm writing to make OpenGL 2D games. On SDL I can load an entire texture and only show a portion of it - that's how animation comes up. So if I have a bitmap that shows 3 balls (a blue one, a red one and a green one), I could draw an animation of a ball that changes color to the screen (just by choosing which part of the bitmap I want to draw), and I could use that color-changing ball as a normal ball in the game.
Ok, so that's only the concept of a "sprite" that not necessarily 3D programming folks would know about. I'm trying to do exactly that in OpenGL. I'm currently using glCopyTexSubImage2D as I said, but I just read that they cannot be included in display lists. I don't know the reason of this limitation, but I know from reading that display lists are great and they speed things up greatly.
I want my class to be include-able in display lists, but I also need a quick way to select a portion of a texture to draw, to be able to process animations. Is there any other way I can choose a part of a texture to be drawn that can be used in display lists?
Ok, so that's only the concept of a "sprite" that not necessarily 3D programming folks would know about. I'm trying to do exactly that in OpenGL. I'm currently using glCopyTexSubImage2D as I said, but I just read that they cannot be included in display lists. I don't know the reason of this limitation, but I know from reading that display lists are great and they speed things up greatly.
I want my class to be include-able in display lists, but I also need a quick way to select a portion of a texture to draw, to be able to process animations. Is there any other way I can choose a part of a texture to be drawn that can be used in display lists?