Re: Emulate D3D9's StretchRect

Michael I Gold <[email protected]> Tue, 03 Jul 2007 12:05:34 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
You want this:

http://www.opengl.org/registry/specs/EXT/framebuffer_blit.txt

Ray Ratelis wrote:

I'm porting some code from D3D9 to OpenGL and the D3D9
version uses StretchRect to copy the frame buffer (which is usually non
pow2) into a pow2 texture. How would I do this in OpenGL?

One way I was thinking of was to CopyTexImage2D into a non-pow2 texture
rectangle and then use a pow2 offscreen-context (the same size as my
destination pow2 texture) to render the texture rectangle into using a
simple quad. Then I would CopyTexImage2D into my destination pow2
texture. That sounds horribly inefficient. Is there a better way?

This will happen a few times per frame, so I don't want to copy the
background buffer to system memory and do a scale there.

Any ideas are helpful.

- Ray

----- FAQ and OpenGL Resources at:

http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-----
FAQ and OpenGL Resources at:
http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--
Author: Michael I Gold
INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).