Browse files

Merge pull request #1 from jhoffmannrim/master

add handling of navigator exit event
  • Loading branch information...
2 parents 6e91d30 + 7d5b657 commit 9e1a8528b9f99a7552278f26a1b9c91ffd258412 @dgough dgough committed Feb 14, 2012
Showing with 19 additions and 0 deletions.
  1. +11 −0 .gitignore
  2. +8 −0 OpenGLES2-ProgrammingGuide/Common/src/esUtil_qnx.c
View
11 .gitignore
@@ -0,0 +1,11 @@
+*~
+*.o
+*.gcno
+*.bar
+Device-Coverage/
+Device-Debug/
+Device-Profile/
+Device-Release/
+Simulator-Coverage/
+Simulator-Debug/
+Simulator-Profile/
View
8 OpenGLES2-ProgrammingGuide/Common/src/esUtil_qnx.c
@@ -43,6 +43,7 @@ struct
screen_event_t screenEvent;
int screenWindowSize[2];
const char* glExtensions;
+ bool shouldExit;
}__qnx;
// Time global variables
@@ -126,6 +127,8 @@ static GLboolean qnxCreate(ESContext *esContext, GLuint flags)
EGL_NONE
};
+ __qnx.shouldExit = false;
+
// Create the screen context
rc = screen_create_context(&__qnx.screenContext, 0);
if (rc)
@@ -294,6 +297,7 @@ static void handleNavigatorEvent(bps_event_t *event)
case NAVIGATOR_SWIPE_DOWN:
break;
case NAVIGATOR_EXIT:
+ __qnx.shouldExit = true;
break;
}
}
@@ -380,6 +384,7 @@ GLboolean CreateWindow(ESContext *esContext, const char *title, GLuint flags)
qnxCreate(esContext, flags);
bps_initialize();
screen_request_events(__qnx.screenContext);
+ navigator_request_events(0);
initTime();
@@ -400,6 +405,9 @@ void MainLoop(ESContext *esContext)
for (;;)
{
handle_events();
+ if (__qnx.shouldExit)
+ break;
+
// Call update function if registered
if (esContext->updateFunc != NULL)
esContext->updateFunc(esContext, getElapsedTime() / 1000.0f);

0 comments on commit 9e1a852

Please sign in to comment.