Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Enable SDL to work on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jan 16, 2024
1 parent ee2467d commit 5e24bba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 9 additions & 10 deletions source/Irrlicht/COpenGLCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
#include <GL/glext.h>
#endif
#include <GL/wglext.h>
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1
#endif
#include <OpenGL/gl.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include <GL/glext.h>
#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
Expand All @@ -34,8 +26,15 @@
#include <SDL_video.h>
#include <SDL_opengl.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
// The SDL2 header doesn't cut it for extensions
#include <GL/glext.h>
#include <SDL_opengl_glext.h>
#endif
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#define GL_GLEXT_LEGACY 1
#endif
#include <OpenGL/gl.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#error glext.h missing on OSX
#endif
#else
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
Expand Down

0 comments on commit 5e24bba

Please sign in to comment.