SDL Forum Index
SDL
Simple DirectMedia Layer Forums
Reply to topic
SDL_GL_SWAP_CONTROL deprecated
Andrea
Guest

Reply with quote
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

Reply with quote
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:
Quote:
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
Edgar Simo
Guest

Reply with quote
-----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:
Quote:
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:

Quote:
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 mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-----BEGIN PGP SIGNATURE-----
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


Joined: 06 Jan 2010
Posts: 84
Location: Poznan, Poland
Reply with quote
For SDL 1.3 use SDL_RENDERER_PRESENTVSYNC flag when creating renderer.

Andrea wrote:
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
View user's profileSend private message
SDL_GL_SWAP_CONTROL deprecated
Christian Leger
Guest

Reply with quote
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:
Quote:
For SDL 1.3 use SDL_RENDERER_PRESENTVSYNC flag when creating renderer.



Andrea wrote:


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 mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL_GL_SWAP_CONTROL deprecated
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic