[fpc-pascal] OpenGL ES bitmap drawing
Reimar Grabowski
reimgrab at web.de
Sat Nov 26 15:06:39 CET 2011
On Fri, 25 Nov 2011 17:53:13 +0100
Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com> wrote:
> So far I managed to get this:
>
> http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/customdrawn/customdrawnobject_android.inc?view=markup&root=lazarus
After a quick look I have some questions:
It looks like you are using lit geometry, any reason for that?
Why do you enable blending after drawing and at all?
Why do you set up your matrices after drawing? (See Jeppes remark about glDrawArrays)
Why do you enable texturing after drawing? (You only loose the first frame as for the next it will be enabled, but it is strange nonetheless)
You said there is a pixel format mismatch. AFAIR your texture should be white if something is wrong with it, but I am not 100% sure in case of a format mismatch.
To debug:
Disable blending, texturing, lighting and face culling and just draw a colored quad to check if your matrix setup in combination with placement of the quad in the world is correct.
Reenable face culling and check.
Reenable texturing and check (fix your pixel format mismatch before that).
Reenable lighting if needed.
Reenable blending if needed.
Be generous with glGetError calls see
http://www.khronos.org/opengles/documentation/opengles1_0/html/glGetError.html.
hope it helps
R.
More information about the fpc-pascal
mailing list