I'm writing some 3D rendering code, having started from the API demos
to get the SurfaceHolder and openGL initialization/refresh logic. The
actual rendering after that is not a problem.

However, it seems that openGL does not create a surface properly. You
can see the problem in the API demo. Both the GLSurfaceView and
Translucent GLSurfaceView demos use the same Cube class to draw the
mesh, and so have the same color. But the result on screen has
inverted color channels in the translucent case.

To make it obvious, change the colors in the Cube.java color array to
be 0x10000, 0, 0, 0x10000 on each line. In the non-translucent demo,
the cube will appear red. In the translucent demo, it will show blue.

If the format set on the SurfaceHolder does not match the one
requested from openGL, it's obvious the phone does not do any
conversion, and simply copies the bits to the surface. That's
expected, except there seems to be no way to define them to be the
same if we want better then 565 quality.

The non-translucent demo uses a RGB 565 format, whereas the
translucent one uses RGBA 8888. But it seems open GL creates a BGRA
8888 instead.

Am I missing a call somewhere to specify the channel order?

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

Reply via email to