From 5e24bba51581be4759bc32871a4799adc6d75ba4 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Wed, 17 Jan 2024 00:05:13 +0100 Subject: [PATCH] Enable SDL to work on macOS --- .github/workflows/build.yml | 14 ++++++++++++++ source/Irrlicht/COpenGLCommon.h | 19 +++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7fefa4008..d665ed78c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,6 +177,20 @@ jobs: run: | ./bin/OSX/AutomatedTest null + macos-sdl: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - name: Install deps + run: | + brew update + brew install cmake libpng jpeg sdl2 + + - name: Build + run: | + cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1 -DUSE_SDL2=1 + make -j3 + msvc: name: VS 2019 ${{ matrix.config.arch }} ${{ matrix.sdl.label }} runs-on: windows-2019 diff --git a/source/Irrlicht/COpenGLCommon.h b/source/Irrlicht/COpenGLCommon.h index 66ad81dff..dd49864ab 100644 --- a/source/Irrlicht/COpenGLCommon.h +++ b/source/Irrlicht/COpenGLCommon.h @@ -17,14 +17,6 @@ #include #endif #include -#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_) - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #define GL_GLEXT_LEGACY 1 - #endif - #include - #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - #include - #endif #elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_) #define GL_GLEXT_LEGACY 1 @@ -34,8 +26,15 @@ #include #include #if defined(_IRR_OPENGL_USE_EXTPOINTER_) - // The SDL2 header doesn't cut it for extensions - #include + #include + #endif +#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_) + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #define GL_GLEXT_LEGACY 1 + #endif + #include + #if defined(_IRR_OPENGL_USE_EXTPOINTER_) + #error glext.h missing on OSX #endif #else #if defined(_IRR_OPENGL_USE_EXTPOINTER_)