Skip to content
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

Support for Glbinding loader library in OpenGL3 example. #2870

Closed
wants to merge 1 commit into from
Closed

Support for Glbinding loader library in OpenGL3 example. #2870

wants to merge 1 commit into from

Conversation

ilia-glushchenko
Copy link

Hello!

I think it is a good time to add support for https://github.com/cginternals/glbinding to ImGui.
Since there is already a compile-time check in place for a couple of popular GL bindings libraries such as Glad and Gl3w.
I think this is a shame that we still don't have out of the box support for Glbinding. This is a modern fancy OpenGL biding library that many (myself included) enjoy using.
I really like using example OpenGL3 IMGUI rendering implementation in my projects (and I'm pretty sure many others do as well) as a simple and cheap out of the box solution. However, I also don't really like to modify or do some custom things with my modules, such as adding my custom define statements, which is my main motivation for this PR.

Thanks!

@@ -19,6 +19,9 @@
#include <GL/glew.h> // Initialize with glewInit()
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
#include <glad/glad.h> // Initialize with gladLoadGL()
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING)
#include <glbinding/gl/gl.h> // glbinding::Binding::initialize();
using namespace gl;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use same comment syntax as other comments above.

@@ -114,6 +114,9 @@
#include <GL/glew.h> // Needs to be initialized with glewInit() in user's code
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
#include <glad/glad.h> // Needs to be initialized with gladLoadGL() in user's code
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING)
#include <glbinding/gl/gl.h> // Needs to be initialized with gladLoadGL() in user's code
using namespace gl; // Has to be set to expose OpenGL to the global namespace
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong function name here.
May remove "Has to be set to".

@ocornut
Copy link
Owner

ocornut commented Oct 25, 2019

Thank you for the PR @ilia-glushchenko
I added some comments above. In addition, could do also:

  • Update the local changelog at the top of imgui_impl_opengl3.cpp
  • Update example_glfw_opengl3/main.cpp and example_sdl_opengl3/main.cpp to support glbinding.
  • Update example_glfw_opengl3/Makefile and example_sdl_opengl3/Makefile to support glbinding.
  • Update examples/README.txt with reference to glbinding everywhre Glad/Gl3w etc are mention.

Thank you!

@ocornut
Copy link
Owner

ocornut commented Oct 25, 2019

An assignment is also missing in ImGui_ImplOpenGL3_Init()

@ocornut
Copy link
Owner

ocornut commented Nov 5, 2019

Hello @ilia-glushchenko,
Would you like to finish this PR?

@ilia-glushchenko
Copy link
Author

ilia-glushchenko commented Nov 5, 2019

Hello @ocornut,
Yeah, sorry for the delay. I'm going to upload a new iteration by the end of the week I think.

rokups added a commit to rokups/imgui that referenced this pull request Jan 7, 2020
@ocornut
Copy link
Owner

ocornut commented Jan 7, 2020

This has now been solved by @rokups (apart from missing makefile update, we will do that soon)

@ocornut ocornut closed this Jan 7, 2020
DonKult added a commit to DonKult/imgui that referenced this pull request Mar 15, 2020
For the moment I have only the older 2.x series available on my system
which uses slightly different header filenames and initialisation, so
as a slight variation of the 3.x series support recently implemented
here the glue needed to make 2.x series work.

I would hope a potential 4.x will not change filenames and such, so the
existing flag isn't rebranded to 3 which also avoids breaking compat.

References: ocornut#2870, 5e2329b
DonKult added a commit to DonKult/imgui that referenced this pull request Mar 15, 2020
For the moment I have only the older 2.x series available on my system
which uses slightly different header filenames and initialisation, so
as a slight variation of the 3.x series support recently implemented
here the glue needed to make 2.x series work.

I would hope a potential 4.x will not change filenames and such, so the
existing flag isn't rebranded to 3 which also avoids breaking compat.

References: ocornut#2870, 5e2329b
DonKult added a commit to DonKult/imgui that referenced this pull request Mar 23, 2020
For the moment I have only the older 2.x series available on my system
which uses slightly different header filenames and initialisation, so
as a slight variation of the 3.x series support recently implemented
here the glue needed to make 2.x series work as well.

As having a versioned and a unversioned definition is deemed to
confusing we use the unversioned definition for auto-detection on
supporting compilers and add two versioned definitions for explicit
requests.

References: ocornut#2870, 5e2329b
DonKult added a commit to DonKult/imgui that referenced this pull request Mar 24, 2020
For the moment I have only the older 2.x series available on my system
which uses slightly different header filenames and initialisation, so
as a slight variation of the 3.x series support recently implemented
here the glue needed to make 2.x series work as well.

This removes the unversioned definition IMGUI_IMPL_OPENGL_LOADER_GLBINDING
in favour of two versioned ones to choose explicitly.

References: ocornut#2870, 5e2329b
ocornut pushed a commit that referenced this pull request Mar 24, 2020
…r OpenGL3 (#3061)

This removes the unversioned definition IMGUI_IMPL_OPENGL_LOADER_GLBINDING in favor of two versioned ones to choose explicitly.
References: #2870, 5e2329b
sergeyn pushed a commit to sergeyn/imgui that referenced this pull request Mar 30, 2020
…r OpenGL3 (ocornut#3061)

This removes the unversioned definition IMGUI_IMPL_OPENGL_LOADER_GLBINDING in favor of two versioned ones to choose explicitly.
References: ocornut#2870, 5e2329b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants