[1.2+OpenGL] Scale OGL Buffer To Different Window Size?

[1.2+OpenGL] Scale OGL Buffer To Different Window Size???

Hi,

I’m using SDL 1.2 branch with OpenGL.

Is there a simple way to do the following?:
I wish to have a re-sizable window
and scale the OpenGL back buffer to the window’s size.
(window size may be smaller or larger than the original size)

Was hoping there was some OGL function I could call right before:
SDL_GL_SwapBuffers();

I am hoping there is an easy way to do this.

Thanks…

JeZ+Lee

Are you sure this is what you want? It’s more appropriate for most
OpenGL projects to adjust the framebuffer resolution to match the
window they’re rendering to.

To accomplish this, you’ll want to render to an intermediate buffer,
then use that buffer to draw a quad the same dimensions as your
window.

Google will teach you how if you search for opengl render target. You
can use glTexSubImage2d() (the old way to do it) or PBOs (pixel buffer
objects.)On Sun, Feb 21, 2010 at 12:55 PM, Jesse Palser wrote:

I wish to have a re-sizable window
and scale the OpenGL back buffer to the window’s size.
(window size may be smaller or larger than the original size)


http://codebad.com/