diff --git a/src/SFML/Graphics/RenderImageImplDefault.cpp b/src/SFML/Graphics/RenderImageImplDefault.cpp index cb0f47b2..016a4314 100644 --- a/src/SFML/Graphics/RenderImageImplDefault.cpp +++ b/src/SFML/Graphics/RenderImageImplDefault.cpp @@ -37,9 +37,9 @@ namespace priv { //////////////////////////////////////////////////////////// RenderImageImplDefault::RenderImageImplDefault() : +myContext(0), myWidth (0), -myHeight (0), -myContext(0) +myHeight (0) { } diff --git a/src/SFML/Window/OSX/Joystick.cpp b/src/SFML/Window/OSX/Joystick.cpp index 8b0e203b..6cec8a92 100644 --- a/src/SFML/Window/OSX/Joystick.cpp +++ b/src/SFML/Window/OSX/Joystick.cpp @@ -69,7 +69,7 @@ void Joystick::Initialize(unsigned int Index) // Is there enough joystick ? CFIndex joysticksCount = CFSetGetCount(devices); - if (joysticksCount <= Index) { + if (joysticksCount <= CFIndex(Index)) { FreeUp(); return; } @@ -303,6 +303,9 @@ bool Joystick::RetriveElements(IOHIDDeviceRef device) // Too many buttons. We ignore this one. } break; + + default: // Make compiler happy. + break; } } diff --git a/src/SFML/Window/OSX/SFWindowController.h b/src/SFML/Window/OSX/SFWindowController.h index 642a25b0..5c72694c 100644 --- a/src/SFML/Window/OSX/SFWindowController.h +++ b/src/SFML/Window/OSX/SFWindowController.h @@ -61,7 +61,7 @@ namespace sf { NSWindow* myWindow; SFOpenGLView* myOGLView; sf::priv::WindowImplCocoa* myRequester; - sf::VideoMode myFullscreenMode; + sf::VideoMode* myFullscreenMode; // Note : C++ ctor/dtor are not called for Obj-C fields. } //////////////////////////////////////////////////////////// diff --git a/src/SFML/Window/OSX/SFWindowController.mm b/src/SFML/Window/OSX/SFWindowController.mm index d9cecd1d..958ac647 100644 --- a/src/SFML/Window/OSX/SFWindowController.mm +++ b/src/SFML/Window/OSX/SFWindowController.mm @@ -69,6 +69,7 @@ { if ((self = [super init])) { myRequester = 0; + myFullscreenMode = new sf::VideoMode(); // Retain the window for our own use. myWindow = [window retain]; @@ -121,6 +122,7 @@ if ((self = [super init])) { myRequester = 0; + myFullscreenMode = new sf::VideoMode(); // Create our window size. NSRect rect = NSZeroRect; @@ -128,7 +130,7 @@ // We use desktop mode to size the window // but we set the back buffer size to 'mode' in applyContext method. - myFullscreenMode = mode; + *myFullscreenMode = mode; sf::VideoMode dm = sf::VideoMode::GetDesktopMode(); rect = NSMakeRect(0, 0, dm.Width, dm.Height); @@ -211,7 +213,7 @@ // If a fullscreen window was requested... if (style & sf::Style::Fullscreen && mode != sf::VideoMode::GetDesktopMode()) { /// ... we set the "read size" of the view (that is the back buffer size). - [myOGLView setRealSize:NSMakeSize(myFullscreenMode.Width, myFullscreenMode.Height)]; + [myOGLView setRealSize:NSMakeSize(myFullscreenMode->Width, myFullscreenMode->Height)]; } // Set the view to the window as its content view. @@ -238,6 +240,8 @@ [myWindow release]; [myOGLView release]; + delete myFullscreenMode; + [super dealloc]; } @@ -431,10 +435,10 @@ // If fullscreen was requested and the mode used to create the window // was not the desktop mode, we change the back buffer size of the // context. - if (myFullscreenMode != sf::VideoMode()) { + if (*myFullscreenMode != sf::VideoMode()) { CGLContextObj cgcontext = (CGLContextObj)[context CGLContextObj]; - GLint dim[2] = {myFullscreenMode.Width, myFullscreenMode.Height}; + GLint dim[2] = {myFullscreenMode->Width, myFullscreenMode->Height}; CGLSetParameter(cgcontext, kCGLCPSurfaceBackingSize, dim); CGLEnable(cgcontext, kCGLCESurfaceBackingSize);