-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Added basic SDL2 example. #58
Conversation
David,
The confusion with SDL2 may be that keycode don't fit within the [512] array, but you can fill the KeyMap array with 0..ImGuiKey_Count-1 and then just fill the KeysDown[] array. In fact the presence of 2 arrays is unnecessary and I will rework the API to remove the [512] array at all. I don't expect you to update the PR but I will keep this open. After I'm done cleaning up the input I could include the finished SDL example in here. I need to rework a few other things which passing input which will break old code so I'd rather do both of them at the same time to limit the hassle. |
Hi Omar, Totally reasonable. I will attempt to address all of the issues you have raised. #37 definitely will help adding keyboard input. I had attempted that, but the exact issues addressed in #37 were giving me grief. I will work on my SDL2 example within the next few days here and push a working example. I'll address the duplication of glfw/glew as well, by placing them in the parent opengl folder. |
I was under the fleeting impression that SDL would be able to work without glfw/glew but that isn't the case? |
FYI there's also an Allegro 5 example here: The extra file are easy to add, but I'm not sure how to integrate them. I don't want solutions building to be failing for users under Windows who don't have the libraries, obviously. So perhaps they should be different solutions? but that's a little extra burden of testing/maintaining. |
More recent SDL2 example merged (#233) |
I have added a basic SDL2 example directory. Thus, opengl_example now includes both a glfw_example and sdl2_example directory. I have tested both glfw and sdl2 directories building on OSX 10.9.4. I have not tested SDL2 on Windows, and in fact windows-specific
#defines
andfunctions
were removed.The SDL2 example is the ultimate bare-minimum to have the widgets showing. There is no keyboard-mapping, for example. As well, SDL2 must already be installed (not included within the example directory itself).
The example could be changed to include the TestWindow, but I know when I first looked at the repository I wanted an example that was the ultimate bare-minimum to get going, so I thought I would implement that. If people want extra functionality, they can look at the other example files to see what else can be added.
Just my thoughts, let me know!