hi , how do i go about rendering only a portion of my view? for example, i have a background that is supposed to stay the same way thoughout, and in front should be an object that is moving, how do i only redraw the object every frame and not the background to cut down the processing? pls tell me some directions or fucntions to use as i know noting about opengl and only need to edit some codes…
i have one problem though…my image is not depth buffered meaning that the obj in the foreground maybe behind the background, but i only want the obj to appear in the front(therefore i did not do to depth test)…how do i do it?
You could prerender the background and store the picture in a texture using the glCopyTexSubImage2D, so you only draw a full-screen quad as a backgrpund each time. Hovewer, it will only work if your view does not move.
You should create a big enough texture first, then render the background(without swaping the buffers!) and use the glCopyTexImage2D function. It will copy the imag efrom the framebuffer to the texture. Now you have a texure of your background.
To draw it, just render a rectangle that has exacly screen size with this texture on it.