I am experimenting a bit with OpenGL ES on the Nexus One. There was a problem with the full screen resolution. It seems like I can never get the real full resolution of Nexus One, which is 480 * 800. I use orthogonal projection and just want to draw a simple triangle with the matrix representing the identity model:
@Override
public void sizeChanged(GL10 gl, int width, int height) {
gl.glViewport( 0, 0, width, height);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
GLU.gluOrtho2D(gl, 0, width, 0, height);
}
Coordinates for a triangle:
float[] coords = {
0.0f, 0.0f, 0,
200.0f, 200.0f, 0,
100.0f, 0.0f, 0,
};
And I get the result below:
alt text http://www.anddev.org/files/device_184.png
(480 * 800 res) Nexus 1. , ( , 480, ). , sizeChanged ( GLSurfaceView, , GLSurfaceView), width = 480 height = 800 , . , , sizeChanged, ? , , , , , ?
I also made a quick implementation using GLUT on Windows with the same setup and drew the same triangle. I get the result below, which is the expected result. Can anyone help me figure out how to get the same result over the phone?
alt text http://www.anddev.org/files/glut_on_win_137.png
I already put
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>
tagin AndroidManifest.xml. In particular, I found that it only looks like android: anyDensity = "true" | "false", as this changes the result. Others do not change the result at all. My project is also on SDK 1.6, which is recommended for developing applications that support a larger screen phone.
The original question is also asked here: http://www.anddev.org/viewtopic.php?p=34832#34832