PocketMatrix forums

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

GapiDraw 1.04 thread priorities

Hi,

This has been posted earlier on the forum, but if you are experiencing bad input response (stylus and button messages are being dropped) on some devices you should change the following lines in CGapiApplication. I think it's a good idea to change the thread priorities anyways, and they will be changed in GapiDraw 1.10:

Current version
Code:
::SetThreadPriority(m_hThread, THREAD_PRIORITY_ABOVE_NORMAL);
Sleep(100);


Change to:
Code:
#ifndef _WIN32_WCE
::SetThreadPriority(m_hThread, THREAD_PRIORITY_ABOVE_NORMAL);
Sleep(100);
#endif

/Johan
spacemonkey · 16 Jan 2003, 08:42 UTC
This is extra important if you are trying to use this library for Smartphone 2002 work. You need the phone to be able to interupt if a call comes in and the hightened thread priority can block that.

Also, a note, in the samples the simple sample has no way to exit on smartphone as I think it want's stylus input on the X button, so be prepared to pull the battery after checking it.
Thanks for the tip! :)
I don't see why you want to boost the thread priority even on desktop machines, all game threads should be normal or lower since background OS tasks and such are usually more important. I suggest this code just be taken out all together in the next version.
Increasing thread priorities is necessary if the game is to be run in windowed mode on desktop machines. Otherwise the game would halt to a stop if the user simply resizes another window.

Also, GapiDraw does not increase thread priorities so that it will conflict with background tasks.. Setting the thread priority to "high" is no big deal really...