Re: Emulate D3D9's StretchRect

Ray Ratelis <[email protected]> Tue, 03 Jul 2007 19:05:35 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
Ok, I got it working. It works pretty well, too. Not as fast as d3d 
StretchRect but it's good enough for now.

I had to download a recent nvidia driver from guru3d.com to get the 
extension.

- Ray

Ray Ratelis wrote:
> For a heads up, nvidia doesn't have a driver that supports this 
> extension for WinXP.
> Does anyone know if this extension will ever see the light of day on 
> Linux or Mac OS X? Those are the platforms I need it on. Windows uses 
> can just run the dx9 version of our game.
> 
> Or is this extension an integrated part of OpenGL 2.0?
> 
> - Ray
> 
> Ray Ratelis wrote:
>> Thanks. I assume I can attach a texture to a framebuffer object and 
>> then set the read framebuffer to 0 and the draw framebuffer to the one 
>> with the attached texture and then use the framebuffer_blit function 
>> to copy the main buffer into the texture.
>>
>> My video card driver doesn't have the framebuffer_blit extension, 
>> though. I'll see if the more recent driver has it. I'm using a Geforce 
>> Go 7600 on a laptop.
>>
>> - Ray
>>
>> Michael I Gold wrote:
>>> 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).
>> ----- 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
> 
----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: Ray Ratelis
  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).