Fix for GL types.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1676 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
941b333aad
commit
d4c1631544
|
@ -25,15 +25,6 @@
|
|||
#import <time.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)
|
||||
{
|
||||
|
@ -155,7 +146,7 @@ bool CIrrDeviceMacOSX::createWindow()
|
|||
CGLPixelFormatAttribute fullattribs[32];
|
||||
NSOpenGLPixelFormatAttribute windowattribs[32];
|
||||
CFDictionaryRef displaymode,olddisplaymode;
|
||||
long numPixelFormats,newSwapInterval;
|
||||
GLint numPixelFormats,newSwapInterval;
|
||||
int alphaSize = CreationParams.WithAlphaChannel?4:0, depthSize = CreationParams.ZBufferBits;
|
||||
|
||||
if (CreationParams.WithAlphaChannel && (CreationParams.Bits == 32))
|
||||
|
@ -600,6 +591,7 @@ void CIrrDeviceMacOSX::storeMouseLocation()
|
|||
((CCursorControl *)CursorControl)->updateInternalCursorPosition(x,y);
|
||||
}
|
||||
|
||||
|
||||
void CIrrDeviceMacOSX::setMouseLocation(int x,int y)
|
||||
{
|
||||
NSPoint p;
|
||||
|
@ -624,15 +616,19 @@ void CIrrDeviceMacOSX::setMouseLocation(int x,int y)
|
|||
CGWarpMouseCursorPosition(c);
|
||||
}
|
||||
|
||||
|
||||
void CIrrDeviceMacOSX::setCursorVisible(bool visible)
|
||||
{
|
||||
CGDirectDisplayID display;
|
||||
|
||||
display = CGMainDisplayID();
|
||||
if (visible) CGDisplayShowCursor(display);
|
||||
else CGDisplayHideCursor(display);
|
||||
if (visible)
|
||||
CGDisplayShowCursor(display);
|
||||
else
|
||||
CGDisplayHideCursor(display);
|
||||
}
|
||||
|
||||
|
||||
void CIrrDeviceMacOSX::initKeycodes()
|
||||
{
|
||||
_keycodes[NSUpArrowFunctionKey] = irr::KEY_UP;
|
||||
|
@ -673,22 +669,25 @@ void CIrrDeviceMacOSX::initKeycodes()
|
|||
_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)
|
||||
{
|
||||
// todo: implement resize
|
||||
}
|
||||
|
||||
|
||||
bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rect<s32>* src )
|
||||
{
|
||||
// todo: implement
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
video::IVideoModeList* CIrrDeviceMacOSX::getVideoModeList()
|
||||
{
|
||||
if (!VideoModeList.getVideoModeCount()) {
|
||||
if (!VideoModeList.getVideoModeCount())
|
||||
{
|
||||
CGDirectDisplayID display;
|
||||
display = CGMainDisplayID();
|
||||
|
||||
|
@ -698,15 +697,16 @@ video::IVideoModeList* CIrrDeviceMacOSX::getVideoModeList()
|
|||
{
|
||||
// look at each mode in the available list
|
||||
CFDictionaryRef mode = (CFDictionaryRef)CFArrayGetValueAtIndex(availableModes, i);
|
||||
long bitsPerPixel = GetModeBitsPerPixel(mode);
|
||||
Boolean safeForHardware = GetModeSafeForHardware(mode);
|
||||
Boolean stretched = GetModeStretched(mode);
|
||||
long bitsPerPixel = GetDictionaryLong(mode, kCGDisplayBitsPerPixel);
|
||||
Boolean safeForHardware = GetDictionaryBoolean(mode, kCGDisplayModeIsSafeForHardware);
|
||||
Boolean stretched = GetDictionaryBoolean(mode, kCGDisplayModeIsStretched);
|
||||
|
||||
if (!safeForHardware)
|
||||
continue;
|
||||
|
||||
long width = GetModeWidth(mode);
|
||||
long height = GetModeHeight(mode);
|
||||
long width = GetDictionaryLong(mode, kCGDisplayWidth);
|
||||
long height = GetDictionaryLong(mode, kCGDisplayHeight);
|
||||
// long refresh = GetDictionaryLong((mode), kCGDisplayRefreshRate);
|
||||
VideoModeList.addMode(core::dimension2d<s32>(width, height),
|
||||
bitsPerPixel);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue