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

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Feb 16, 2024
1 parent da6db13 commit b79c20e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion source/Irrlicht/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,31 @@ endif()

if(ENABLE_OPENGL)
add_definitions(-D_IRR_COMPILE_WITH_OPENGL_)
set(OPENGL_DIRECT_LINK TRUE) # not yet possible to remove this
set(OPENGL_DIRECT_LINK TRUE) # driver relies on this
if(DEVICE STREQUAL "WINDOWS")
add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_)
elseif(DEVICE STREQUAL "X11")
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_)
elseif(DEVICE STREQUAL "OSX")
add_definitions(-D_IRR_COMPILE_WITH_NSOGL_MANAGER_)
endif()

# the driver requires some GL 4.5 symbols to combine and sometimes the SDL
# headers are more out-of-date than the OS ones *facepalm*
if(DEVICE STREQUAL "SDL")
set(CMAKE_REQUIRED_INCLUDES ${SDL2_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${SDL2_LIBRARIES})
check_cxx_source_compiles("#include <SDL_opengl.h>\n\
#ifndef GL_VERSION_4_5\n\
#error\n\
#endif\n\
int main() {}" GL_VERSION_4_5)
set(CMAKE_REQUIRED_INCLUDES "")
set(CMAKE_REQUIRED_LIBRARIES "")
if(GL_VERSION_4_5)
add_definitions(-DIRR_PREFER_SDL_GL_HEADER)
endif()
endif()
endif()

if(ENABLE_OPENGL3)
Expand Down
2 changes: 1 addition & 1 deletion source/Irrlicht/COpenGLCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#ifdef _IRR_COMPILE_WITH_OPENGL_

#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && defined(IRR_PREFER_SDL_GL_HEADER)
#include <SDL_video.h>
#include <SDL_opengl.h>
#else
Expand Down

0 comments on commit b79c20e

Please sign in to comment.