| Summary: | SDL_RenderTarget support | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sam Lantinga <slouken> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WONTFIX | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | ||
| Version: | 2.0.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
SDL_RenderTarget.patch
SDL_RenderTarget.patch SDL13-rendertargetbug-and-colorbufferfloat.diff |
||
|
Description
Sam Lantinga
2006-02-01 04:44:13 UTC
Created attachment 60 [details]
SDL_RenderTarget.patch
Date: Mon, 31 Oct 2005 12:53:08 +0100 (CET) From: Michi Hostettler <michihostettler2001@yahoo.de> Subject: [SDL] [SDL-1.3] RenderTargets under Windows hi, i've probably found the bug why sdl rendertargets don't work under windows. if you look at SDL_wingl.c, WIN_GL_UnlockRenderTarget, the bug is if not (target->texture) then wglMakeCurrent(GL_hdc, GL_hrc) is NEVER called, and the buffer is not unbound. solution: take the call to wglMakeCurrent(GL_hdc, GL_hrc) out of the if-block. Created attachment 61 [details]
SDL_RenderTarget.patch
Removed unnecessary exports diff, which even now doesn't apply cleanly. :)
Created attachment 65 [details] SDL13-rendertargetbug-and-colorbufferfloat.diff Date: Mon, 16 May 2005 17:23:38 +0800 From: Eric Vidal <evidal@ateneo.edu> To: sdl@libsdl.org Subject: [SDL] [PATCH] Another take at SDL 1.3 rendertarget bug + ARB_color_buffer_float support Hello all! I've attached a patch to SDL 1.3 CVS and I'm requesting your comments. This patch: (1) Takes care of robustness issue with attributes on render target creation. Previously the parameters will be messed up if the array is not specified in the requested order, and fails to get the remaining attributes if SDL_GL_RED_SIZE is specified prematurely. Jonathan Thambidurai's patch addresses this but requires the attributes to contain two terminating zero's at the end of the attrib array. I relaxed this restriction by semi-intelligently detecting whether the zero corresponded to a SDL_GL_RED_SIZE value. Note that for this to work, the attributes have to be specified in the enum order (however not all attributes have to be there). As Jonathan pointed out, the very nature of the array being passed to SDL_GL_CreateRenderTarget is problematic (and is potentially a buffer overflow issue as well). Maybe the attribute passing should be redesigned before it is too late? (2) Adds support for the GL_ARB_color_buffer_float extension, which allows floating-point color buffers to be used. Currently this extension only works on pbuffer render targets, and only on Windows and X11. Jonathan's previous patch included support for the NV_float_buffer extension, and he recommended that it be scrapped once the ARB version is commonplace. To avoid conflicts with code previously written to his patch (and also to be consistent with the other enum names), I renamed the attribute from SDL_GL_FLOATINGPOINT to SDL_GL_FLOATBUFFER. NOTE: As of this writing nVidia has not yet released official drivers for this ARB extension. The beta drivers contain it, but only on Windows. That means I haven't tested if the X11 patch works properly (but I've seen it to fail properly ;) ). Also, if anyone has ATI hardware around, please check if the patch works as is on your hardware! I've also attached a very simple program to test the float buffer functionality. This may be included in the test/ directory for future SDL releases, if the maintainers so wish. :) Much thanks to Jonathan for all the help, if it isn't obvious by now. :) -- Eric Vidal Lecturer / Graduate Research Assistant, DISCS Ateneo de Manila University http://aegis.ateneo.net/evidal/ Closing as WONTFIX, so this bug which is here for historical purposes isn't listed as open. --ryan. |