My activity class:
...useless stuff...
import android.opengl.GLSurfaceView;
public class MyApp extends Activity
{
private GLSurfaceView mSurfaceView;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE); //fullscreen
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
glSurfaceView = new GLSurfaceView(this);
glSurfaceView.setRenderer(new MyRenderer());
setContentView(glSurfaceView);
}
}
My Renderer class
...unimportant stuff...
import android.opengl.GLSurfaceView.Renderer;
public class MyRenderer implements Renderer
{
@Override
public void onDrawFrame(GL10 gl)
{
...iterate over draw objects and call .draw() on them...
}
}
...more unimportant stuff...
1) Is OpenGL ES double buffered by default?
Right now, I've created a Renderer class that extends GLSurfaceView.Renderer. From that, I've got an override for onDrawFrame...like you can see above. Is this already double buffered? I've done a little bit of OpenGL coding for PC and I remember having to specifically tell it to swap buffers...
2) Given my current setup, is the renderer already on its own thread? Is that something handled by OpenGL ES (or the GLViewPort class)?
3) Right now I'm doing everything inside of the onDrawScene(GL10 gl) function. Is there a better way of creating a game loop? Seems like (assuming rendering is currently on its own thread), onDrawScene should just iterate of my drawable objects and draw them, but I should probably have a loop in another thread somewhere polling input, updating drawable object positions, etc. Any thoughts?
Thanks, in advance, for the help!
[Edit: spelling error]

Find content
Not Telling