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

Allow glad to be excluded in favor of a custom frontend's own OpenGL function loader #1716

Closed
wants to merge 1 commit into from

Conversation

JesseTG
Copy link
Contributor

@JesseTG JesseTG commented Jul 6, 2023

Since melonDS DS is backed by libretro, the libretro frontend will have its own method of loading OpenGL functions. Using glad would conflict with that method, so I made it optional and added some instructions on using a private header.

This makes no difference to regular melonDS builds.

@CasualPokePlayer
Copy link
Contributor

CasualPokePlayer commented Jul 18, 2023

Why not just use gladLoadGLLoader (in which you pass a function pointer which can return gl functions by name).

@JesseTG
Copy link
Contributor Author

JesseTG commented Jul 20, 2023

I can do that? Huh. I'll be damned. Thanks for the tip! I'll give it a shot if I ever discover any problems with my weird workaround. If that doesn't work, then I'll revisit the issue.

@JesseTG JesseTG closed this Jul 20, 2023
@JesseTG
Copy link
Contributor Author

JesseTG commented Aug 5, 2023

Ah, I remember what the problem was; if I don't apply my compiler-flags workaround, then I get a cascade of compiler errors that look like this:

C:\tools\msys64\mingw64\bin\c++.exe -DCORE -DENABLE_JIT -DENABLE_OGLRENDERER -DHAVE_DYLIB -DHAVE_DYNAMIC -DHAVE_GETADDRINFO -DHAVE_JIT -DHAVE_JIT_FASTMEM -DHAVE_NETWORKING -DHAVE_NETWORKING_DIRECT_MODE -DHAVE_OPENGL -DHAVE_THREADS -DHAVE_ZLIB -DJIT_ENABLED -DMELONDSDS_NAME="\"melonDS DS\"" -DMELONDSDS_VERSION=\"0.2.0\" -DOGLRENDERER_ENABLED -Dlibretro_EXPORTS -IC:/Users/Jesse/Projects/melonds-ds/SYSTEM -IC:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/src/libretro -isystem C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/libretro-common-src/include -isystem C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/melonds-src/src -isystem C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/glm-src -isystem C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/melonds-src/src/frontend/qt_sdl -isystem C:/Users/Jesse/Projects/melonds-ds/src/libretro -isystem C:/tools/msys64/mingw64/bin/../include/slirp -isystem C:/tools/msys64/mingw64/bin/../include/glib-2.0 -isystem C:/tools/msys64/mingw64/bin/../lib/glib-2.0/include -DGLM_FORCE_XYZW_ONLY -g -std=gnu++17 -fdiagnostics-color=always -fPIC -pie -MD -MT src/libretro/CMakeFiles/libretro.dir/libretro.cpp.obj -MF src\libretro\CMakeFiles\libretro.dir\libretro.cpp.obj.d -o src/libretro/CMakeFiles/libretro.dir/libretro.cpp.obj -c C:/Users/Jesse/Projects/melonds-ds/src/libretro/libretro.cpp
In file included from C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/melonds-src/src/PlatformOGL.h:7,
                 from C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/melonds-src/src/OpenGLSupport.h:26,
                 from C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/melonds-src/src/GPU_OpenGL.h:21,
                 from C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/melonds-src/src/GPU.h:28,
                 from C:/Users/Jesse/Projects/melonds-ds/src/libretro/libretro.cpp:39:
C:/Users/Jesse/Projects/melonds-ds/cmake-build-debug-windows/_deps/melonds-src/src/frontend/glad/glad.h:27:2: error: #error OpenGL header already included, remove this include, glad already provides it
   27 | #error OpenGL header already included, remove this include, glad already provides it
      |  ^~~~~

Libretro #includes its own OpenGL function/macro definitions. melonDS also #includes its own OpenGL function/macro definitions (via glad).

@JesseTG
Copy link
Contributor Author

JesseTG commented Jul 18, 2024

Superseded by #2102

@JesseTG JesseTG closed this Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants