Prevented case where no window was set when waiting for events.

This commit is contained in:
Rcmaniac25 2013-09-09 00:43:31 -04:00
parent 39eb9e3342
commit ae7fc0ad83
2 changed files with 2 additions and 2 deletions

View File

@ -160,7 +160,7 @@ fg_time_t fgPlatformSystemTime ( void )
void fgPlatformSleepForEvents( fg_time_t msec ) void fgPlatformSleepForEvents( fg_time_t msec )
{ {
//XXX: Is this right? Is there a more direct way to access the context? //XXX: Is this right? Is there a more direct way to access the context?
if(bps_get_event(&fgStructure.CurrentWindow->Window.pContext.event, (int)msec) != BPS_SUCCESS) { if(fgStructure.CurrentWindow && bps_get_event(&fgStructure.CurrentWindow->Window.pContext.event, (int)msec) != BPS_SUCCESS) {
LOGW("BPS couldn't get event"); LOGW("BPS couldn't get event");
} }
} }

View File

@ -106,7 +106,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
} }
/* Request window events */ /* Request window events */
screen_request_events(window->Window.pContext.screenContext); screen_request_events(window->Window.pContext.screenContext); //XXX When multiple screens are supported, this needs to be moved to wherever the screen context is actually created
/* Save window and set state */ /* Save window and set state */
window->Window.Handle = fgDisplay.pDisplay.single_native_window; window->Window.Handle = fgDisplay.pDisplay.single_native_window;