Advertisement

Blocking Windows Messages For Effects

Started by July 05, 2000 02:14 AM
1 comment, last by Qoy 24 years, 5 months ago
The easiest way to do certain effects (like fades, and having text come across the screen letter by letter) is to just use for loops or while loops in the code, but that stops you from recieving windows messages while the effect is on (because you aren''t going through the message loop, just the effect loop). I was wondering, how long is it considered ''acceptable'' to sit in a loop to do an effect or something like this while ignoring windows messages? Or is there a better way to implement this stuff, that will leave the message loop, and the main game loop which recieves input from something like DirectInput, open to recieve keypresses and stuff?
Nothing is stopping you from calling (Peek/Get/Translate)Message in the effect loop if you want to process windows message (You can even jump into another function that does the infinite while loop - good for multiple screens), but I don''t think you should bother because the effect duration should be short..

..
Advertisement
If you are really concerned about keeping your app responding to user Input, you should spawn off another thread. Doing this is very simple...

Tim

--------------------------
www.gamedev.net/hosted/glvelocity
glvelocity.gamedev.net
www.glvelocity.com
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity

This topic is closed to new replies.

Advertisement