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) if(SERVER_ONLY)
add_definitions(-DSERVER_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() endif()
if(UNIX OR MINGW) if(UNIX OR MINGW)

View File

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