openGL blending

Problems with Canvas, OpenGL, etc...

openGL blending

Postby monnti » Sun Mar 27, 2011 7:55 pm

HI,

I have a problem with openGL on my htc desire...

When i try to display a transparent object it doesn't work and i'm getting a completely visible one. But if i do the same with the emulator everything works fine...


That is the code for the visualisation:

gl.glEnable(GL11.GL_BLEND);
gl.glBlendFunc(GL11.GL_SRC0_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA);
gl.glColor4f(1, 0.2f, 0, 0.7f);
gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY );
gl.glVertexPointer(3, GL11.GL_FLOAT, 0, vertices);
gl.glDrawArrays(GL11.GL_TRIANGLES, 0, 3);

someone has an idea??
monnti
Freshman
Freshman
 
Posts: 2
Joined: Sun Mar 27, 2011 7:48 pm

Top

Re: openGL blending

Postby zorro » Thu May 05, 2011 10:01 am

The Desire uses the GPU for rendering your demo but the emulator uses software platform PixelFlinger, so it's not always useful to compare the outputs of the two. In your code you enable TEXTURE_COORD array but you set up the VERTEX_ARRAY pointer, which is not correct. Can you post the entire OnDraw function? The fragment you posted does not clarify your potential problem.
User avatar
zorro
Experienced Developer
Experienced Developer
 
Posts: 71
Joined: Mon Aug 10, 2009 3:11 pm
Location: Romania

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 2 guests