-
Notifications
You must be signed in to change notification settings - Fork 3
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
Opengl loader dependencies #9
Comments
I'm not sure I understand... you want to do Can you clarify the problem with the current meson_options.txt based approach? |
Ill use the current patch meson_options.txt
meson.build
end user meson.build using glad for example
this can be done currently by redefining glew for example but this should be more readable and less likely to cause conflict in the future |
If you look at If you look in the Lines 40 to 44 in 025c4df
You see that I simply replace I want OpenGL with I use OpenGL with GLEW . One could add more options and adding compile flags, but as I mentioned here, I don't really care about the other options (I also don't think there is a lot of demand for this).
|
Yes, I also don't want to bother adding every single other OpenGL loader so I am instead proposing to add a more generic option so you don't have to override the glew dependency when someone wants to use something else. |
Btw I will probably do this for 1.82 since MangoHud now started using a OpenGL loder (glad). |
What is the intended way of choosing the opengl loader with the current meson setup? My current solution is to manually change glew for glad, and add in the right definition, like so: diff --git a/meson.build b/meson.build
index c7bd7da..d10f7fa 100644
--- a/meson.build
+++ b/meson.build
@@ -8,6 +8,7 @@ sources = ['imgui_demo.cpp', 'imgui_draw.cpp', 'imgui_tables.cpp', 'imgui_widget
cpp = meson.get_compiler('cpp')
dependencies = []
+cpp_args = []
# renderer backends
dx9_dep = cpp.find_library('d3d9', required: get_option('dx9'))
@@ -38,6 +39,7 @@ endif
glad_dep = dependency('glad', required: get_option('opengl'))
if glad_dep.found()
sources += 'backends/imgui_impl_opengl3.cpp'
+ cpp_args += '-DIMGUI_IMPL_OPENGL_LOADER_GLAD'
dependencies += glad_dep
endif
vulkan_dep = dependency('vulkan', required: get_option('vulkan'))
@@ -80,6 +82,7 @@ imgui = library('imgui',
sources,
dependencies: dependencies,
include_directories: include_dirs,
+ cpp_args: cpp_args
)
imgui_dep = declare_dependency(include_directories: include_dirs, link_with: imgui) but I'm not sure if this is really the best way, because now I'll have to manage my own wrapfile to have this work for other machines as well. |
Unfortunately their isn't a way of changing the opengl loader that is the topic of this discussion to add such a feature. It is possible to override the glew dependency with a custom glad dependency if you won't to use the standard wrap file. |
Is this something which could be solved via e.g.
Then the value of -Dopengl-type=glad would cause it to look up |
Actually, we can close this now: ocornut/imgui#4445 Dear ImGui now ships its own loader, meaning we don't have to deal with this anymore. Unfortunately, I'm very busy at the moment and don't have time to code until mid-October. |
I was thinking about this earlier but the - recent pull request reminded me. The opengl loader dependencie situation instead of trying to add all the dependencies for every library what if we had a option to use a dependencie like IMGUI_OPENGL_LOADER and the user could define that before they call the subproject I plan on implementing it but I wanted to check to make sure it's ok to do something like that
The text was updated successfully, but these errors were encountered: