|
This thread is locked; no one can reply to it. |
1
2
|
FPS locking is easy - not taking 100% CPU is hard |
Thomas Fjellstrom
Member #476
June 2000
|
Also, sleep != Sleep. One is a libc function, the other is a win32 function. -- |
Evert
Member #794
November 2000
|
Quote: Well then why when I ctrl alt delete does my game crash when I call rest, but when I call sleep it works flawlessly? You screwed up somewhere? Just look at the source I posted above; if you don't have a callback, rest() calls Sleep() directly. |
Matthew Dalrymple
Member #7,922
October 2006
|
Doesn't crash after ctrl alt delete while(!key[KEY_ESC]) { FpsCounter::NewFrameStarted(); deltaTime = FpsCounter::GetDeltaTime(); firstmap.Draw(0, 0, 1); Canvas::Refresh(); Sleep(1); } Crashes after ctrl alt delete
edit: =-----===-----===-----= |
Matthew Leverton
Supreme Loser
January 1999
|
You'll need to post your entire project to determine what's wrong. rest(1) under windows ends up calling Sleep(1) after two or three regular function calls. |
Matthew Dalrymple
Member #7,922
October 2006
|
http://www.allegro.cc/forums/thread/589424 It's attached to that thread. =-----===-----===-----= |
Andrei Ellman
Member #3,434
April 2003
|
Matthew Dalrymple said: Well then why when I ctrl alt delete does my game crash when I call rest, but when I call sleep it works flawlessly? What version of Allegro are you using? In the Windows version of 4.2.0, there's a bug that causes the program to crash when CTRL+ALT+DEL is pressed. This has been fixed in 4.2.1 AE. -- |
|
1
2
|