You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the example_sdl2_opengl3 project on Windows, I found that when I enabled the vertical synchronization function, that is, set SDL_GL_SetSwapInterval to 1, the frame rate should be limited to the screen refresh rate. Before this, I also tested it on a laptop. This function worked on my laptop and it was limited to 60 frames. But when I changed the device, this SDL_GL_SetSwapInterval function did not work. What is the reason?
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
SDL_GL_SetSwapInterval(1); // Enable vsync
The text was updated successfully, but these errors were encountered:
I believe it may be overridden (globally or per executable) in some drivers settings.
Either way, take note that this is a SDL question, not a Dear ImGui question. I agree that in principle it would be nice if our example apps were more battle-tested for all situations, but it would make them much more complicated too.
Thanks for your answer. You mentioned the driver, which is a good direction. I paid special attention to the vertical synchronization option of the local NVIDIA graphics card. When I saw this option, it was turned off. When it was enabled, the frame rate was limited to 60 regardless of whether I used SDL_GL_SetSwapInterval. At this point, I feel that things are somewhat clear. I guess that the priority of the driver configuration item is higher than what I set here. The problem I mentioned before also makes sense, because I disabled vertical synchronization in the driver at the beginning, which made it meaningless whether I turned on SDL_GL_SetSwapInterval or not.
Version/Branch of Dear ImGui:
Version v1.91.8, Branch: master
Back-ends:
imgui_impl_sdl2.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Windows10 + MSVC 2019
Full config/build information:
No response
Details:
When I run the example_sdl2_opengl3 project on Windows, I found that when I enabled the vertical synchronization function, that is, set SDL_GL_SetSwapInterval to 1, the frame rate should be limited to the screen refresh rate. Before this, I also tested it on a laptop. This function worked on my laptop and it was limited to 60 frames. But when I changed the device, this SDL_GL_SetSwapInterval function did not work. What is the reason?
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: