PDA

View Full Version : OpenGL and SDL rendertargets


Puzzler183
2005.04.28, 01:40 PM
Is it possible to have OpenGL render to a surface that isn't the screen using only corss platform SDL? If so, how would I go about that? I really want to avoid using the slow glReadPixels and having to clear the screen multiple times just to get render to texture functionality...

Skorche
2005.04.28, 02:35 PM
SDL 1.3 is supposed to support pbuffers, but you'd have to get it from CVS.

edit: or here: SDL 1.3 (http://sourceforge.net/project/showfiles.php?group_id=104201&package_id=114293)

Puzzler183
2005.04.28, 02:47 PM
Hm... Somehow I'm not a fan... Maybe that will work though. SDL1.3 would be crossplaftormy and all right?

Skorche
2005.04.28, 03:07 PM
It's supposed to be a cross platform implementation that standardizes the pbuffer interface on all supporting platforms.

Puzzler183
2005.04.28, 04:09 PM
Ok, well that sounds good. And I looked at the API and it also looked like what I need. One thing: in the SourceForge distribution, are there header and library files prebuilt or will I have to trouble with building them myself? (I have no unzipping program as I'm at a public computer)

Puzzler183
2005.04.28, 10:25 PM
Oh crap, I was jus tthinking about something. Would the SDL render target system work with DirectX too? I'd like to support both OpenGL and DirectX in my engine and making SDL and DirectX work together is already slightly hacky...

reubert
2005.04.29, 12:46 AM
Beware, rendertargets didn't work in full screen on mac in the version I downloaded, (about a month ago) simply adding a NoRecovery attribute to the pBuffer pixel format worked, but it means another hack to the SDL framework code.

Puzzler183
2005.04.29, 09:23 AM
:-/ This is very very shady, so I think I'll put engine development on hte back burner for a while. Still so much to do with shaders....