1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Non-SDL: Add opengl3 support

This commit is contained in:
SmallJoker 2024-11-02 15:51:44 +01:00 committed by sfan5
parent 87ac32edea
commit 4838eb2f7d
10 changed files with 107 additions and 139 deletions

View file

@ -123,10 +123,10 @@ if(USE_SDL2)
if(NOT ANDROID)
set(DEFAULT_OPENGL3 TRUE)
endif()
option(ENABLE_OPENGL3 "Enable OpenGL 3+" ${DEFAULT_OPENGL3})
else()
set(ENABLE_OPENGL3 FALSE)
set(DEFAULT_OPENGL3 FALSE)
endif()
option(ENABLE_OPENGL3 "Enable OpenGL 3+" ${DEFAULT_OPENGL3})
if(ANDROID OR EMSCRIPTEN)
set(ENABLE_OPENGL FALSE)
@ -152,9 +152,11 @@ else()
endif()
endif()
if(ENABLE_OPENGL)
add_definitions(-D_IRR_COMPILE_WITH_OPENGL_)
set(OPENGL_DIRECT_LINK TRUE) # driver relies on this
if(ENABLE_OPENGL OR (ENABLE_OPENGL3 AND NOT USE_SDL2))
if(ENABLE_OPENGL)
add_definitions(-D_IRR_COMPILE_WITH_OPENGL_)
set(OPENGL_DIRECT_LINK TRUE) # driver relies on this
endif()
if(DEVICE STREQUAL "WINDOWS")
add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_)
elseif(DEVICE STREQUAL "X11")
@ -165,7 +167,11 @@ if(ENABLE_OPENGL)
endif()
if(ENABLE_OPENGL3)
if (NOT USE_SDL2)
if(DEVICE STREQUAL "WINDOWS")
# supported
elseif(DEVICE STREQUAL "X11")
# supported
elseif (NOT USE_SDL2)
message(FATAL_ERROR "OpenGL 3 driver requires SDL2")
endif()
endif()