master #5

Merged
BRNSystems merged 45 commits from Mirrorlandia_minetest/irrlicht:master into master 2024-02-27 13:26:18 +01:00
2 changed files with 20 additions and 2 deletions
Showing only changes of commit 54de743641 - Show all commits

@ -185,7 +185,7 @@ endif()
if(ENABLE_OPENGL) if(ENABLE_OPENGL)
add_definitions(-D_IRR_COMPILE_WITH_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") if(DEVICE STREQUAL "WINDOWS")
add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_) add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_)
elseif(DEVICE STREQUAL "X11") elseif(DEVICE STREQUAL "X11")
@ -269,6 +269,24 @@ if(USE_SDL2)
message(STATUS "Found SDL2: ${SDL2_LIBRARIES}") message(STATUS "Found SDL2: ${SDL2_LIBRARIES}")
endif() endif()
# More special config
if(ENABLE_OPENGL AND DEVICE STREQUAL "SDL")
# The legacy GL driver requires some symbols from GL 4.5 to compile,
# which SDL only provides since 2.26.0 (Nov 2022).
# We have a fallback in case this isn't satisfied so test for it.
set(CMAKE_REQUIRED_INCLUDES ${SDL2_INCLUDE_DIRS})
unset(CHECK_GL_VERSION_4_5 CACHE)
check_cxx_source_compiles("#include <SDL_opengl.h>\n\
#ifndef GL_VERSION_4_5\n\
#error\n\
#endif\n\
int main() {}" CHECK_GL_VERSION_4_5)
if(CHECK_GL_VERSION_4_5)
add_definitions(-DIRR_PREFER_SDL_GL_HEADER)
endif()
endif()
# Platform-specific libs # Platform-specific libs
if(ANDROID) if(ANDROID)

@ -6,7 +6,7 @@
#ifdef _IRR_COMPILE_WITH_OPENGL_ #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_video.h>
#include <SDL_opengl.h> #include <SDL_opengl.h>
#else #else