I know shit about opengl, but re drawing the 2D -> you shouldn't lock
the canvas in surfaceCreated, just get a reference to the holder
there. Then when you're about to draw call holder.lockCanvas, draw on
the canvas and in a finally block call unlockCanvasAndPost.

On Thu, Nov 27, 2008 at 4:09 PM, petunio <[EMAIL PROTECTED]> wrote:
>
> Hi all
>
> does anybody know what am I doing wrong?
>
> I managed (after a lot of problems) to put 2D graphics on top of 3D.
> But the 2D graphics are flickering...
>
> this is the main loop:
>
> public void drawFrame(GL10 gl, my3DObject world, Canvas myCanvas)
> {
>      gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
>      gl.glClearColor(0, 0, 0, 1);
>
>      world.draw(gl);          //draws the 3D world, it works...
>
>      drawIcons(myCanvas);             //draws the 2D graphics. the
> ones that are flickering...
>
>      mEgl.eglSwapBuffers(mEglDisplay, mEglSurface);
> }
>
> Also, in the SurfaceCreated method I obtain the canvas, by doing:
> myCanvas=mHolder.lockCanvas();
> and then, when the surface is destroyed, I do:
> mHolder.unlockCanvasAndPost(myCanvas);
>
> Any help would be very appreciated
> Thanks!
> >
>

--~--~---------~--~----~------------~-------~--~----~
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