This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.Writer; | |
import java.lang.ref.WeakReference; | |
import java.util.ArrayList; | |
import javax.microedition.khronos.egl.EGL10; | |
import javax.microedition.khronos.egl.EGL11; | |
import javax.microedition.khronos.egl.EGLConfig; | |
import javax.microedition.khronos.egl.EGLContext; | |
import javax.microedition.khronos.egl.EGLDisplay; | |
import javax.microedition.khronos.egl.EGLSurface; | |
import javax.microedition.khronos.opengles.GL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); | |
//Full screen, landscape. | |
requestWindowFeature(Window.FEATURE_NO_TITLE); | |
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, | |
WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
if (getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) | |
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int getResourceId(Context context, String name) { | |
name = name.toLowerCase(); | |
return context.getResources().getIdentifier(name, "drawable", context.getPackageName()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setLayout(new BorderLayout(0, 0)); | |
final GLCanvas canvas = new GLCanvas(); | |
canvas.setMinimumSize(new Dimension()); //fix a GLCanvas resize bug. | |
animator = new Animator(canvas); //TODO switch to FPSAnimator to save energy. | |
canvas.addGLEventListener(OpenglCore.getInstance()); | |
this.add(canvas); |
NewerOlder