SDL_GL_SWAP_CONTROL deprecated |
Andrea
Guest
|
Hi,
SDL API documentation says that the attribute SDL_GL_SWAP_CONTROL is deprecated in 1.3.0. So what should I use to achieve the same behavior? That was the only way I found. Thanks. -- flickr.com/cyrus-and _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||
|
SDL_GL_SWAP_CONTROL deprecated |
Christian Leger
Guest
|
Hi,
I looked extensively into this issue less than a week ago. It seems that one option (which I got to work, but is nasty on windows) is to use a glXSwapIntervalSGI call in Linux and a wglSwapInterval or something similar in Windows. The Windows one has to be obtained with function pointers and some form of getprocaddress call. I got most of my information (and got an almost verbatim version to work) for the windows one here: http://steinsoft.net/index.php?site=Programming/Code%20Snippets/OpenGL/no7 Feel free to ask questions if you can't get it to work. Christian On Tue, Jun 1, 2010 at 3:36 PM, Andrea wrote:
|
|||||||||||||
|
SDL_GL_SWAP_CONTROL deprecated |
Edgar Simo
Guest
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Hello, I use the following code: #if SDL_VERSION_ATLEAST(1,3,0) SDL_GL_SetSwapInterval(1); #else /* SDL_VERSION_ATLEAST(1,3,0) */ #ifdef SDL_GL_SWAP_CONTROL SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); #else /* SDL_GL_SWAP_CONTROL */ DEBUG("VSync unsupported on old SDL versions (before 1.2.10)."); #endif /* SDL_GL_SWAP_CONTROL */ #endif /* SDL_VERSION_ATLEAST(1,3,0) */ I'm pretty sure it's the "right way" (tm). It also handles the fact that it doesn't exist in old versions either. Edgar On 2010年06月03日 01:23, Christian Leger wrote:
Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkwIHp4ACgkQolm4VNX3QTytrQCfbLgTcPaF6FfAlfLo1QOI/R3a GHQAn0y6LQuz4aGZ1XgxVUrB4z3bbOBR =DG+q -----END PGP SIGNATURE----- _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|
Re: SDL_GL_SWAP_CONTROL deprecated |
hardcoder
|
For SDL 1.3 use SDL_RENDERER_PRESENTVSYNC flag when creating renderer.
|
|||||||||||||
|
SDL_GL_SWAP_CONTROL deprecated |
Christian Leger
Guest
|
Does that mean that extensions like glXSwapIntervalSGI are preferrably avoided? Or simply that using SDL_RENDERER_PRESENTVSYNC is more portable?
Also, does that mean that switching from vsync enable to vsync disabled requires (in 100% portable SDL) the creation of a rendering context? Using the above extension function, I get perfect control over vsync with just a flip of a boolean. Christian On Sat, Jun 5, 2010 at 8:26 AM, hardcoder wrote:
|
|||||||||||||
|