01-04-2013 02:00 PM - edited 01-04-2013 02:01 PM
Hi I have problems finding any information about switching the orientation in an OpenGL native PlayBook OS application, based on the native GL application template from the IDE (with bbutil).
I already did the following:
bool GLScreen::handleNavigatorEvent(bps_event_t* event) {
unsigned int eventCode = bps_event_get_code(event);
switch (eventCode) {
case NAVIGATOR_ORIENTATION_CHECK:
navigator_orientation_check_response(event, !rotationLock);
return false;
case NAVIGATOR_ORIENTATION:
orientationEventId = navigator_event_get_id(event);
changeOrientation();
return false;
...
...
}
}
int GLScreen::changeOrientation() {
clog << "rotating screen" << endl;
/* WHAT THE HELL DO I HAVE TO DO HERE ???????? */
clog << "finished rotating screen" << endl;
invalidate();
navigator_done_orientation_id(orientationEventId);
return EXIT_SUCCESS;
}When I execute this application, the screen rotates (when I leave the application after rotating it, the system menu is rotated, too) but the application content AND CONTROL (touch-events x and y) stay the same in their orientation like the rendered output (as to say: when I rotate the screen the x axis becomes the y axis in the eyes of the user)
Can anyone help me with that problem or provide an example?
Regards
Björn Zeutzeim
01-04-2013 03:45 PM
See how it is done in this sample https://github.com/blackberry/NDK-Samples/tree/mas