-
Notifications
You must be signed in to change notification settings - Fork 171
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
OpenGL3 is not working with ImGui-SFML #159
Comments
I wanna analyze this issue. 😄 |
That'll be very helpful. I think that ideally both render implementations should be separated into different files and the user should be able to choose OpenGL3 impl if they want to. OpenGL2 should be the default because it doesn't require any additional dependencies, while OpenGL3 one is much trickier as it requires some OpenGL loader to be present... But we really don't want to have all implementations in imgui-SFML.cpp (it's already too big) We should follow Dear ImGui's example implementations more closely (especially SDL example) |
Alright, I'll check these files and start to implement it. 🍡 |
You should look at how it separates rendering from "platform" things. I think that we should have something like imgui-SFML.h/cpp, imgui-SFML_OpenGL2.h/cpp and imgui-SFML_OpenGL3.h/cpp I think that the users should not care about including these new header files into their build. The switch between OpenGL2/OpenGL3 should be performed by IMGUI_SFML_USE_OPENGL3 define (which should also be an option in CMake) but the API will remain the same - the user will only have to call |
I think that in the most perfect scenario we'll be able to just use |
I got it to work with opengl3 by removing all the rendering stuff from the https://gist.github.com/LucasM127/76dfa83b52ba6313c12a114af1696f71 |
@LucasM127 thanks! This will be very helpful for me to get started. |
Related: #40 #55 #70 #109
Currently, OpenGL 2 is used for rendering Dear ImGui;s widgets and it's done similarly to this backend implementation.
However, to properly restore state when drawing things in OpenGL 3+, this implementation should be used.
This is not as easy to integrate, because it will require us to start depending on some kind of OpenGL loader (glew, glad, etc.). We'll also need the option to switch between different render implementations which also adds another layer of complexity.
So, I think that it will be nice for someone who uses OpenGL 3+ and SFML to try to use this code instead of calling
ImGui::SFML::Render(window)
. If there are some things that will prevent you from using it properly (some things being private, perhaps?), feel free to report such things here - I'll see what I can do.The text was updated successfully, but these errors were encountered: