Commit f30d47b6 authored by hybrid's avatar hybrid

Update the render size in fullscreen mode.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2899 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9cf8f0fe
...@@ -432,7 +432,6 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -432,7 +432,6 @@ bool CIrrDeviceMacOSX::createWindow()
CGDirectDisplayID display; CGDirectDisplayID display;
CGLPixelFormatObj pixelFormat; CGLPixelFormatObj pixelFormat;
CGRect displayRect; CGRect displayRect;
CGLPixelFormatAttribute fullattribs[32];
CFDictionaryRef displaymode, olddisplaymode; CFDictionaryRef displaymode, olddisplaymode;
GLint numPixelFormats, newSwapInterval; GLint numPixelFormats, newSwapInterval;
int alphaSize = CreationParams.WithAlphaChannel?4:0, depthSize = CreationParams.ZBufferBits; int alphaSize = CreationParams.WithAlphaChannel?4:0, depthSize = CreationParams.ZBufferBits;
...@@ -566,33 +565,21 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -566,33 +565,21 @@ bool CIrrDeviceMacOSX::createWindow()
numPixelFormats = 0; numPixelFormats = 0;
int index = 0; int index = 0;
fullattribs[index++] = kCGLPFAFullScreen; CGLPixelFormatAttribute fullattribs[] =
fullattribs[index++] = kCGLPFADisplayMask;
fullattribs[index++] = (CGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(display);
fullattribs[index++] = kCGLPFADoubleBuffer;
fullattribs[index++] = kCGLPFAAccelerated;
fullattribs[index++] = kCGLPFADepthSize;
fullattribs[index++] = (CGLPixelFormatAttribute)depthSize;
fullattribs[index++] = kCGLPFAColorSize;
fullattribs[index++] = (CGLPixelFormatAttribute)CreationParams.Bits;
fullattribs[index++] = kCGLPFAAlphaSize;
fullattribs[index++] = (CGLPixelFormatAttribute)alphaSize;
if (CreationParams.AntiAlias)
{ {
fullattribs[index++] = kCGLPFASampleBuffers; kCGLPFAFullScreen,
fullattribs[index++] = (CGLPixelFormatAttribute)1; kCGLPFADisplayMask, (CGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(display),
fullattribs[index++] = kCGLPFASamples; kCGLPFADoubleBuffer,
fullattribs[index++] = (CGLPixelFormatAttribute)CreationParams.AntiAlias; kCGLPFAAccelerated,
} kCGLPFADepthSize, (CGLPixelFormatAttribute)depthSize,
kCGLPFAColorSize, (CGLPixelFormatAttribute)CreationParams.Bits,
if (CreationParams.Stencilbuffer) kCGLPFAAlphaSize, (CGLPixelFormatAttribute)alphaSize,
{ kCGLPFASampleBuffers, (CGLPixelFormatAttribute)(CreationParams.AntiAlias?1:0),
fullattribs[index++] = kCGLPFAStencilSize; kCGLPFASamples, (CGLPixelFormatAttribute)CreationParams.AntiAlias,
fullattribs[index++] = (CGLPixelFormatAttribute)1; kCGLPFAStencilSize, (CGLPixelFormatAttribute)(CreationParams.Stencilbuffer?1:0),
} (CGLPixelFormatAttribute)NULL
};
fullattribs[index++] = (CGLPixelFormatAttribute)NULL;
CGLChoosePixelFormat(fullattribs,&pixelFormat,&numPixelFormats); CGLChoosePixelFormat(fullattribs,&pixelFormat,&numPixelFormats);
if (pixelFormat != NULL) if (pixelFormat != NULL)
...@@ -607,6 +594,7 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -607,6 +594,7 @@ bool CIrrDeviceMacOSX::createWindow()
displayRect = CGDisplayBounds(display); displayRect = CGDisplayBounds(display);
ScreenWidth = DeviceWidth = (int)displayRect.size.width; ScreenWidth = DeviceWidth = (int)displayRect.size.width;
ScreenHeight = DeviceHeight = (int)displayRect.size.height; ScreenHeight = DeviceHeight = (int)displayRect.size.height;
CreationParams.WindowSize.set(ScreenWidth, ScreenHeight);
result = true; result = true;
} }
} }
...@@ -616,6 +604,7 @@ bool CIrrDeviceMacOSX::createWindow() ...@@ -616,6 +604,7 @@ bool CIrrDeviceMacOSX::createWindow()
if (result) if (result)
{ {
// fullscreen?
if (Window == NULL) if (Window == NULL)
SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar);
CGLSetCurrentContext(CGLContext); CGLSetCurrentContext(CGLContext);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment