X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fblackberry%2Ffg_main_blackberry.c;h=73b9f41d4e24b98cc8bfcce1a5328ff0dd0b4a52;hb=ef4ef888c1bf3ee5d3a3fb5ef7439b1bd8e7e4eb;hp=827365b6a5b8c84eaaf56305f40fefd5a90f1747;hpb=fcebd3bb257c8dc9d751543d83cf03d87fb30bec;p=freeglut diff --git a/src/blackberry/fg_main_blackberry.c b/src/blackberry/fg_main_blackberry.c index 827365b..73b9f41 100644 --- a/src/blackberry/fg_main_blackberry.c +++ b/src/blackberry/fg_main_blackberry.c @@ -161,7 +161,7 @@ fg_time_t fgPlatformSystemTime ( void ) void fgPlatformSleepForEvents( fg_time_t msec ) { //XXX: Is this right? Is there a more direct way to access the context? - if(fgStructure.CurrentWindow && bps_get_event(&fgDisplay.pDisplay.event, (int)msec) != BPS_SUCCESS) { + if(fgStructure.CurrentWindow && fgDisplay.pDisplay.event == NULL && bps_get_event(&fgDisplay.pDisplay.event, (int)msec) != BPS_SUCCESS) { LOGW("BPS couldn't get event"); } } @@ -266,12 +266,18 @@ int fgPlatformGetModifiers (int mod) void fgPlatformProcessSingleEvent ( void ) { + if(fgStructure.CurrentWindow == NULL) { + //XXX Is this right? Would this just cause a whole lot of busy looping while we wait for events? + LOGW("fgPlatformProcessSingleEvent: Missing current window. Skipping event processing"); + return; + } + int domain; do { if(fgDisplay.pDisplay.event != NULL) { SFG_Window* window = fgStructure.CurrentWindow; - if (window != NULL && window->Window.Handle != NULL) { + if (window->Window.Handle != NULL) { int size[2]; screen_get_window_property_iv(window->Window.Handle, SCREEN_PROPERTY_BUFFER_SIZE, size); fghOnReshapeNotify(window,size[0],size[1],GL_FALSE);