Add server only define to osx device

This commit is contained in:
Benau 2019-07-07 01:12:10 +08:00
parent 9e6e31cfb2
commit 3350d6c106
2 changed files with 8 additions and 4 deletions

View File

@ -129,7 +129,7 @@ endif()
if(SERVER_ONLY)
add_definitions(-DSERVER_ONLY)
add_definitions(-DNO_IRR_COMPILE_WITH_X11_ -DNO_IRR_COMPILE_WITH_OPENGL_ -DNO_IRR_COMPILE_WITH_OSX_DEVICE_)
add_definitions(-DNO_IRR_COMPILE_WITH_X11_ -DNO_IRR_COMPILE_WITH_OPENGL_)
endif()
if(UNIX OR MINGW)

View File

@ -549,6 +549,7 @@ CIrrDeviceMacOSX::~CIrrDeviceMacOSX()
void CIrrDeviceMacOSX::closeDevice()
{
#ifndef SERVER_ONLY
if (Window != NULL)
{
[Window setIsVisible:FALSE];
@ -586,7 +587,7 @@ void CIrrDeviceMacOSX::closeDevice()
}
}
}
#endif
IsFullscreen = false;
IsActive = false;
CGLContext = NULL;
@ -594,8 +595,9 @@ void CIrrDeviceMacOSX::closeDevice()
bool CIrrDeviceMacOSX::createWindow()
{
CGDisplayErr error;
bool result=false;
#ifndef SERVER_ONLY
CGDisplayErr error;
CGDirectDisplayID display=CGMainDisplayID();
CGLPixelFormatObj pixelFormat;
CGRect displayRect;
@ -905,7 +907,7 @@ bool CIrrDeviceMacOSX::createWindow()
CGLSetParameter(CGLContext,kCGLCPSwapInterval,&newSwapInterval);
}
}
#endif
return (result);
}
@ -980,11 +982,13 @@ void CIrrDeviceMacOSX::createDriver()
void CIrrDeviceMacOSX::flush()
{
#ifndef SERVER_ONLY
if (CGLContext != NULL)
{
glFinish();
CGLFlushDrawable(CGLContext);
}
#endif
}
bool CIrrDeviceMacOSX::run()