mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-26 10:30:54 +00:00
Fix linking of OpenGL driver under MinGW
This commit is contained in:
parent
747e1de97f
commit
4924fb835f
13 changed files with 31 additions and 19 deletions
|
@ -182,7 +182,7 @@ public:
|
|||
IDriver();
|
||||
virtual ~IDriver();
|
||||
|
||||
virtual bool init(uint windowIcon = 0, emptyProc exitFunc = 0) = 0;
|
||||
virtual bool init(uintptr_t windowIcon = 0, emptyProc exitFunc = 0) = 0;
|
||||
|
||||
/// Deriver should calls IDriver::release() first, to destroy all driver components (textures, shaders, VBuffers).
|
||||
virtual bool release();
|
||||
|
|
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
/// \name Object
|
||||
// @{
|
||||
CDriverUser (uint windowIcon, UDriver::TDriver driver, emptyProc exitFunc = 0);
|
||||
CDriverUser (uintptr_t windowIcon, UDriver::TDriver driver, emptyProc exitFunc = 0);
|
||||
virtual ~CDriverUser();
|
||||
// @}
|
||||
|
||||
|
|
|
@ -24,8 +24,11 @@
|
|||
#include "nel/misc/geom_ext.h"
|
||||
#include "nel/misc/line.h"
|
||||
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
#if defined (NL_COMP_MINGW)
|
||||
# define NL3D_GL_DLL_NAME "libnel_drv_opengl_win"
|
||||
# define NL3D_GLES_DLL_NAME "libnel_drv_opengles_win"
|
||||
# define NL3D_D3D_DLL_NAME "libnel_drv_direct3d_win"
|
||||
#elif defined (NL_OS_WINDOWS)
|
||||
# define NL3D_GL_DLL_NAME "nel_drv_opengl_win"
|
||||
# define NL3D_GLES_DLL_NAME "nel_drv_opengles_win"
|
||||
# define NL3D_D3D_DLL_NAME "nel_drv_direct3d_win"
|
||||
|
|
|
@ -845,8 +845,8 @@ public:
|
|||
/**
|
||||
* This is the static function which build a UDriver, the root for all 3D functions.
|
||||
*/
|
||||
static UDriver *createDriver(uint windowIcon = 0, bool direct3d = false, emptyProc exitFunc = 0);
|
||||
static UDriver *createDriver(uint windowIcon, TDriver driver, emptyProc exitFunc = 0);
|
||||
static UDriver *createDriver(uintptr_t windowIcon = 0, bool direct3d = false, emptyProc exitFunc = 0);
|
||||
static UDriver *createDriver(uintptr_t windowIcon, TDriver driver, emptyProc exitFunc = 0);
|
||||
|
||||
/**
|
||||
* Purge static memory
|
||||
|
|
|
@ -1231,7 +1231,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
bool CDriverD3D::init (uint windowIcon, emptyProc exitFunc)
|
||||
bool CDriverD3D::init (uintptr_t windowIcon, emptyProc exitFunc)
|
||||
{
|
||||
H_AUTO_D3D(CDriver3D_init );
|
||||
|
||||
|
|
|
@ -839,7 +839,7 @@ public:
|
|||
// ***************************************************************************
|
||||
|
||||
// Mode initialisation, requests
|
||||
virtual bool init (uint windowIcon = 0, emptyProc exitFunc = 0);
|
||||
virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0);
|
||||
virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable) throw(EBadDisplay);
|
||||
virtual bool release();
|
||||
virtual bool setMode(const GfxMode& mode);
|
||||
|
|
|
@ -37,7 +37,7 @@ NL_ADD_RUNTIME_FLAGS(${NLDRV_OGL_LIB})
|
|||
IF(WIN32)
|
||||
INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
|
||||
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY})
|
||||
ADD_DEFINITIONS(/DDRIVER_OPENGL_EXPORTS)
|
||||
ADD_DEFINITIONS(-DDRIVER_OPENGL_EXPORTS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
IF(APPLE)
|
||||
|
|
|
@ -108,7 +108,10 @@ IDriver* createGlDriverInstance ()
|
|||
#else
|
||||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
|
||||
#ifdef NL_COMP_MINGW
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllexport) IDriver* NL3D_createIDriverInstance ()
|
||||
{
|
||||
return new CDriverGL;
|
||||
|
@ -118,7 +121,9 @@ __declspec(dllexport) uint32 NL3D_interfaceVersion ()
|
|||
{
|
||||
return IDriver::InterfaceVersion;
|
||||
}
|
||||
|
||||
#ifdef NL_COMP_MINGW
|
||||
}
|
||||
#endif
|
||||
#elif defined (NL_OS_UNIX)
|
||||
|
||||
extern "C"
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
EXPORTS NL3D_createIDriverInstance
|
||||
EXPORTS NL3D_interfaceVersion
|
||||
LIBRARY nel_drv_opengl_win_r
|
||||
EXPORTS
|
||||
NL3D_createIDriverInstance
|
||||
NL3D_interfaceVersion
|
|
@ -304,7 +304,7 @@ public:
|
|||
|
||||
virtual bool isLost() const { return false; } // there's no notion of 'lost device" in OpenGL
|
||||
|
||||
virtual bool init (uint windowIcon = 0, emptyProc exitFunc = 0);
|
||||
virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0);
|
||||
|
||||
virtual void disableHardwareVertexProgram();
|
||||
virtual void disableHardwarePixelProgram();
|
||||
|
|
|
@ -296,7 +296,7 @@ bool GlWndProc(CDriverGL *driver, XEvent &e)
|
|||
#endif // NL_OS_UNIX
|
||||
|
||||
// ***************************************************************************
|
||||
bool CDriverGL::init (uint windowIcon, emptyProc exitFunc)
|
||||
bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc)
|
||||
{
|
||||
H_AUTO_OGL(CDriverGL_init)
|
||||
|
||||
|
|
|
@ -37,7 +37,9 @@
|
|||
|
||||
#ifdef NL_OS_WINDOWS
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# define NOMINMAX
|
||||
# ifndef NL_COMP_MINGW
|
||||
# define NOMINMAX
|
||||
# endif
|
||||
# include <windows.h>
|
||||
# include <windowsx.h>
|
||||
#endif
|
||||
|
|
|
@ -82,13 +82,13 @@ void UDriver::setMatrixMode2D43()
|
|||
}
|
||||
|
||||
// ***************************************************************************
|
||||
UDriver *UDriver::createDriver(uint windowIcon, bool direct3d, emptyProc exitFunc)
|
||||
UDriver *UDriver::createDriver(uintptr_t windowIcon, bool direct3d, emptyProc exitFunc)
|
||||
{
|
||||
return new CDriverUser (windowIcon, direct3d ? CDriverUser::Direct3d:CDriverUser::OpenGl, exitFunc);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
UDriver *UDriver::createDriver(uint windowIcon, TDriver driver, emptyProc exitFunc)
|
||||
UDriver *UDriver::createDriver(uintptr_t windowIcon, TDriver driver, emptyProc exitFunc)
|
||||
{
|
||||
return new CDriverUser (windowIcon, (CDriverUser::TDriver)driver, exitFunc);
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ bool CDriverUser::_StaticInit= false;
|
|||
|
||||
|
||||
// ***************************************************************************
|
||||
CDriverUser::CDriverUser (uint windowIcon, TDriver driver, emptyProc exitFunc)
|
||||
CDriverUser::CDriverUser (uintptr_t windowIcon, TDriver driver, emptyProc exitFunc)
|
||||
{
|
||||
// The enum of IDriver and UDriver MUST be the same!!!
|
||||
nlassert((uint)IDriver::idCount == (uint)UDriver::idCount);
|
||||
|
|
Loading…
Reference in a new issue