This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Flickering Using CGapiApplication


Flickering Using CGapiApplication

Postby CapesDev » Sep 22, 2002 @ 2:49am

CapesDev
pm Member
 
Posts: 9
Joined: Apr 25, 2002 @ 3:42am


I got it

Postby CapesDev » Sep 22, 2002 @ 3:00am

CapesDev
pm Member
 
Posts: 9
Joined: Apr 25, 2002 @ 3:42am


Postby ppcStudios » Sep 23, 2002 @ 3:36am

User avatar
ppcStudios
pm Insider
 
Posts: 744
Joined: Aug 23, 2002 @ 3:53pm
Location: Canfield, Ohio


Postby CapesDev » Sep 25, 2002 @ 8:58pm

I used a similar technique for most of my game structure. That is, used base classes that had virtual draw(), update(), etc and were implemented in the derived classes. It sill made it tricky to deal with because I had many cases where I wanted a very scripted set of processing that did not easily fit within the overall 'update, plot' paradigm. Anyhow, good to know someone else gave thought to this :)
CapesDev
pm Member
 
Posts: 9
Joined: Apr 25, 2002 @ 3:42am


Postby Thitsa » Sep 25, 2002 @ 9:21pm

I am doing the exact same thing that you are trying to do in my grid based game. My solution was to have the ProcessNextFrame method call the Animate() routine which updates the data members depending of the state of the object. For example, suppose my Man is to move from one grid to another and the move requires 5 steps. I would call a Move() on my Man object that sets up the appropriates flags and counters so that the next time Animate() is called on it, it will animate/move the image one position and update the counter. Animate() will end the move cycle when the end of the counter (5 iterations) is reached. So when the ProcessNextFrame is called, it will call Animate() on the Man, which in turn will update the position and image of the man as necessary. Now ProcessNextFrame can call the Draw() on the Man to display the correct image at the correct position. The effect is that while the Man is in the Move mode, it will move from one grid cell to another in 5 steps, independent of user interaction. Note that a redraw is done only once per call to ProcessNextFrame, eliminating the flickering. You can also have Animate called by timer if you want the fully seperate the display and logic methods. I'm sure there are many ways of doing this but this is what works for me. Hope that helps.
User avatar
Thitsa
pm Member
 
Posts: 28
Joined: Aug 5, 2002 @ 7:53pm


Postby iceboxman » Sep 27, 2002 @ 12:58am

iceboxman
pm Member
 
Posts: 30
Joined: Aug 6, 2002 @ 11:06pm


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron