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

Commit

Permalink
Re-enabled other messagebox tests, moved the SDL_Init() call as late …
Browse files Browse the repository at this point in the history
…as possible to show the circumstances where it's needed.
  • Loading branch information
slouken committed Jul 14, 2013
1 parent fa8296d commit 2214c3d
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions test/testmessage.c
Expand Up @@ -60,7 +60,7 @@ button_messagebox(void *eventNumber)
data.message = "This is a custom messagebox from a background thread.";
}

success =SDL_ShowMessageBox(&data, &button);
success = SDL_ShowMessageBox(&data, &button);
if (success == -1) {
printf("Error Presenting MessageBox: %s\n", SDL_GetError());
if (eventNumber) {
Expand Down Expand Up @@ -88,13 +88,6 @@ main(int argc, char *argv[])
{
int success;

/* Load the SDL library */
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
return (1);
}

#if 0
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Simple MessageBox",
"This is a simple error MessageBox",
Expand Down Expand Up @@ -135,7 +128,16 @@ main(int argc, char *argv[])

button_messagebox(NULL);

/* Test showing a message box from a background thread */
/* Test showing a message box from a background thread.
On Mac OS X, the video subsystem needs to be initialized for this
to work, since the message box events are dispatched by the Cocoa
subsystem on the main thread.
*/
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
fprintf(stderr, "Couldn't initialize SDL video subsystem: %s\n", SDL_GetError());
return (1);
}
{
int status = 0;
SDL_Event event;
Expand All @@ -153,7 +155,6 @@ main(int argc, char *argv[])

printf("Message box thread return %i\n", status);
}
#endif

/* Test showing a message box with a parent window */
{
Expand Down

0 comments on commit 2214c3d

Please sign in to comment.