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); kCGLPFAFullScreen,
fullattribs[index++] = kCGLPFADoubleBuffer; kCGLPFADisplayMask, (CGLPixelFormatAttribute)CGDisplayIDToOpenGLDisplayMask(display),
fullattribs[index++] = kCGLPFAAccelerated; kCGLPFADoubleBuffer,
fullattribs[index++] = kCGLPFADepthSize; kCGLPFAAccelerated,
fullattribs[index++] = (CGLPixelFormatAttribute)depthSize; kCGLPFADepthSize, (CGLPixelFormatAttribute)depthSize,
fullattribs[index++] = kCGLPFAColorSize; kCGLPFAColorSize, (CGLPixelFormatAttribute)CreationParams.Bits,
fullattribs[index++] = (CGLPixelFormatAttribute)CreationParams.Bits; kCGLPFAAlphaSize, (CGLPixelFormatAttribute)alphaSize,
fullattribs[index++] = kCGLPFAAlphaSize; kCGLPFASampleBuffers, (CGLPixelFormatAttribute)(CreationParams.AntiAlias?1:0),
fullattribs[index++] = (CGLPixelFormatAttribute)alphaSize; kCGLPFASamples, (CGLPixelFormatAttribute)CreationParams.AntiAlias,
kCGLPFAStencilSize, (CGLPixelFormatAttribute)(CreationParams.Stencilbuffer?1:0),
if (CreationParams.AntiAlias) (CGLPixelFormatAttribute)NULL
{ };
fullattribs[index++] = kCGLPFASampleBuffers;
fullattribs[index++] = (CGLPixelFormatAttribute)1;
fullattribs[index++] = kCGLPFASamples;
fullattribs[index++] = (CGLPixelFormatAttribute)CreationParams.AntiAlias;
}
if (CreationParams.Stencilbuffer)
{
fullattribs[index++] = kCGLPFAStencilSize;
fullattribs[index++] = (CGLPixelFormatAttribute)1;
}
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