Original Post
Hi, I am creating a GUI library with Custom rendering backends. I will provide one rendering backend: OpenGL. I want to use rendering to a texture. How can I do that in a save/portable way (system independent)? One approach would be to use the main render target, render the big texture to it, render some polygons/textures to it and use glCopyTexSubImage*() to render those parts back to the big texture, which were changed. But this can be a problem, because the main render target must be empty to do that. The user then must use the library like this: Another drawback with this is, that I have to first render (subimages of) the big texture to the main rendering target which costs additional fillrate. Nvidias paper on render to texture: http://developer.nvidia.com/object/gdc_oglrtt.html says that some extensions exist to directly render to textures. In addition they mention, that this feature is available since the release of their first GeForce. I guess that most ATI/AMD cards also support this extension? It would be OK for me to use it, but how? Remember, it must me system independent. I would like to see a simple code example. Thanks in advance.
[SOURCE]
clearbuffers ();
GUI.RENDER_STUFF_TO_TEXTURES (...);
clearbuffers ();
MAIN_PROGRAM_RENDER_3D_GRAPHICS (...);
...
GUI.RENDER_TEXTURES_TO_SCREEN (...);
[/SOURCE]