this is test code, you'll see a white square on top left corner and it moves a little.
if your screen has high resolution, maybe it's less noticeable, test screen is 1024x600.
package abc.def;
import com.threed.jpct.*;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.opengles.GL10;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.app.Activity;
public class Sim extends Activity {
static GLSurfaceView GLview;
static MyRenderer renderer;
static FrameBuffer fb;
static World world=new World();
static Camera cam=world.getCamera();
static Texture tex;
static float fov=0.1f;
protected void onCreate(Bundle a) {
super.onCreate(a);
renderer=new MyRenderer();
GLview=new GLSurfaceView(getApplication());
GLview.setEGLContextClientVersion(2);
GLview.setRenderer(renderer);
setContentView(GLview); }
@Override
protected void onPause() { super.onPause(); GLview.onPause(); }
@Override
protected void onResume() { super.onResume(); GLview.onResume(); }
@Override
protected void onStop() { super.onStop(); }
class MyRenderer implements GLSurfaceView.Renderer {
public void onSurfaceCreated(GL10 g,EGLConfig c) {}
public void onSurfaceChanged(GL10 g,int w,int h) {
if (fb!=null) fb.dispose();
fb=new FrameBuffer(w,h);
cam.setFOVLimits(0.0001f,10f);
cam.setClippingPlanes(0.1f,100f);
tex=new Texture(1,1,new RGBColor(200,200,200));
TextureManager.getInstance().addTexture("tex",tex);
}
public void onDrawFrame(GL10 g) {
fb.clear(); cam.setFOV(fov);
fov-=0.001f; if (fov<0.01) fov=0.1f;
world.renderScene(fb); world.draw(fb);
fb.blit(tex,0,0,10,10,0,0,80,80,-1,false);
fb.display(); }
}
}