Hi,
- I am trying to implement the Game Center API in mac osx >= 10.8 and
latest sdl2.
I have alredy done in it iOS successfully like this:------------------------------------------------------------------
A A A A A A GKLocalPlayer localPlayer = [GKLocalPlayer localPlayer];
A A A A A A A UIViewController * rootViewController =
GetSDLViewController(returnTheWindow());
A A A A A A A if ( ! rootViewController ) {
A A A A A A A A A A A // handle this error as appropriate
A A A A A A A } else {
A A A A A A A A A A A // ios 6.0 and above
A A A A A A A A A A A [localPlayer
setAuthenticateHandler:(^(UIViewController viewcontroller, NSError
error) {
A A A A A A A A A A A A A A A if (!error && viewcontroller)
A A A A A A A A A A A A A A A {
A A A A A A A A A A A A A A A A A A A [rootViewController
presentViewController:viewcontroller animated:YES completion:nil];
A A A A A A A A A A A A A A A }
A A A A A A A A A A A A A A A else
A A A A A A A A A A A A A A A {
A A A A A A A A A A A A A A A if (localPlayer.isAuthenticated)
A A A A A A A A A A A A A A A A A A {
A A A A A A A A A A A A A A A A A A A A A A / Perform additional
tasks for the authenticated player here /
A A A A A A A A A A A A A A A A A A }
A A A A A A A A A A A A A A A A A A else
A A A A A A A A A A A A A A A A A {
A A A A A A A A A A A A A A A A A A A A A / Perform additional
tasks for the non-authenticated player here /
A A A A A A A A A A A A A A A A A A }
A A A A A A A A A A A A A A A }
A A A A A A A A A A A })];
A A A A A A A }
/***********************************************************************************************************
A * FUNCTIOM: GetSDLViewController
A ************************************************************************************************************/
UIViewController * GetSDLViewController(SDL_Window * sdlWindow)
{
A A A SDL_SysWMinfo systemWindowInfo;
A A A SDL_VERSION(&systemWindowInfo.version);
A A A if ( ! SDL_GetWindowWMInfo(sdlWindow, &systemWindowInfo)) {
A A A A A A A // consider doing some kind of error handling here
A A A A A A A NSLog(@“GetSDLViewController error”);
A A A A A A A return nil;
A A A }
A A A UIWindow * appWindow = systemWindowInfo.info.uikit.window;
A A A UIViewController * rootViewController =
appWindow.rootViewController;
A A A return rootViewController;
}
How can I implement this in Mac OSX that has: NSViewController instead of
UIViewController?
- The latest SDL2.0 for MacOSX has a small issue on my 10.8 Lion.
When the user quits the app the app closes without any error but after it
close we see the minimize max os effect also.
this is very irritating. It doesnt have it on my July 13 2013 version of
SDL2.
Thanks a lot,
Giorgos