Page 1 of 1

StylusMove problems

PostPosted: Dec 14, 2003 @ 11:56pm
by golan_trevize_x
Hey all,

I know this is a topic that has numerous posts in the past, but my problem seems a little different.

In order to provide an alternative to the dodgy d-pad on my pocket pc, I am implementing a "directional disc" control, where the user holds the stylus inside a visible circle on the screen and moves it around. This means that the stylus is held down continuously for some time.

Anyway, I can observe the usual drop in performance when the stylus is held down, but my bigger problem is that frequently the stylus input events will just stop happening for a couple of seconds. During that period, the stylus can be moved around or lifted off the screen, and no events will occur. Is something being overloaded?

I'd appreciate any help,

Nathan

PostPosted: Dec 15, 2003 @ 12:53am
by ppcStudios
First, be sure that you're not simply stalling in part of your program. If you're using the single threaded application framework, its not too hard to lose stylus events - especially if you're doing alot of AI processing. You may also want to look into using the multi-threaded framework because the stylus events will be much more responsive.

PostPosted: Dec 15, 2003 @ 1:16am
by golan_trevize_x
Yeah, the program is not stalling - I have animation that continues to run during this "dead period" of stylus input, so the ProcessNextFrame event is still working properly.

I haven't looked into the multi-threaded framework yet - I've been too scared of all the memory problems that can happen with a multi-threaded app - but I may have to give it a try.

Is there any documentation on how I might begin?

Thanks,
Nathan

PostPosted: Dec 15, 2003 @ 2:47am
by ppcStudios

PostPosted: Dec 15, 2003 @ 3:20am
by golan_trevize_x
Thanks for your help here dude,

The device is the Toshiba e740 :roll:, yeah I know, I'm seriously ruing the purchase now, but it was the most exciting PPC to go for at the time.

I haven't tested on the desktop yet because I haven't bought VC++. But that would be a good idea to test that.

I am using the StylusMove event to record the current position, but the processing for this control I made is only done once per frame, and only happens if we know the stylus is down. The problem is that the StylusMove event, along with the other two, just doesn't happen for a couple of seconds.

The way this is happening, it really strikes me like it wouldn't happen on the desktop. It seems like some kind of performance bottleneck or something. Like when your desktop PC sometimes stops listening to the keyboard and churns away for a while.

The thing is, I'm pretty sure I'm well over the target frame rate, so it's not dropping below ever.

Nathan

PostPosted: Dec 15, 2003 @ 4:07am
by ppcStudios
If you haven't tried already, load the Simple demo that comes with GD to see if the problem is inherent with your device. There is always the possibility that your hardware has problems (remote possibility).

Are you running anything in the background that might be sucking up the events? I presume you've tried debugging directly on the device. If not, you might try that to see if the inherent delays in the debugger free up the message pump. That may lead you to a solution if it does.

I think Johan was using the e7xx device for GD testing at one time. I'm sure if there was a problem with the stylus move events he would have seen it during testing.

PostPosted: Dec 15, 2003 @ 11:12am
by golan_trevize_x
OK, well I just turned on my PPC again and it's not happening. I think it just needed a reset! :roll:

Sorry about that!!

PostPosted: Dec 15, 2003 @ 11:09pm
by golan_trevize_x

PostPosted: Dec 16, 2003 @ 12:15am
by denthorq

PostPosted: Dec 16, 2003 @ 12:50am
by ppcStudios