PDA

View Full Version : Draw only a part of something



Spl3en
02-05-2012, 06:06 AM
Hello,

I'm going to explain my particular case for a better understanding of my problem :
I use OpenGL for 2D drawing in my application, with some 3D animations.

I'm currently designing the GUI, and I got an issue with displaying the content of a dragged window : when the user drag the bar, I would like a nice scrolling of the content of the window, as the one of your browser; however, I don't know how to render this with OpenGL.

With a basic 2D library, I would draw all the content of the window acording to the place of the drag bar in an image buffer, and display the correct part of the buffer to the screen.
But with OpenGL, I don't know to solve this problem.

Is there anything in OpenGL for storing a draw in a buffer without rendering it, and manipulate it ?

Thank you

menzel
02-05-2012, 06:51 AM
You can render the window content to a texture and only show the parts you're interested in (in this case manipulating the texturecoordinates should be sufficient).
Look up render to texture and offscreen rendering.

Spl3en
02-05-2012, 07:54 AM
Thank you very much menzel :)