Hi,

I have a problem drawing a background for my OpenGL app on the
emulator. It all works well on an actual G1, but i'm worried that if
the emulator has a problem, other android phones may have the same
problem.

On an actual G1 the background is drawn on the background. All other
drawing is drawn in front of it.
On the emulator, the background is always drawn on the foreground,
obsuring any other drawing.

Here are two screenshots, where i have my background only occupying
half of the screen:
>From emulator
http://www.streetsofboston.com/photos/505952628_oatDP-O.png

>From phone
http://www.streetsofboston.com/photos/505952626_Cb9Mc-O.png

Here are some code snippets:
Clearing screen before drawing anything else:
  gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);

Drawing the actual background:
  gl.glBindTexture(GL10.GL_TEXTURE_2D, mBackgroundTextureID);
  ((GL11) gl).glTexParameteriv(GL10.GL_TEXTURE_2D,
      GL11Ext.GL_TEXTURE_CROP_RECT_OES, smBackgroundCrop,0);
  ((GL11Ext)gl).glDrawTexiOES(0, 0, 1, (int)mViewWidth, (int)
mViewHeight);
(the background is drawn where Z=1, the far-plane).

Enable depth-test and setting the func to equal or less than equal:
  gl.glEnable(GL10.GL_DEPTH_TEST);
  gl.glDepthFunc(GL10.GL_LEQUAL);
(using the default depth-func will not draw the background on the
phone)

Surface type:
  mHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
(changing the surface type won't fix it for the emulator)


My question is:
Is there a bug in the emulator or may there be a real problem with my
code?

Thanks!



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to