Hey!

I have a sprite sheet in a Texture in LWJGL. The sprites from the sprite sheet belong in different objects. I'm wondering how to store the subimages from the Texture in those objects instead of just having one giant sprite sheet, because right now I can't really rotate the sprites individually. Should I rotate the whole sprite sheet whenever I want to rotate and then revert the rotation when I've drawn the image? That seems terribly inefficient. Or should I just rotate the images manually in paint.NET and add them to the sprite sheet? Any help is appreciated! :)

Here is what I'm doing right now.

Java Code:
// ...

Texture spriteSheet = TextureLoader.getTexture("PNG", new FileInputStream(new File("example/path.png")));

// ...

// x and y are the coordinates of where to draw the image on screen.
// spriteX and spriteY are the indexes of the spritesheet grid.
public static void renderTexture(int x, int y, int spriteX, int spriteY){
	// ...
	// I know I shouldn't really use GL_QUADS.
	glBegin(GL_QUADS);
		// Drawing different parts of the spritesheet based on the sprite coordinates (spriteX and spriteY).
		glTexCoord2f(spriteX / spritesWidth, spriteY / spritesHeight);
		glVertex2f(x * Tile.SIZE, y * Tile.SIZE);
		glTexCoord2f((spriteX + 1) / spritesWidth, spriteY / spritesHeight);
		glVertex2f(x * Tile.SIZE + Tile.SIZE, y * Tile.SIZE);
		glTexCoord2f((spriteX + 1) / spritesWidth, (spriteY + 1) / spritesHeight);
		glVertex2f(x * Tile.SIZE + Tile.SIZE, y * Tile.SIZE + Tile.SIZE);
		glTexCoord2f(spriteX / spritesWidth, (spriteY + 1) / spritesHeight);
		glVertex2f(x * Tile.SIZE, y * Tile.SIZE + Tile.SIZE);
	glEnd();

	// ...
}