I'm not insane - gyroscope swaps axes when the screen orientation is inverted when holding the phone upside down.
This commit is contained in:
@@ -719,6 +719,16 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
Thread.sleep(50); // Give some time to the keyboard input thread
|
||||
} catch(Exception e) { };
|
||||
}
|
||||
|
||||
// We will not receive onConfigurationChanged() inside MainActivity with SCREEN_ORIENTATION_SENSOR_LANDSCAPE
|
||||
// so we need to create a hacky frame counter to update screen orientation, because this call takes up some time
|
||||
mOrientationFrameHackyCounter++;
|
||||
if( mOrientationFrameHackyCounter > 100 )
|
||||
{
|
||||
mOrientationFrameHackyCounter = 0;
|
||||
context.updateScreenOrientation();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -913,6 +923,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
|
||||
public int mWidth = 0;
|
||||
public int mHeight = 0;
|
||||
private ClipboardManager clipboard = null;
|
||||
int mOrientationFrameHackyCounter = 0;
|
||||
|
||||
public static final boolean mRatelimitTouchEvents = true; //(Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user