2

I'm using opengl, pretty new to it. Tried rendering a semi transparent cloud in my app recently but it looked different on my Galaxy S and my HTC desire HD :(.

Here is an image of the clouds on both phones clouds on Galaxy S and Desire HD.

Been reading around for ages, it seemed like Bitmap.config had smthng to do with the problem, so i added this line just before my bitmaps are loaded:

mBitmapOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;

There was no difference. Really appreciate any tips, thanks!

Edit:

I've added the following two lines in my onCreate method but the texture remains the same on both phones.

    getWindow().setFormat(PixelFormat.RGBA_8888);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);

Edit:

I've tried drawing the same image using the api demos static sprite activity to rule out mistakes in my code but got the same problem.

Edit:

Also tried drawing the same texture on a HTC Sensation and a LG Optimus 2x. Same problem on the HTC Sensation as on the Desire HD, no problems on the LG Optimus 2x.

hohoho
  • 21
  • 2

2 Answers2

0

Try enabling dithering by caling gl.glEnable(GL10.GL_DITHER) (or the equivalent of the gl version you are using if not GL10).

Edit: and if that don't work, also call getWindow().setFormat(PixelFormat.RGBA_8888); in your onCreate() method.

Jave
  • 31,598
  • 14
  • 77
  • 90
  • Thanks for responding, i've tried enabling dither, just tried again, doesn't rectify the problem. – hohoho Feb 24 '12 at 15:19
  • Hi i've tried adding that as well as getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);. No effect for both. – hohoho Feb 24 '12 at 15:31
  • Strange, then I don't know what might be causing the problem :( – Jave Feb 24 '12 at 15:39
0

This question may be related to yours. Perhaps, you're running unofficial build on HTC Desire HD.

Also try following settings (call it in your Activity.onCreate(..) method):

getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);
Community
  • 1
  • 1
a.ch.
  • 8,285
  • 5
  • 40
  • 53