PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Help me!

Hi!all
I.
When I build an application with the CGapiApplication,I find I can only capture the input messages in KeyDown(),StylusDown()...,and recognize the position stylus down(up) with PtInRect().then process these messages in ProcessNextFrame(),so I define a lot of variables in type of BOOL.Through these variables,I determinate which surface will be Blt to the backbuffer in ProcessNextFrame().More trouble with more BOOL variables in my code.I try to find better ways to improve my code!help me!

II.
On my application's start screen,I set three buttons(bitmap in a rect)on it,and to blink these buttons with FillRect() when the stylus touch on them,but the program runs to the next frame so fast that I can not see the blink,anyone has the better ways:after the stylus touch,the program delay in a second time,so the blink shows clearly,then into the next frame.help me!
You can set a bool flag (to true) in StylusDown that tells ProcessNextFrame you currently have the button pressed and to draw the button in that state. In StylusUp you can reset that same flag (to false) to tell ProcessNextFrame that the button is now in the up position and to draw it that way.

As for having alot of bool flags cluttering your code, you could have a single DWORD variable that is set to the current gamestate. ProcessNextFrame could then monitor this gamestate and draw accordingly.