I've been developing my top-down 2d OpenGL game using the emulator so far (right now, just displaying a tile map). It looks good on the emulator, but when I put it on my Nexus One to try it out, my tile map was nowhere to be seen and I just had the weird OpenGL funky background.
Since then I've tried to narrow down what the difference between the emulator and the device is, but I can't seem to place it. I never once got any of my tile map (which uses one big VBO with a grid) to display on the device but I did get some squares, etc to show up and it does look quite different.
In the setup of my app, I've screwed around with an ortho projection and fixing the size of the screen. I've been using an emulator resolution that's the same as my N1 though (800x480) so I'm not sure what would happen there.
What's the difference between the emulator and the N1? Is there some dangerous setting that I'm using?
If it helps, here is some of the init code I use:
- Code: Select all
gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);
gl.glShadeModel(GL10.GL_FLAT);
gl.glDisable(GL10.GL_DEPTH_TEST);
gl.glEnable(GL10.GL_TEXTURE_2D);
gl.glDisable(GL10.GL_LIGHTING);
gl.glViewport(0, 0, 480, 800);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrthof(0, 480f, 800f, 0f, 0.0f, 1.0f);
gl.glMatrixMode(GL10.GL_MODELVIEW);
This (at least on the emulator) gives me a 800x480 screen with the origin at the top left.
Thanks...
Dave


My recommendation is to take the standard divide and conquer approach and start with the basics of your app and get them working on a real device then add more and more functionality until you come across the problem. I'm actually quite surprised that you got VBOs to work on the emulator. It certainly didn't support that back at Android 1.0 at least if I recall correctly! I haven't used the emulator since I got a real device in my hands Oct '08.