Fix for the Game Center status window always being behind the SDL window (untested!)

This commit is contained in:
Sam Lantinga 2012-07-22 11:24:04 -07:00
parent 2bcad88c29
commit 6d35992e47
4 changed files with 20 additions and 4 deletions

View file

@ -90,13 +90,9 @@ void UIKit_GL_SwapWindow(_THIS, SDL_Window * window)
return;
}
[data->view swapBuffers];
/* since now we've got something to draw
make the window visible */
[data->uiwindow makeKeyAndVisible];
/* we need to let the event cycle run, or the OS won't update the OpenGL view! */
SDL_PumpEvents();
}
SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window * window)

View file

@ -83,6 +83,8 @@ UIKit_CreateDevice(int devindex)
device->SetDisplayMode = UIKit_SetDisplayMode;
device->PumpEvents = UIKit_PumpEvents;
device->CreateWindow = UIKit_CreateWindow;
device->ShowWindow = UIKit_ShowWindow;
device->HideWindow = UIKit_HideWindow;
device->SetWindowFullscreen = UIKit_SetWindowFullscreen;
device->DestroyWindow = UIKit_DestroyWindow;
device->GetWindowWMInfo = UIKit_GetWindowWMInfo;

View file

@ -29,6 +29,8 @@
typedef struct SDL_WindowData SDL_WindowData;
extern int UIKit_CreateWindow(_THIS, SDL_Window * window);
extern void UIKit_ShowWindow(_THIS, SDL_Window * window);
extern void UIKit_HideWindow(_THIS, SDL_Window * window);
extern void UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen);
extern void UIKit_DestroyWindow(_THIS, SDL_Window * window);
extern SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window * window,

View file

@ -210,6 +210,22 @@ UIKit_CreateWindow(_THIS, SDL_Window *window)
}
void
UIKit_ShowWindow(_THIS, SDL_Window * window)
{
UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
[uiwindow makeKeyAndVisible];
}
void
UIKit_HideWindow(_THIS, SDL_Window * window)
{
UIWindow *uiwindow = ((SDL_WindowData *) window->driverdata)->uiwindow;
uiwindow.hidden = YES;
}
void
UIKit_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
{