Skip to content

Commit 3350d6c

Browse files
committed
Add server only define to osx device
1 parent 9e6e31c commit 3350d6c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ endif()
129129

130130
if(SERVER_ONLY)
131131
add_definitions(-DSERVER_ONLY)
132-
add_definitions(-DNO_IRR_COMPILE_WITH_X11_ -DNO_IRR_COMPILE_WITH_OPENGL_ -DNO_IRR_COMPILE_WITH_OSX_DEVICE_)
132+
add_definitions(-DNO_IRR_COMPILE_WITH_X11_ -DNO_IRR_COMPILE_WITH_OPENGL_)
133133
endif()
134134

135135
if(UNIX OR MINGW)

lib/irrlicht/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
549549

550550
void CIrrDeviceMacOSX::closeDevice()
551551
{
552+
#ifndef SERVER_ONLY
552553
if (Window != NULL)
553554
{
554555
[Window setIsVisible:FALSE];
@@ -586,16 +587,17 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
586587
}
587588
}
588589
}
589-
590+
#endif
590591
IsFullscreen = false;
591592
IsActive = false;
592593
CGLContext = NULL;
593594
}
594595

595596
bool CIrrDeviceMacOSX::createWindow()
596597
{
597-
CGDisplayErr error;
598598
bool result=false;
599+
#ifndef SERVER_ONLY
600+
CGDisplayErr error;
599601
CGDirectDisplayID display=CGMainDisplayID();
600602
CGLPixelFormatObj pixelFormat;
601603
CGRect displayRect;
@@ -905,7 +907,7 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
905907
CGLSetParameter(CGLContext,kCGLCPSwapInterval,&newSwapInterval);
906908
}
907909
}
908-
910+
#endif
909911
return (result);
910912
}
911913

@@ -980,11 +982,13 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
980982

981983
void CIrrDeviceMacOSX::flush()
982984
{
985+
#ifndef SERVER_ONLY
983986
if (CGLContext != NULL)
984987
{
985988
glFinish();
986989
CGLFlushDrawable(CGLContext);
987990
}
991+
#endif
988992
}
989993

990994
bool CIrrDeviceMacOSX::run()

0 commit comments

Comments
 (0)