drawing images and rotating with JOGL

All my images are PNG format. I’ve gotten to the point where I can draw these images using gl.glDrawPixels(). I generate all the byte[] buffers upon load of the game, however this itself isn’t adequate if I want images rotated during the game. What is the best way to implement this?

  1. Use Java2D to apply AffineTransform rotation to image and then produce byte[] for each frame. Seems like this add a lot of overhead, especially with 60+ fps.

  2. Use Textures? I’m wondering if I convert an image to texture if JOGL can do the rotation for me.

  3. Any other ideas?

Yes you’ll need to use textures. This is pretty easy to do. The first step is to create a texture object to use the byte[] data from your loaded image. Then you draw a quad that contains the entire image and when you want the image rotated, you rotate the quad.

excellent, thanks!