I'm just starting out using lwjgl, and have a texture drawn to the screen However, I want to regularly change the pixel data in this texture
I currently do this by changing my BufferedImage, and then converting this into a texture and redrawing it in openGL
I'm using an example texture loader at the moment: http://lwjgl.org/wiki/index.php?title=Examples:SpaceInvaders_TextureLoader
I feel like I shouldn't have to constantly reload the texture, though, and am afraid I'm wasting resources by calling the convertImageData function in the game loop How do I avoid this?
EDIT: Alright, I made myself a bit happier by storing the ByteBuffer as well and simply modifying it, followed by:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 800, 600, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
Instead of doing the whole conversion. I think this is fine