forked from Mirrorlandia_minetest/irrlicht
Enable unified driver with all devices
This commit is contained in:
parent
19f0f707a6
commit
0a77ef5dc2
@ -199,8 +199,6 @@ if(ENABLE_OPENGL3)
|
|||||||
if (NOT USE_SDL2)
|
if (NOT USE_SDL2)
|
||||||
message(FATAL_ERROR "OpenGL 3 driver requires SDL2")
|
message(FATAL_ERROR "OpenGL 3 driver requires SDL2")
|
||||||
endif()
|
endif()
|
||||||
set(USE_SDLGL ON)
|
|
||||||
set(USE_SDLGL3 ON)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_GLES1)
|
if(ENABLE_GLES1)
|
||||||
@ -216,12 +214,8 @@ endif()
|
|||||||
|
|
||||||
if(ENABLE_GLES2)
|
if(ENABLE_GLES2)
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_OGLES2_)
|
add_definitions(-D_IRR_COMPILE_WITH_OGLES2_)
|
||||||
set(OPENGLES2_DIRECT_LINK TRUE) # not yet possible to remove this
|
|
||||||
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$" OR EMSCRIPTEN)
|
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$" OR EMSCRIPTEN)
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_)
|
add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_)
|
||||||
elseif(DEVICE STREQUAL "SDL")
|
|
||||||
set(USE_SDLGL ON)
|
|
||||||
set(USE_SDLGLES2 ON)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -243,10 +237,8 @@ message(STATUS "Device: ${DEVICE}")
|
|||||||
message(STATUS "OpenGL: ${ENABLE_OPENGL}")
|
message(STATUS "OpenGL: ${ENABLE_OPENGL}")
|
||||||
message(STATUS "OpenGL 3: ${ENABLE_OPENGL3}")
|
message(STATUS "OpenGL 3: ${ENABLE_OPENGL3}")
|
||||||
message(STATUS "OpenGL ES: ${ENABLE_GLES1}")
|
message(STATUS "OpenGL ES: ${ENABLE_GLES1}")
|
||||||
if (USE_SDLGLES2)
|
if (ENABLE_GLES2)
|
||||||
message(STATUS "OpenGL ES 2: ON (unified)")
|
message(STATUS "OpenGL ES 2: ON (unified)")
|
||||||
elseif (ENABLE_GLES2)
|
|
||||||
message(STATUS "OpenGL ES 2: ON (legacy)")
|
|
||||||
else()
|
else()
|
||||||
message(STATUS "OpenGL ES 2: OFF")
|
message(STATUS "OpenGL ES 2: OFF")
|
||||||
endif()
|
endif()
|
||||||
@ -347,6 +339,8 @@ set(IRRDRVROBJ
|
|||||||
mt_opengl_loader.cpp
|
mt_opengl_loader.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# the two legacy drivers
|
||||||
|
|
||||||
if(ENABLE_OPENGL)
|
if(ENABLE_OPENGL)
|
||||||
set(IRRDRVROBJ
|
set(IRRDRVROBJ
|
||||||
${IRRDRVROBJ}
|
${IRRDRVROBJ}
|
||||||
@ -365,6 +359,33 @@ if(ENABLE_GLES1)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# the unified drivers
|
||||||
|
|
||||||
|
if(ENABLE_OPENGL3 OR ENABLE_GLES2)
|
||||||
|
set(IRRDRVROBJ
|
||||||
|
${IRRDRVROBJ}
|
||||||
|
OpenGL/Driver.cpp
|
||||||
|
OpenGL/ExtensionHandler.cpp
|
||||||
|
OpenGL/FixedPipelineRenderer.cpp
|
||||||
|
OpenGL/MaterialRenderer.cpp
|
||||||
|
OpenGL/Renderer2D.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_OPENGL3)
|
||||||
|
set(IRRDRVROBJ
|
||||||
|
${IRRDRVROBJ}
|
||||||
|
OpenGL3/Driver.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_GLES2)
|
||||||
|
set(IRRDRVROBJ
|
||||||
|
${IRRDRVROBJ}
|
||||||
|
OpenGLES2/Driver.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(IRRIMAGEOBJ
|
set(IRRIMAGEOBJ
|
||||||
CColorConverter.cpp
|
CColorConverter.cpp
|
||||||
CImage.cpp
|
CImage.cpp
|
||||||
@ -382,37 +403,6 @@ add_library(IRRVIDEOOBJ OBJECT
|
|||||||
${IRRIMAGEOBJ}
|
${IRRIMAGEOBJ}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(USE_SDLGL)
|
|
||||||
target_sources(IRRVIDEOOBJ PRIVATE
|
|
||||||
OpenGL/Driver.cpp
|
|
||||||
OpenGL/ExtensionHandler.cpp
|
|
||||||
OpenGL/FixedPipelineRenderer.cpp
|
|
||||||
OpenGL/MaterialRenderer.cpp
|
|
||||||
OpenGL/Renderer2D.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_SDLGL3)
|
|
||||||
target_sources(IRRVIDEOOBJ PRIVATE
|
|
||||||
OpenGL3/Driver.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_SDLGLES2)
|
|
||||||
target_sources(IRRVIDEOOBJ PRIVATE
|
|
||||||
OpenGLES2/Driver.cpp
|
|
||||||
)
|
|
||||||
elseif(ENABLE_GLES2)
|
|
||||||
target_sources(IRRVIDEOOBJ PRIVATE
|
|
||||||
COGLES2Driver.cpp
|
|
||||||
COGLES2ExtensionHandler.cpp
|
|
||||||
COGLES2FixedPipelineRenderer.cpp
|
|
||||||
COGLES2MaterialRenderer.cpp
|
|
||||||
COGLES2Renderer2D.cpp
|
|
||||||
CWebGL1Driver.cpp
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_library(IRRIOOBJ OBJECT
|
add_library(IRRIOOBJ OBJECT
|
||||||
CFileList.cpp
|
CFileList.cpp
|
||||||
CFileSystem.cpp
|
CFileSystem.cpp
|
||||||
@ -519,7 +509,6 @@ target_link_libraries(IrrlichtMt PRIVATE
|
|||||||
|
|
||||||
"$<$<BOOL:${OPENGL_DIRECT_LINK}>:${OPENGL_LIBRARIES}>"
|
"$<$<BOOL:${OPENGL_DIRECT_LINK}>:${OPENGL_LIBRARIES}>"
|
||||||
"$<$<BOOL:${OPENGLES_DIRECT_LINK}>:${OPENGLES_LIBRARY}>"
|
"$<$<BOOL:${OPENGLES_DIRECT_LINK}>:${OPENGLES_LIBRARY}>"
|
||||||
"$<$<BOOL:${OPENGLES2_DIRECT_LINK}>:${OPENGLES2_LIBRARIES}>"
|
|
||||||
${EGL_LIBRARY}
|
${EGL_LIBRARY}
|
||||||
|
|
||||||
"$<$<PLATFORM_ID:Android>:-landroid -llog>"
|
"$<$<PLATFORM_ID:Android>:-landroid -llog>"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||||
|
|
||||||
#if defined(_IRR_WINDOWS_API_)
|
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define GL_GLEXT_LEGACY 1
|
#define GL_GLEXT_LEGACY 1
|
||||||
|
@ -5,9 +5,21 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#include "irrTypes.h"
|
||||||
#include <SDL_video.h>
|
// even though we have mt_opengl.h our driver code still uses GL_* constants
|
||||||
#include <SDL_opengl.h>
|
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
|
||||||
|
#include <OpenGL/gl.h>
|
||||||
|
// not sure if this works without glext.h?
|
||||||
|
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
||||||
|
#include <SDL_video.h>
|
||||||
|
#include <SDL_opengl.h>
|
||||||
|
#else
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glext.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user