[android-developers] Re: 2d Canvas over Opengl (Flickering !!)
I found the best solution in the Sample code of course. you can look at these classes: - LabelMaker - NumericSprite Franck On Dec 2, 11:42 am, fcalzada [EMAIL PROTECTED] wrote: Hi petunio, you said I managed (after a lot of problems) to put2Dgraphics on top of3D. I'm trying hard to do the same, and i don't find a solution. how did you do ? thanks a lot On Nov 27, 3:09 pm, petunio [EMAIL PROTECTED] wrote: Hi all does anybody know what am I doing wrong? I managed (after a lot of problems) to put2Dgraphics on top of3D. But the2Dgraphics are flickering... this is the main loop: public void drawFrame(GL10gl, 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 the3Dworld, it works... drawIcons(myCanvas); //draws the2Dgraphics. 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 android-developers@googlegroups.com 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 -~--~~~~--~~--~--~---
[android-developers] Re: 2d Canvas over Opengl (Flickering !!)
There is an Api demo showing how arbitrary views can be positioned on top of a SurfaceView, if you want a true overlay. On Tue, Dec 2, 2008 at 2:42 AM, fcalzada [EMAIL PROTECTED] wrote: Hi petunio, you said I managed (after a lot of problems) to put 2D graphics on top of 3D. I'm trying hard to do the same, and i don't find a solution. how did you do ? thanks a lot On Nov 27, 3: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(GL10gl, 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! -- Dianne Hackborn Android framework engineer [EMAIL PROTECTED] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com 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 -~--~~~~--~~--~--~---
[android-developers] Re: 2d Canvas over Opengl (Flickering !!)
Hi petunio, you said I managed (after a lot of problems) to put 2D graphics on top of 3D. I'm trying hard to do the same, and i don't find a solution. how did you do ? thanks a lot On Nov 27, 3: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(GL10gl, 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 android-developers@googlegroups.com 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 -~--~~~~--~~--~--~---
[android-developers] Re: 2d Canvas over Opengl (Flickering !!)
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 android-developers@googlegroups.com 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 -~--~~~~--~~--~--~---