Fix for GL types.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1676 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2008-11-03 22:27:41 +00:00
parent 941b333aad
commit d4c1631544
1 changed files with 31 additions and 31 deletions

View File

@ -25,15 +25,6 @@
#import <time.h> #import <time.h>
#import "AppDelegate.h" #import "AppDelegate.h"
// some macros to make code more readable.
#define GetModeWidth(mode) GetDictionaryLong((mode), kCGDisplayWidth)
#define GetModeHeight(mode) GetDictionaryLong((mode), kCGDisplayHeight)
#define GetModeRefreshRate(mode) GetDictionaryLong((mode), kCGDisplayRefreshRate)
#define GetModeBitsPerPixel(mode) GetDictionaryLong((mode), kCGDisplayBitsPerPixel)
#define GetModeSafeForHardware(mode) GetDictionaryBoolean((mode), kCGDisplayModeIsSafeForHardware)
#define GetModeStretched(mode) GetDictionaryBoolean((mode), kCGDisplayModeIsStretched)
//------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------
Boolean GetDictionaryBoolean(CFDictionaryRef theDict, const void* key) Boolean GetDictionaryBoolean(CFDictionaryRef theDict, const void* key)
{ {
@ -155,7 +146,7 @@ bool CIrrDeviceMacOSX::createWindow()
CGLPixelFormatAttribute fullattribs[32]; CGLPixelFormatAttribute fullattribs[32];
NSOpenGLPixelFormatAttribute windowattribs[32]; NSOpenGLPixelFormatAttribute windowattribs[32];
CFDictionaryRef displaymode,olddisplaymode; CFDictionaryRef displaymode,olddisplaymode;
long numPixelFormats,newSwapInterval; GLint numPixelFormats,newSwapInterval;
int alphaSize = CreationParams.WithAlphaChannel?4:0, depthSize = CreationParams.ZBufferBits; int alphaSize = CreationParams.WithAlphaChannel?4:0, depthSize = CreationParams.ZBufferBits;
if (CreationParams.WithAlphaChannel && (CreationParams.Bits == 32)) if (CreationParams.WithAlphaChannel && (CreationParams.Bits == 32))
@ -600,6 +591,7 @@ void CIrrDeviceMacOSX::storeMouseLocation()
((CCursorControl *)CursorControl)->updateInternalCursorPosition(x,y); ((CCursorControl *)CursorControl)->updateInternalCursorPosition(x,y);
} }
void CIrrDeviceMacOSX::setMouseLocation(int x,int y) void CIrrDeviceMacOSX::setMouseLocation(int x,int y)
{ {
NSPoint p; NSPoint p;
@ -624,15 +616,19 @@ void CIrrDeviceMacOSX::setMouseLocation(int x,int y)
CGWarpMouseCursorPosition(c); CGWarpMouseCursorPosition(c);
} }
void CIrrDeviceMacOSX::setCursorVisible(bool visible) void CIrrDeviceMacOSX::setCursorVisible(bool visible)
{ {
CGDirectDisplayID display; CGDirectDisplayID display;
display = CGMainDisplayID(); display = CGMainDisplayID();
if (visible) CGDisplayShowCursor(display); if (visible)
else CGDisplayHideCursor(display); CGDisplayShowCursor(display);
else
CGDisplayHideCursor(display);
} }
void CIrrDeviceMacOSX::initKeycodes() void CIrrDeviceMacOSX::initKeycodes()
{ {
_keycodes[NSUpArrowFunctionKey] = irr::KEY_UP; _keycodes[NSUpArrowFunctionKey] = irr::KEY_UP;
@ -673,22 +669,25 @@ void CIrrDeviceMacOSX::initKeycodes()
_keycodes[0x1B] = irr::KEY_ESCAPE; _keycodes[0x1B] = irr::KEY_ESCAPE;
} }
//! Sets if the window should be resizeable in windowed mode.
//! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceMacOSX::setResizeAble(bool resize) void CIrrDeviceMacOSX::setResizeAble(bool resize)
{ {
// todo: implement resize // todo: implement resize
} }
bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rect<s32>* src ) bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rect<s32>* src )
{ {
// todo: implement // todo: implement
return false; return false;
} }
video::IVideoModeList* CIrrDeviceMacOSX::getVideoModeList() video::IVideoModeList* CIrrDeviceMacOSX::getVideoModeList()
{ {
if (!VideoModeList.getVideoModeCount()) { if (!VideoModeList.getVideoModeCount())
{
CGDirectDisplayID display; CGDirectDisplayID display;
display = CGMainDisplayID(); display = CGMainDisplayID();
@ -698,15 +697,16 @@ video::IVideoModeList* CIrrDeviceMacOSX::getVideoModeList()
{ {
// look at each mode in the available list // look at each mode in the available list
CFDictionaryRef mode = (CFDictionaryRef)CFArrayGetValueAtIndex(availableModes, i); CFDictionaryRef mode = (CFDictionaryRef)CFArrayGetValueAtIndex(availableModes, i);
long bitsPerPixel = GetModeBitsPerPixel(mode); long bitsPerPixel = GetDictionaryLong(mode, kCGDisplayBitsPerPixel);
Boolean safeForHardware = GetModeSafeForHardware(mode); Boolean safeForHardware = GetDictionaryBoolean(mode, kCGDisplayModeIsSafeForHardware);
Boolean stretched = GetModeStretched(mode); Boolean stretched = GetDictionaryBoolean(mode, kCGDisplayModeIsStretched);
if (!safeForHardware) if (!safeForHardware)
continue; continue;
long width = GetModeWidth(mode); long width = GetDictionaryLong(mode, kCGDisplayWidth);
long height = GetModeHeight(mode); long height = GetDictionaryLong(mode, kCGDisplayHeight);
// long refresh = GetDictionaryLong((mode), kCGDisplayRefreshRate);
VideoModeList.addMode(core::dimension2d<s32>(width, height), VideoModeList.addMode(core::dimension2d<s32>(width, height),
bitsPerPixel); bitsPerPixel);
} }