-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with example_sdl_opengl3 #2484
Comments
Do you think you could file an issue on the SDL bug tracker as well? https://bugzilla.libsdl.org/ |
Thanks for the link, I went ahead and filed an issue here: https://bugzilla.libsdl.org/show_bug.cgi?id=4588 |
As additional info, is this on 2.0.9? |
Yes this is on 2.0.9, sorry I should have noted that in the initial post. I checked out this link and indeed it does seem to be the same issue. I replaced |
I have removed the unnecessary May I suggest fixing this issue by actually implementing gamepad support in imgui_impl_sdl.cpp, which has been missing it? Both imgui_impl_glfw.cpp and imgui_impl_win32.cpp already have gamepad support. The byproduct of this improvement would be that passing the I would appreciate a SDL gamepad support PR modelled after the existing ones, if anyone is interested in helping with that! |
I'll take a look and give it a try. |
Closing this as #2509 added the INIT_GAME_CONTROLLER flag anyway. |
Bug is fixed in SDL 2.0.10 anyway :-) |
Version/Branch of Dear ImGui: Tested on tags v1.68, v1.69, & master branch / v1.70 WIP
Back-ends: imgui_impl_sdl.cpp + imgui_impl_opengl.cpp
Compiler: Clang
Operating System: Windows 10 (w/ latest updates)
My Issue:
On my system, the
example_sdl_opengl3
suffers from extreme framerate instability. The framerate oscillates between 55fps and 60fps, with occasional dips to much lower rates causing noticeable hitches in on-screen movement.After 2 days of debugging, I finally discovered the cause:
The example uses the code
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER)
to initialize SDL.Adding the flag
SDL_INIT_GAMECONTROLLER
to the or'd list fixes it.As to why this happens, I'm not really sure. It doesn't seem as though your code is using anything to do with game controllers, and my system does not have a game controller connected. This is likely an issue with SDL, but for the sake of having a clean and reliable reference code, it might be a good idea to add this flag, a comment explaining the potential issue, or to simply use
SDL_INIT_EVERYTHING
.Additional notes:
If you are using this example code as a base for your own work, it might also be useful to know the following:
SDL_INIT_TIMER
seems to be unnecessary. (SDL_GL_SetSwapInterval(1)
works fine without it)SDL_DisplayMode
is unused and can be removed.The text was updated successfully, but these errors were encountered: