From db1879d098f062f8b95b86f19ddd7cb5db9c1001 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Fri, 20 Jun 2025 17:48:30 +0800 Subject: [PATCH] [Fix]: fix GLX GetProcAddress not exported properly --- CMakeLists.txt | 3 +++ .../GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.cpp | 13 +++++++++++++ .../GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.h | 10 ++++++++++ MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp | 1 + 4 files changed, 27 insertions(+) create mode 100644 MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.cpp create mode 100644 MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 485bc8d9..2fcc0d95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,9 @@ find_library(GLSLANG_LIB glslang PATHS ${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/) add_library(${CMAKE_PROJECT_NAME} SHARED MG/Init.cpp + # MG_GL/Implementations/GLX + MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.cpp + # MG_GL/Implementations/GL MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.cpp diff --git a/MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.cpp b/MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.cpp new file mode 100644 index 00000000..a3b442ee --- /dev/null +++ b/MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.cpp @@ -0,0 +1,13 @@ +// +// Created by Swung 0x48 on 2025/6/20. +// + +#include "GLXFuncsDefinitions.h" + +MG_EXPORT void* glXGetProcAddress(const char *name) { + return MG_GL::GLX::GetProcAddress(name); +} + +MG_EXPORT void* glXGetProcAddressARB(const char *name) { + return MG_GL::GLX::GetProcAddressARB(name); +} diff --git a/MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.h b/MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.h new file mode 100644 index 00000000..a9880cef --- /dev/null +++ b/MG/MG_GL/Implementations/GLX/GLXFuncsDefinitions/GLXFuncsDefinitions.h @@ -0,0 +1,10 @@ +// +// Created by Swung 0x48 on 2025/6/20. +// + +#ifndef FOLD_CRAFT_LAUNCHER_GLXFUNCSDEFINITIONS_H +#define FOLD_CRAFT_LAUNCHER_GLXFUNCSDEFINITIONS_H + +#include "../../../../Includes.h" + +#endif //FOLD_CRAFT_LAUNCHER_GLXFUNCSDEFINITIONS_H diff --git a/MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp b/MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp index 9f210a88..603a462d 100644 --- a/MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp +++ b/MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp @@ -8,6 +8,7 @@ namespace MG_GL::GLX { void* GetProcAddress(const char *name) { + MG_Util::Debug::LogD("glXGetProcAddress(\"%s\")", name); void* proc = dlsym(RTLD_DEFAULT, (const char*)name); if (!proc) {