Browse Source

force portrait orientation for home screen. also experimented with dark/transparent gl view

Fabio Arnold 10 years ago
parent
commit
5b24db46ac

+ 2 - 1
AndroidManifest.xml

@@ -28,7 +28,8 @@
         <activity
             android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"
             android:configChanges="keyboardHidden|orientation|screenSize"
-            android:label="@string/app_name" >
+            android:label="@string/app_name"
+            android:screenOrientation="portrait" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 5 - 0
src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/HomeGLSurfaceView.java

@@ -1,6 +1,7 @@
 package de.tudarmstadt.informatik.hostage.ui2.fragment.opengl;
 
 import android.content.Context;
+//import android.graphics.PixelFormat;
 import android.opengl.GLSurfaceView;
 import android.util.AttributeSet;
 import android.util.Log;
@@ -14,6 +15,10 @@ public class HomeGLSurfaceView extends GLSurfaceView {
 	public HomeGLSurfaceView(Context context, AttributeSet attrs) { // will be called
 		super(context, attrs);
 		setEGLContextClientVersion(2); // OpenGL ES 2.0
+		//setZOrderOnTop(true);
+		// transparency
+		//setEGLConfigChooser(8, 8, 8, 8, 16, 0);
+		//getHolder().setFormat(PixelFormat.RGBA_8888);
         setRenderer(new ThreatIndicatorGLRenderer());
 	}
 }

+ 1 - 0
src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/ThreatIndicatorGLRenderer.java

@@ -53,6 +53,7 @@ public class ThreatIndicatorGLRenderer implements Renderer {
 	public void onSurfaceCreated(GL10 arg0, EGLConfig arg1) {
 		//GLES20.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
 		GLES20.glClearColor(backgroundColor[0], backgroundColor[1], backgroundColor[2], 1.0f);
+		// GLES20.glClearColor(0.3f, 0.3f, 0.3f, 1.0f); // dark background
 		GLES20.glEnable(GLES20.GL_DEPTH_TEST);
 		GLES20.glEnable(GLES20.GL_CULL_FACE);
 		GLES20.glEnable(GLES20.GL_TEXTURE_2D);