I'm working on a game in OpenGL and here's what I'd like to do:
- During an iteration of game logic, access texels of a texture for computations.
- Still during the same logic interation, possibly modify the texels of the texture.
- Render the game scene with the current version of the texture.
- Start another iteration with similar access to texel data.
I'm having trouble using glGetTexImage() in that the call crashes my program, and I'm not entirely sure this is what I want to be using anyway.
The only straightforward way I can see to do this is to have a buffer in system memory with texel information that I can mess around with, and generate a new OpenGL texture from it every iteration. That seems like a bad move.
Any help?