Merge branch 'master' of github.com:LaurentGomila/SFML

This commit is contained in:
Laurent Gomila 2011-04-04 08:22:27 +02:00
commit 10ebd94ee7
3 changed files with 52 additions and 9 deletions

View File

@ -28,7 +28,16 @@ set(BUILD_SHARED_LIBS TRUE CACHE BOOL "TRUE to build SFML as shared libraries, F
set(BUILD_EXAMPLES FALSE CACHE BOOL "TRUE to build the SFML examples, FALSE to ignore them") set(BUILD_EXAMPLES FALSE CACHE BOOL "TRUE to build the SFML examples, FALSE to ignore them")
# add an option for building the API documentation # add an option for building the API documentation
set(BUILD_DOC FALSE CACHE BOOL "TRUE to generate the API documentation, FALSE to ignore it") set(BUILD_DOC FALSE CACHE BOOL "TRUE to generate the API documentation, FALSE to ignore it")
# Mac OS X specific options
if (MACOSX)
# (Not supported anymore by extlibs) add an option to compile ppc/ppc64
#set(BUILD_PPC FALSE CACHE BOOL "TRUE to build SFML for ppc and ppc64, too, FALSE to only compile i386 and x86_64")
# add an option to build against 10.5 SDK
set(BUILD_LEOPARD FALSE CACHE BOOL "TRUE to build SFML for OS X 10.5, FALSE to compile for default SDK")
endif()
# define SFML_STATIC if the build type is not set to 'shared' # define SFML_STATIC if the build type is not set to 'shared'
if(NOT BUILD_SHARED_LIBS) if(NOT BUILD_SHARED_LIBS)
@ -55,7 +64,40 @@ if(COMPILER_MSVC)
endif() endif()
# disable the rpath stuff # disable the rpath stuff
set(CMAKE_SKIP_BUILD_RPATH TRUE) set(CMAKE_SKIP_BUILD_RPATH TRUE)
# Setup Mac OS X multi arch/SDK support.
if (MACOSX)
# # compile for PPC ?
# if (BUILD_PPC)
# if (NOT CMAKE_OSX_ARCHITECTURES)
# # Custom : ppc, ppc64, i386 and x86_64
# set(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64")
# else()
# # We got some conflict with custom user settings ; let him know his on his own.
# message("You set BUILD_PPC to TRUE but CMAKE_OSX_ARCHITECTURES is not empty.")
# message("You're on your own : I won't change your settings.")
# endif()
# else()
# if (NOT CMAKE_OSX_ARCHITECTURES)
# # Default : i386 and x86_64
# set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
# else()
# # We got some conflict with custom user settings ; let him know his on his own.
# message("CMAKE_OSX_ARCHITECTURES is not empty.")
# message("You're on your own : I won't change your settings.")
# endif()
# endif()
# use 10.5 SDK ?
if (BUILD_LEOPARD)
# Use 10.5 SDK : override default value
set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.5.sdk")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.5")
else()
# Default SDK, let either the user or CMake decide which one to use.
endif()
endif()
# add the subdirectories # add the subdirectories
add_subdirectory(src/SFML) add_subdirectory(src/SFML)

View File

@ -37,6 +37,7 @@
#import <SFML/Window/OSX/SFApplication.h> #import <SFML/Window/OSX/SFApplication.h>
#import <SFML/Window/OSX/SFOpenGLView.h> #import <SFML/Window/OSX/SFOpenGLView.h>
#import <SFML/Window/OSX/SFWindow.h> #import <SFML/Window/OSX/SFWindow.h>
#import <OpenGL/OpenGL.h>
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// SFWindowController class : Privates Methods Declaration /// SFWindowController class : Privates Methods Declaration

View File

@ -96,14 +96,14 @@ VideoMode ConvertCGModeToSFMode(CFDictionaryRef dictionary)
{ {
VideoMode sfmode; VideoMode sfmode;
CFNumberRef cfnumber = (CFNumberRef)CFDictionaryGetValue(CurrentMode, kCGDisplayWidth); CFNumberRef cfnumber = (CFNumberRef)CFDictionaryGetValue(dictionary, kCGDisplayWidth);
CFNumberGetValue(cfnumber, kCFNumberIntType, &(mode.Width)); CFNumberGetValue(cfnumber, kCFNumberIntType, &(sfmode.Width));
cfnumber = (CFNumberRef)CFDictionaryGetValue(CurrentMode, kCGDisplayHeight); cfnumber = (CFNumberRef)CFDictionaryGetValue(dictionary, kCGDisplayHeight);
CFNumberGetValue(cfnumber, kCFNumberIntType, &(mode.Height)); CFNumberGetValue(cfnumber, kCFNumberIntType, &(sfmode.Height));
cfnumber = (CFNumberRef)CFDictionaryGetValue(CurrentMode, kCGDisplayBitsPerPixel); cfnumber = (CFNumberRef)CFDictionaryGetValue(dictionary, kCGDisplayBitsPerPixel);
CFNumberGetValue(cfnumber, kCFNumberIntType, &(mode.BitsPerPixel)); CFNumberGetValue(cfnumber, kCFNumberIntType, &(sfmode.BitsPerPixel));
return sfmode; return sfmode;
} }
@ -129,7 +129,7 @@ CFDictionaryRef ConvertSFModeToCGMode(VideoMode sfmode)
return CGDisplayBestModeForParameters(CGMainDisplayID(), return CGDisplayBestModeForParameters(CGMainDisplayID(),
sfmode.BitsPerPixel, sfmode.BitsPerPixel,
sfmode.Width, sfmode.Width,
sfmode.Height sfmode.Height,
NULL); NULL);
} }