Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / Orientation not changing

Author
Message
victordavion
7
Years of Service
User Offline
Joined: 3rd Jan 2012
Location:
Posted: 12th Jul 2012 23:34 Edited at: 12th Jul 2012 23:37
I've been away for awhile and was last using v1065. I've returned and installed v1076 and started a new project. So I've heard that v1075+ have switched to supporting native orientation ( awesome! ), however I've run into a problem. I looked around and haven't found anything on the forum that's precisely what I'm having trouble with, or I just didn't understand it properly.

I'll keep it simple: I have an app right now that simply detects what orientation the phone is in and prints it out. It reports correctly ( says landscape in landscape and portrait in portrait), however, it doesn't change the way it draws. It still prints out as if it were in portrait mode no matter what.

I've deleted the configuration file since I thought it was deprecated and now the app exits immediately when I run it. I looked through the core.cpp and it looks like it still relies on the config file, but it won't generate a new one...

I assumed that the allowed orientations were all defaulted to 1, but just in case I made a call in the begin method to agk::SetOrienationAllowed(1,1,1,1) to make sure all of them are allowed. This crashes the app.

Is this an AppGameKit issue right now or just something I'm screwing up?
victordavion
7
Years of Service
User Offline
Joined: 3rd Jan 2012
Location:
Posted: 13th Jul 2012 06:41
Okay, so I delved a little deeper.

The Core.cpp ( and its header ) are not up to date in the 1076 distribution in the templates folder.

I compared it to the interpreter_android project to find out. I attempted to update it manually, but I think I got some stuff wrong.

Anyway. I'm curious. Does anyone have an updated ( read: fixed ) version of Core.cpp & header?
victordavion
7
Years of Service
User Offline
Joined: 3rd Jan 2012
Location:
Posted: 4th Aug 2012 19:17
All the above stuff is solved, however there still seems to be an odd orientation issue.

The device detects an orientation change sooner than AppGameKit does ( which I find odd, because I thought AppGameKit uses the API to detect orientation changes ). So if I rotate only 45 degrees, the screen changes but I have to rotate at least 60 degrees before AppGameKit will detect it and change my aspect ( as my code dictates ).

Login to post a reply

Server time is: 2019-06-16 20:29:06
Your offset time is: 2019-06-16 20:29:06