Hi,
I use opengle 1.x
I use the following code to build a bitmap from FrameBuffer:
The FrameBuffer is resized to 128x128.
The Bitmap renderImage is used as a bitmap for an ImageView view.
public void onDrawFrame(GL10 gl) {
coinObject3D.rotateY((float) (Math.PI/180.0f));
cube.rotateY((float) (Math.PI/180.0f) * -1);
//cube.translate(x, y, z)
prevXRot = xrot;
prevYRot = yrot;
prevZRot = zrot;
fb.clear(back);
int w = fb.getWidth();
int h = fb.getHeight();
world.renderScene(fb);
int[] tmpPixels = fb.getPixels();
renderImage = Bitmap.createBitmap(tmpPixels, fb.getWidth(), fb.getHeight(), Config.RGB_565);
Log.d("TAG", "width = " + fb.getWidth());
Log.d("TAG", "height = " + fb.getHeight());
world.draw(fb);
//fb.runPostProcessors();
fb.display();
if (System.currentTimeMillis() - time >= 1000) {
Logger.log(fps + "fps");
fps = 0;
time = System.currentTimeMillis();
}
fps++;
}
Thanks in advance