Drawing to a buffer and dumping to screen, how to?

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

Drawing to a buffer and dumping to screen, how to?

Postby RobinPLA » Mon May 17, 2010 6:56 pm

Hello. Newb here trying to figure things out.

How do I draw to a buffer and, when ready, dump all that to the screen? And preferably I would want to keep drawing to the buffer without it being clearing. The lockCanvas() and unlockCanvasAndPost(c) clear the buffer - I assume this is used more for animation where you draw each frame over and over again. I just want to keep drawing and take care of the update and clearing myself when I feel that is needed.

Any help is appreciated,
Robin
RobinPLA
Freshman
Freshman
 
Posts: 2
Joined: Mon May 17, 2010 4:33 pm

Top

Re: Drawing to a buffer and dumping to screen, how to?

Postby mark@project8games.com » Mon May 17, 2010 11:38 pm

I dont know if this is the most efficient way, but you could create two bitmaps and double buffer using them. Your painting thread could paint one bitmap while you draw to the others canvas, then swap when you want to update the screen.
User avatar
mark@project8games.com
Developer
Developer
 
Posts: 41
Joined: Tue Mar 02, 2010 8:33 pm

Top

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

Who is online

Users browsing this forum: No registered users and 1 guest