Windows has nothing to do with it. :-Pby OLPC (no login)
I think RPG was saying the problem is due to threads, not that it is unsolvable. Either way, there is an easy fix.
For my programs I just have to put one Sleep line in the main program loop, and a Sleep line in the menu. You just have to make sure a Sleep line is run a few times a second, so functions such as Input, which will run for several seconds while the user is typing something, will need a Sleep line. Functions such as Inkey won't need to call Sleep, since it is used in the main program loop, which does the Sleeping. (The code at the end of this post shows how to keep a consistent frame rate in a game.)
With multiple threads, you just have to make sure each thread Sleeps.
In FreeBasic, the "invisible" (2nd) thread for updating the display uses something like Sleep (I'm not sure exactly how), so it only updates the screen 60x per second.
Dim As Double t
t = Timer
game.key = Inkey
If game.key = Chr(27) Then
Get (0, 0) - (screenx - 1, screeny - 1), game_graphic
Select Case utility_menu(utility_menu_ingame, false)
game.quit = true
t = 25 + (t - Timer) * 1000
If t > 0 Then Sleep t
Loop Until game.quit Or game.won Or game.lost
|Response Title||Author and Date|
|oh forgive me!||mennonite on Jan 29|
|also how well does wait &h3da, 8 work for this?||mennonite on Jan 29|
|Not sure...||OLPC on Jan 29|
|i'll be sure to try it with qb64 later||mennonite on Jan 29|
|Priorities||OLPC on Jan 29|
|cool||mennonite on Jan 29|
|In Windows 2000, it's...||OLPC on Jan 29|
|*thanks, same in xp||mennonite on Jan 29|