Jump to content
  • Advertisement
Sign in to follow this  
RetroBilly

wglSwapInterval in main loop?

This topic is 2498 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I try to set wglSwapInterval when my program starts it doesn't work. Will it hurt performance if I place it in my main loop?

Share this post


Link to post
Share on other sites
Advertisement
Don't put anything in your main loops you don't need.

Particularly, don't change global configuration settings like this. Why? Because behind the scenes it could have to do a lot of faffing about with the driver state. It may (just for example) want to flush the drawing queue or something like that[1]. Without tracing the behaviour, you can't be sure about that and you can't be sure that the effect will be the same on all the different drivers out there.

When you say that it doesn't work when your program starts, does it return an error? Crash? Simply not apply the setting? And are you sure you have a valid established context at the time you issue it?




[1] Certainly I have seen[2] non-OpenGL drivers where the config systems just had a big exclusive lock on them to prevent rendering and changing overlapping. There's usually no problem with this because most of the time, people do setup in one go and only then start rendering.


[2] And on at least one occasion written.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!