forked from Mirrorlandia_minetest/irrlicht
cleanup: only build some files on WIN32 and compile EGL only if needed
This commit is contained in:
parent
c311d01c07
commit
d98dc90b38
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#include "CEGLManager.h"
|
#include "CEGLManager.h"
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_EGL_MANAGER_
|
|
||||||
|
|
||||||
#include "irrString.h"
|
#include "irrString.h"
|
||||||
#include "irrArray.h"
|
#include "irrArray.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
@ -44,7 +42,7 @@ bool CEGLManager::initialize(const SIrrlichtCreationParameters& params, const SE
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Window is depend on platform.
|
// Window is depend on platform.
|
||||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
#if defined(_IRR_WINDOWS_API_)
|
||||||
EglWindow = (NativeWindowType)Data.OpenGLWin32.HWnd;
|
EglWindow = (NativeWindowType)Data.OpenGLWin32.HWnd;
|
||||||
Data.OpenGLWin32.HDc = GetDC((HWND)EglWindow);
|
Data.OpenGLWin32.HDc = GetDC((HWND)EglWindow);
|
||||||
EglDisplay = eglGetDisplay((NativeDisplayType)Data.OpenGLWin32.HDc);
|
EglDisplay = eglGetDisplay((NativeDisplayType)Data.OpenGLWin32.HDc);
|
||||||
@ -99,7 +97,7 @@ void CEGLManager::terminate()
|
|||||||
EglDisplay = EGL_NO_DISPLAY;
|
EglDisplay = EGL_NO_DISPLAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
#if defined(_IRR_WINDOWS_API_)
|
||||||
if (Data.OpenGLWin32.HDc)
|
if (Data.OpenGLWin32.HDc)
|
||||||
{
|
{
|
||||||
ReleaseDC((HWND)EglWindow, (HDC)Data.OpenGLWin32.HDc);
|
ReleaseDC((HWND)EglWindow, (HDC)Data.OpenGLWin32.HDc);
|
||||||
@ -664,4 +662,3 @@ bool CEGLManager::testEGLError()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_EGL_MANAGER_
|
|
||||||
|
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
|
|
||||||
#include "SIrrCreationParameters.h"
|
#include "SIrrCreationParameters.h"
|
||||||
@ -111,4 +109,3 @@ namespace video
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||||
|
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
|
||||||
|
|
||||||
#if defined (__STRICT_ANSI__)
|
#if defined (__STRICT_ANSI__)
|
||||||
#error Compiling with __STRICT_ANSI__ not supported. g++ does set this when compiling with -std=c++11 or -std=c++0x. Use instead -std=gnu++11 or -std=gnu++0x. Or use -U__STRICT_ANSI__ to disable strict ansi.
|
#error Compiling with __STRICT_ANSI__ not supported. g++ does set this when compiling with -std=c++11 or -std=c++0x. Use instead -std=gnu++11 or -std=gnu++0x. Or use -U__STRICT_ANSI__ to disable strict ansi.
|
||||||
@ -1615,4 +1614,3 @@ core::dimension2di CIrrDeviceWin32::CCursorControl::getSupportedIconSize() const
|
|||||||
|
|
||||||
} // end namespace
|
} // end namespace
|
||||||
|
|
||||||
#endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
|
||||||
|
|
||||||
#include "CIrrDeviceStub.h"
|
#include "CIrrDeviceStub.h"
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
|
|
||||||
@ -425,5 +423,3 @@ namespace irr
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace irr
|
} // end namespace irr
|
||||||
|
|
||||||
#endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
|
||||||
|
@ -78,6 +78,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
|||||||
set(SOLARIS TRUE)
|
set(SOLARIS TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# EGL
|
||||||
|
|
||||||
|
set(ENABLE_EGL OFF)
|
||||||
|
|
||||||
# Device
|
# Device
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
@ -92,8 +96,11 @@ elseif(ANDROID)
|
|||||||
message(FATAL_ERROR "SDL2 device is not (yet) supported on Android")
|
message(FATAL_ERROR "SDL2 device is not (yet) supported on Android")
|
||||||
endif()
|
endif()
|
||||||
set(DEVICE "ANDROID")
|
set(DEVICE "ANDROID")
|
||||||
|
# EGL is required for Android
|
||||||
|
set(ENABLE_EGL ON)
|
||||||
elseif(EMSCRIPTEN)
|
elseif(EMSCRIPTEN)
|
||||||
add_definitions(-D_IRR_EMSCRIPTEN_PLATFORM_ -D_IRR_COMPILE_WITH_EGL_MANAGER_)
|
add_definitions(-D_IRR_EMSCRIPTEN_PLATFORM_)
|
||||||
|
set(ENABLE_EGL ON)
|
||||||
set(LINUX_PLATFORM TRUE)
|
set(LINUX_PLATFORM TRUE)
|
||||||
set(DEVICE "SDL")
|
set(DEVICE "SDL")
|
||||||
elseif(SOLARIS)
|
elseif(SOLARIS)
|
||||||
@ -178,7 +185,7 @@ endif()
|
|||||||
if(ENABLE_OPENGL)
|
if(ENABLE_OPENGL)
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_OPENGL_)
|
add_definitions(-D_IRR_COMPILE_WITH_OPENGL_)
|
||||||
if(DEVICE STREQUAL "WINDOWS")
|
if(DEVICE STREQUAL "WINDOWS")
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_)
|
add_definitions(-D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||||
elseif(DEVICE STREQUAL "X11")
|
elseif(DEVICE STREQUAL "X11")
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_)
|
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||||
elseif(DEVICE STREQUAL "OSX")
|
elseif(DEVICE STREQUAL "OSX")
|
||||||
@ -202,18 +209,22 @@ if(ENABLE_GLES1)
|
|||||||
endif()
|
endif()
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_OGLES1_)
|
add_definitions(-D_IRR_COMPILE_WITH_OGLES1_)
|
||||||
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$")
|
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$")
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES1_USE_EXTPOINTER_)
|
add_definitions(-D_IRR_OGLES1_USE_EXTPOINTER_)
|
||||||
endif()
|
endif()
|
||||||
|
# We need EGL for GLES1
|
||||||
|
set(ENABLE_EGL ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_GLES2)
|
if(ENABLE_GLES2)
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_OGLES2_)
|
add_definitions(-D_IRR_COMPILE_WITH_OGLES2_)
|
||||||
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$" OR EMSCRIPTEN)
|
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$" OR EMSCRIPTEN)
|
||||||
add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES2_USE_EXTPOINTER_)
|
add_definitions(-D_IRR_OGLES2_USE_EXTPOINTER_)
|
||||||
elseif(DEVICE STREQUAL "SDL")
|
elseif(DEVICE STREQUAL "SDL")
|
||||||
set(USE_SDLGL ON)
|
set(USE_SDLGL ON)
|
||||||
set(USE_SDLGLES2 ON)
|
set(USE_SDLGLES2 ON)
|
||||||
endif()
|
endif()
|
||||||
|
# We need EGL for GLES2
|
||||||
|
set(ENABLE_EGL ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_WEBGL1)
|
if(ENABLE_WEBGL1)
|
||||||
@ -241,6 +252,7 @@ elseif (ENABLE_GLES2)
|
|||||||
else()
|
else()
|
||||||
message(STATUS "OpenGL ES 2: OFF")
|
message(STATUS "OpenGL ES 2: OFF")
|
||||||
endif()
|
endif()
|
||||||
|
message(STATUS "EGL: ${ENABLE_EGL}")
|
||||||
message(STATUS "WebGL: ${ENABLE_WEBGL1}")
|
message(STATUS "WebGL: ${ENABLE_WEBGL1}")
|
||||||
|
|
||||||
# Required libs
|
# Required libs
|
||||||
@ -352,12 +364,21 @@ add_library(IRROBJ OBJECT
|
|||||||
set(IRRDRVROBJ
|
set(IRRDRVROBJ
|
||||||
CNullDriver.cpp
|
CNullDriver.cpp
|
||||||
CGLXManager.cpp
|
CGLXManager.cpp
|
||||||
CWGLManager.cpp
|
|
||||||
CEGLManager.cpp
|
|
||||||
CSDLManager.cpp
|
CSDLManager.cpp
|
||||||
mt_opengl_loader.cpp
|
mt_opengl_loader.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(IRRDRVROBJ ${IRRDRVROBJ}
|
||||||
|
CIrrDeviceWin32.cpp
|
||||||
|
)
|
||||||
|
if(ENABLE_OPENGL)
|
||||||
|
set(IRRDRVROBJ ${IRRDRVROBJ}
|
||||||
|
CWGLManager.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_OPENGL)
|
if(ENABLE_OPENGL)
|
||||||
set(IRRDRVROBJ
|
set(IRRDRVROBJ
|
||||||
${IRRDRVROBJ}
|
${IRRDRVROBJ}
|
||||||
@ -377,6 +398,14 @@ if(ENABLE_GLES1)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if(ENABLE_EGL)
|
||||||
|
set(IRRDRVROBJ
|
||||||
|
${IRRDRVROBJ}
|
||||||
|
CEGLManager.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(IRRIMAGEOBJ
|
set(IRRIMAGEOBJ
|
||||||
CColorConverter.cpp
|
CColorConverter.cpp
|
||||||
CImage.cpp
|
CImage.cpp
|
||||||
@ -440,7 +469,6 @@ add_library(IRROTHEROBJ OBJECT
|
|||||||
CIrrDeviceSDL.cpp
|
CIrrDeviceSDL.cpp
|
||||||
CIrrDeviceLinux.cpp
|
CIrrDeviceLinux.cpp
|
||||||
CIrrDeviceStub.cpp
|
CIrrDeviceStub.cpp
|
||||||
CIrrDeviceWin32.cpp
|
|
||||||
CLogger.cpp
|
CLogger.cpp
|
||||||
COSOperator.cpp
|
COSOperator.cpp
|
||||||
Irrlicht.cpp
|
Irrlicht.cpp
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "fast_atof.h"
|
#include "fast_atof.h"
|
||||||
|
|
||||||
#if defined(_IRR_OGLES1_USE_EXTPOINTER_)
|
#if defined(_IRR_OGLES1_USE_EXTPOINTER_)
|
||||||
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_WINDOWS_API_)
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#else
|
#else
|
||||||
#include <GLES/egl.h>
|
#include <GLES/egl.h>
|
||||||
|
@ -48,7 +48,7 @@ bool COpenGLDriver::initDriver()
|
|||||||
|
|
||||||
genericDriverInit();
|
genericDriverInit();
|
||||||
|
|
||||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
#if defined(_IRR_WINDOWS_API_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
||||||
extGlSwapInterval(Params.Vsync ? 1 : 0);
|
extGlSwapInterval(Params.Vsync ? 1 : 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3391,7 +3391,7 @@ inline void COpenGLExtensionHandler::extGlGenerateTextureMipmap(GLuint texture,
|
|||||||
inline void COpenGLExtensionHandler::extGlSwapInterval(int interval)
|
inline void COpenGLExtensionHandler::extGlSwapInterval(int interval)
|
||||||
{
|
{
|
||||||
// we have wglext, so try to use that
|
// we have wglext, so try to use that
|
||||||
#if defined(_IRR_WINDOWS_API_) && defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
#if defined(_IRR_WINDOWS_API_)
|
||||||
#ifdef WGL_EXT_swap_control
|
#ifdef WGL_EXT_swap_control
|
||||||
if (pWglSwapIntervalEXT)
|
if (pWglSwapIntervalEXT)
|
||||||
pWglSwapIntervalEXT(interval);
|
pWglSwapIntervalEXT(interval);
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#include "CWGLManager.h"
|
#include "CWGLManager.h"
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_WGL_MANAGER_
|
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
@ -507,5 +505,3 @@ bool CWGLManager::swapBuffers()
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_WGL_MANAGER_
|
|
||||||
|
|
||||||
#include "SIrrCreationParameters.h"
|
#include "SIrrCreationParameters.h"
|
||||||
#include "SExposedVideoData.h"
|
#include "SExposedVideoData.h"
|
||||||
#include "IContextManager.h"
|
#include "IContextManager.h"
|
||||||
@ -72,5 +70,3 @@ namespace video
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -13,7 +13,7 @@ static const char* const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Geb
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "irrlicht.h"
|
#include "irrlicht.h"
|
||||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
#ifdef _IRR_WINDOWS_API_
|
||||||
#include "CIrrDeviceWin32.h"
|
#include "CIrrDeviceWin32.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ namespace irr
|
|||||||
|
|
||||||
IrrlichtDevice* dev = 0;
|
IrrlichtDevice* dev = 0;
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
#ifdef _IRR_WINDOWS_API_
|
||||||
if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
|
if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
|
||||||
dev = new CIrrDeviceWin32(params);
|
dev = new CIrrDeviceWin32(params);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user