SDL: setenv("CARDBOARD_VR") if started from Google Cardboard app

This commit is contained in:
pelya
2015-12-14 01:07:02 +02:00
parent 12e9683685
commit abaf57d615
7 changed files with 11 additions and 5 deletions

View File

@@ -25,6 +25,7 @@
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" /> <!-- Samsung's multiwindow -->
<action android:name="com.sec.android.airview.HOVER" /> <!-- Stupid Samsung requires their own intent for finger-hover events -->
<category android:name="android.intent.category.LEANBACK_LAUNCHER" /> <!-- Android TV requires this -->
<category android:name="com.google.intent.category.CARDBOARD" /> <!-- Cardboard VR -->
</intent-filter>
</activity>
<!-- ==ADMOB== --> <activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize|layoutDirection"/>

View File

@@ -638,6 +638,11 @@ class Settings
nativeSetEnv( "TV", "1" );
nativeSetEnv( "ANDROID_TV", "1" );
}
if (p.getIntent().getCategories() != null && p.getIntent().getCategories().contains("com.google.intent.category.CARDBOARD")) {
nativeSetEnv( "CARDBOARD", "1" );
nativeSetEnv( "VR", "1" );
nativeSetEnv( "CARDBOARD_VR", "1" );
}
if (p.getIntent().getStringExtra(RestartMainActivity.SDL_RESTART_PARAMS) != null)
nativeSetEnv( RestartMainActivity.SDL_RESTART_PARAMS, p.getIntent().getStringExtra(RestartMainActivity.SDL_RESTART_PARAMS) );
try {

View File

@@ -5,7 +5,7 @@ TODO, which will get actually done
- TeeWorlds: navigate UI with gamepad.
- OpenArena: cardboard VR mode, fix aiming angles jumping at random after the first zoom, and make Back button exit the server / game, as required by Android TV.
- OpenArena: cardboard VR mode, fix aiming angles jumping at random after the first zoom and after respawn, and make Back button exit the server / game, as required by Android TV.
- SDL: implement SDL_GL_LoadLibrary() / SDL_GL_GetProcAddress() / SDL_GL_SetAttribute() / SDL_GL_GetAttribute().