We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4067 - OpenGL VSYNC not working when in fullscreen on external monitor.
Summary: OpenGL VSYNC not working when in fullscreen on external monitor.
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: 2.0.7
Hardware: x86 macOS 10.13
: P2 major
Assignee: akakubiyaro
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-26 19:21 UTC by akakubiyaro
Modified: 2018-02-01 19:15 UTC (History)
1 user (show)

See Also:


Attachments
I went ahead and attached the basic test program I created to showcase the issue. (4.55 KB, text/plain)
2018-01-31 21:01 UTC, akakubiyaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description akakubiyaro 2018-01-26 19:21:37 UTC
I've been programming on my MacBook and sometimes I attach an external monitor. When I create a fullscreen OpenGL app on this screen I notice severe tearing despite vsync being on. I created an extremely basic openGL program (draw a textured quad and move it around the screen) and the results are the same.

I re-did this test program using the GLFW and Allegro5 libraries just to make sure it's something with SDL2 specifically and both those libraries rendered the scene perfectly with no tearing despite the monitor setup.

I'm not sure about other platforms. Please let me know if you guys need more info.
Comment 1 akakubiyaro 2018-01-31 21:01:14 UTC
Created attachment 3157 [details]
I went ahead and attached the basic test program I created to showcase the issue.

If you compile this test program agains the latest SDL and run it on an external monitor, you should see screen tearing even tho vsync is on. At least that's what happens to me :(
Comment 2 akakubiyaro 2018-01-31 21:02:53 UTC
PS. Just in case it's not clear from the code, you can use the WASD keys to scroll the screen around. Hit ESCAPE to quit.
Comment 3 akakubiyaro 2018-02-01 05:19:57 UTC
Ugh. I resolved this. I noticed that in the test program I attached I omited two lines from my original program:

SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, ...);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, ...);

I had passed in some bad values to these and apparently it results in weird inconsistent frame rate and screen tearing! Sorry for the faulty bug report.
Comment 4 Sam Lantinga 2018-02-01 19:15:22 UTC
Ah, glad to hear it. Thanks for the update!