Archived

This topic is now archived and is closed to further replies.

Gorky

Multithreading keyboard

Recommended Posts

Gorky    122
Chris, Any chance to make the DInput keyboard routine become multi-threaded? I ask because it is possible to make any app come to a crawl, therefore making it very hard to close an app via esc key. With the keyboard always polling for data behind the game, it never has to slow down when the video comes grinding to a halt. E.g your new dancing girls demo. If you got one frame per sec, I''ll probably get around .05 per sec. Any app can simulate slow speeds by changing PR_InitTimer''s parameter. You''re current character array system would have to change. You check once per frame to see if keys are pressed. The new way has the multi-threaded keyboard place keys into a queue vs. a buffer. Then the game can work off the queue, while the keyboard portion is always feeding it data. No key presses should ever be lost. More importantly, you can have the keyboard mechanism instantly close the main app, if the user chooses to do this. Nothing sucks more than not being able to close a game!

Share this post


Link to post
Share on other sites