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

Commit

Permalink
Force macOS onto SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jan 16, 2024
1 parent 52bba9d commit efb5f5a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
- name: Install deps
run: |
brew update
brew install cmake libpng jpeg
brew install cmake libpng jpeg sdl2
- name: Build
run: |
Expand Down
8 changes: 5 additions & 3 deletions source/Irrlicht/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if(NOT ANDROID AND NOT APPLE)
if(NOT ANDROID)
set(DEFAULT_SDL2 ON)
endif()

Expand Down Expand Up @@ -88,7 +88,10 @@ if(WIN32)
set(DEVICE "WINDOWS")
elseif(APPLE)
add_definitions(-D_IRR_OSX_PLATFORM_)
set(DEVICE "OSX")
if(NOT USE_SDL2)
message(FATAL_ERROR "SDL2 is required on macOS")
endif()
set(DEVICE "SDL")
elseif(ANDROID)
add_definitions(-D_IRR_ANDROID_PLATFORM_)
if(USE_SDL2)
Expand Down Expand Up @@ -191,7 +194,6 @@ if(ENABLE_OPENGL)
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_)
elseif(DEVICE STREQUAL "OSX")
add_definitions(-D_IRR_COMPILE_WITH_NSOGL_MANAGER_)
# FIXME broken due to missing glext.h now!
endif()
endif()

Expand Down
6 changes: 2 additions & 4 deletions source/Irrlicht/COpenGLCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,14 @@
#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/wglext.h>
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#define GL_GLEXT_LEGACY 1
#include <OpenGL/gl.h>
#include <GL/glext.h>
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#define GL_GLEXT_LEGACY 1
#include <SDL_video.h>
#include <SDL_opengl.h>
// The SDL2 header doesn't cut it for extensions
#include <GL/glext.h>
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#error Not supposed to get here
#else
#define GL_GLEXT_LEGACY 1
#define GLX_GLXEXT_LEGACY 1
Expand Down

0 comments on commit efb5f5a

Please sign in to comment.