MrSnowflake wrote:Using java Syntax Highlighting
try { canvas = mSurfaceHolder.lockCanvas(null); synchronized (mSurfaceHolder) { // Draw you stuff } } finally { // do this in a finally so that if an exception is thrown // during the above, we don't leave the Surface in an // inconsistent state if (canvas != null) { mSurfaceHolder.unlockCanvasAndPost(canvas); } } Parsed in 0.032 seconds, using GeSHi 1.0.8.4



MrSnowflake wrote: If you have really heavy calculations to do, you should do them in another thread.
MrSnowflake wrote:For the record: DS Games (and GBA and gb* games) do all their game stuff in 1 thread and they run at 60Hz, with WaitForVBlank on!

Well, it will probably not be a very good idea indeed, but you should know the option is thereDanuubz wrote:MrSnowflake wrote: If you have really heavy calculations to do, you should do them in another thread.
Hmm, I've made bad experiences with that. It usually slows down the game even more (especially in a mobile phone i suppose).
.Yup. Actually, the drawing to the screen is done in hardware by the DS (even for 2D), you set registers to the values u want, so the drawing itself doesn't affect your game speed.Danuubz wrote:MrSnowflake wrote:For the record: DS Games (and GBA and gb* games) do all their game stuff in 1 thread and they run at 60Hz, with WaitForVBlank on!
That means grafic drawings and game logics in same thread?

MrSnowflake wrote:Yup. Actually, the drawing to the screen is done in hardware by the DS (even for 2D), you set registers to the values u want, so the drawing itself doesn't affect your game speed.

MrSnowflake wrote:The double buffering is not nescessairy because of the synchronization.



Return to View, Layout & Resource Problems
Users browsing this forum: Majestic-12 [Bot] and 8 guests