Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎01-04-2013
My Device: PlayBook
My Carrier: 1&1

Changing screen orientation with OpenGl

[ Edited ]

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

Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Changing screen orientation with OpenGl