[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 115: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
PocketMatrix • View topic - Iphone Orientation Issue
Page 1 of 1

Iphone Orientation Issue

PostPosted: Jun 7, 2010 @ 11:32am
by Raymond
Hello,

I am a new user of the EdgeLib, and I want to use it to make some iPad applications.
An iPad application must support at least 2 orientations to be validated and submitted.

So, I want to know how to rotate the application when the device's orientation change.

I have try many things :
- Use the callback OnDisplayChange, try to printf something inside, but this method's never called, so I don't understand what's the use of this callback.
- create a new class (.mm) and a method which check the UIDevice orientation. I call this method every frame (OnNextFrame), but the orientation of UIDevice never changes.
- I also try to add some options in the Info.plist as UISupportedInterfaceOrientations etc.. but nothing.

So what is the correct method to handle the orientation's change event?

Thanks in advance,

Raymond

Re: Iphone Orientation Issue

PostPosted: Jun 8, 2010 @ 5:30pm
by edge
Hi Raymond,

The OnDeviceChanged callback is used for other mobile platforms and has no use for iPhone. We will research orientation handling on the iPad in combination EDGELIB. Either way, when using OpenGL ES you need to manually rotate (using glRotate and glTranslate) for orientations other than portrait mode.

Re: Iphone Orientation Issue

PostPosted: Jun 8, 2010 @ 5:36pm
by Raymond
Hi, thanks for your answer.

I agree, but my problem is the handling of the orientation's change event.
I don't know how to know when does the user move his device to other orientation!

I find some ways to rotate the screen manually (as you said), but no way to know when to do it !

Some applications (angry birds) developped with edgelib manage perfectly the rotation, so it is possible.

I don't know if I am clear..

Please help me!

Thanks

Re: Iphone Orientation Issue

PostPosted: Jun 8, 2010 @ 6:20pm
by Dan East
The app probably monitors the accelerometer.

Re: Iphone Orientation Issue

PostPosted: Jun 16, 2010 @ 9:26am
by edge

Re: Iphone Orientation Issue

PostPosted: Sep 15, 2010 @ 5:20am
by totoch
Could you make a short tutorial about that ? That would be greatly appreciated.
Also, is there any chance this feature would be integrated in an upcoming release ?
Thanks!

Re: Iphone Orientation Issue

PostPosted: Sep 16, 2010 @ 3:48pm
by edge
Hi,

The above two functions are written in Objective-C and can be implemented in your application. To do this, create an .mm source file with these functions inside (these can be part of a C++ class). The header file can be included in your c++ program, as long as there is no objective-c code inside that header file.

We may choose to implement a more convenient way of handling this in a future version of EDGELIB, however this isn't planned yet.