multiple layers in OpenGL?

Started by
0 comments, last by haegarr 17 years, 7 months ago
I want to add rectangle selection to my application. I would like to draw a semi-transparent rectangle while mouse is moved but I do not want to render again all the scene objects. It's like to draw in one layer, letting intact the another layer. Is there any way to make it? I have heard something like aux_buffers, but I don't know how to use it. Could anybody help me, please??? Thanks in advance
One day, you will love "gleamest".
Advertisement
Never have made something like that myself, but the following things come to my mind:

Render the scene to a texture, render the texture window/screen filled, and render the selection above it. Rendering to a texture could be done in several ways. The slowest is to do a glReadPixels and making a texture manually from it. Next, there are some render-to-texture extensions out there. The best way nowadays may be to use PBO (pixel buffer objects). However, you don't have to extract the scene as a background for every frame, so also the less speedy ways may be sufficient.

This topic is closed to new replies.

Advertisement