Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fix for the Game Center status window always being behind the SDL win…
Browse files Browse the repository at this point in the history
…dow (untested!)
  • Loading branch information
slouken committed Jul 22, 2012
1 parent 92792d7 commit 3d72e94
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/video/uikit/SDL_uikitopengles.m
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/video/uikit/SDL_uikitvideo.m
Expand Up @@ -83,6 +83,8 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device)
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;
Expand Down
2 changes: 2 additions & 0 deletions src/video/uikit/SDL_uikitwindow.h
Expand Up @@ -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,
Expand Down
16 changes: 16 additions & 0 deletions src/video/uikit/SDL_uikitwindow.m
Expand Up @@ -210,6 +210,22 @@ static int SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bo

}

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)
{
Expand Down

0 comments on commit 3d72e94

Please sign in to comment.