Draw only a part of something


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

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.

Thank you very much menzel :slight_smile: