Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


[SDL] No vsync in windowed mode?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Simagery   Members   -  Reputation: 732

Like
0Likes
Like

Posted 16 March 2006 - 12:04 PM

Another newbie SDL question that Google doesn't seem to help with... when running in fullscreen, my SDL_Flip is definitely waiting for vsync. In windowed mode, though, it's definitely *not* waiting for vsync. According to the SDL docs, SDL_Flip should always wait for vsync. Any ideas? I saw mention somewhere that if you're using OpenGL with SDL then it will always wait for vsync regardless of fullscreen or not... can anyone comment on that as I do plan on eventually throwing OpenGL on top of SDL. Thanks.

Sponsor:

#2 Kylotan   Moderators   -  Reputation: 3338

Like
0Likes
Like

Posted 17 March 2006 - 12:44 AM

I don't think vsync is a consideration in windowed mode. In Windowed mode you don't have direct access to or control over the screen, and any actual buffer flipping is handled by the OS, not by SDL. So there's little point SDL_Flip waiting for vsync, if it's even possible. You see where the SDL_Flip docs say, "On hardware that doesn't support double-buffering, this is equivalent to calling SDL_UpdateRect(screen, 0, 0, 0, 0)"? That generally applies to windowed mode. There's a big difference between the modes which comes down to more than just how large your window is, you see. I don't think it should ever be a problem though.

#3 Simagery   Members   -  Reputation: 732

Like
0Likes
Like

Posted 17 March 2006 - 05:25 AM

It's definitely a problem, though, due to tearing. Vsync acts as a nice, natural maximum for rendering that simply capping framerate doesn't give you. But it's really down to the tearing.

Hmm... I'm hoping I can change this (it's certainly not a limitation of the underlying API, DirectDraw).


#4 Kylotan   Moderators   -  Reputation: 3338

Like
0Likes
Like

Posted 20 March 2006 - 08:01 AM

Actually, I'm pretty sure that buffer flipping in DirectDraw only works in exclusive mode (ie. fullscreen), and I think that is the only function that explicitly waits for Vsync.

EDIT: There is "IDirectDraw::WaitForVerticalBlank" but I don't think that was available in DirectX 6.

#5 Simagery   Members   -  Reputation: 732

Like
0Likes
Like

Posted 20 March 2006 - 10:20 AM

Well, that's fairly disappointing. You're right, non-fullscreen DirectDraw would by default be using blitting instead of flipping, and thus does not automatically wait for vsync.

Does anyone know if when I switch to an OpenGL context (still using SDL) if I'll be able to control vsync in windowed mode?


#6 Scet   Members   -  Reputation: 960

Like
0Likes
Like

Posted 20 March 2006 - 10:23 AM

SDL_gfx contains functions for managing the FPS. You could always try that.

#7 Simagery   Members   -  Reputation: 732

Like
0Likes
Like

Posted 20 March 2006 - 10:27 AM

Yeah, that's part of it, but the real deal is the tearing. My desire is for a polished display, and eliminating tearing is a big part of that. Capping the framerate, particularly if you can cap it below the refresh rate, is a good way to prevent evil tearing artifacts like things not being completely visible (what I have now in windowed mode).


#8 JMD   Members   -  Reputation: 122

Like
0Likes
Like

Posted 11 April 2008 - 09:52 AM

Quote:
Original post by Simagery
Yeah, that's part of it, but the real deal is the tearing. My desire is for a polished display, and eliminating tearing is a big part of that. Capping the framerate, particularly if you can cap it below the refresh rate, is a good way to prevent evil tearing artifacts like things not being completely visible (what I have now in windowed mode).


Hello!
I am using SDL as well and would like to eliminate tearing. Is there anyone who can give us some hints to get a smooth scroll in a window or in full screen in a Windows program? How can we check when there is a vertical retrace with SDL? SDL_Flip doesn't seem to do this job on my machine.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS