Animating a texture in OpenGL
Posted: Sat Jan 16, 2016 11:34 am
Hello,
I have a question. What is the best way to animate a sprite from a sprite sheet loaded in as an OpenGL texture? The only ways I could think of were to change the values used in glTexCoord*() or to switch the matrix mode to GL_TEXTURE and then use glTranslate*(). What other ways are there?
Right now I am learning OpenGL by reading through the "red book." I'm using SDL to create my context, as well as for event handling, and texture loading. I mostly want to learn 2D graphics and engine development with OpenGL before I step into the 3rd dimension.
I would also appreciate any good books/websites you may know of that can teach me more about graphics programming and engine development. The OpenGL Red Book is only helpful to learning about OpenGL and not computer graphics in depth.
Thank you.
I have a question. What is the best way to animate a sprite from a sprite sheet loaded in as an OpenGL texture? The only ways I could think of were to change the values used in glTexCoord*() or to switch the matrix mode to GL_TEXTURE and then use glTranslate*(). What other ways are there?
Right now I am learning OpenGL by reading through the "red book." I'm using SDL to create my context, as well as for event handling, and texture loading. I mostly want to learn 2D graphics and engine development with OpenGL before I step into the 3rd dimension.
I would also appreciate any good books/websites you may know of that can teach me more about graphics programming and engine development. The OpenGL Red Book is only helpful to learning about OpenGL and not computer graphics in depth.
Thank you.