FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
gfx_sleep.c
Go to the documentation of this file.
1
/* sleep function */
2
3
#include "
fb_gfx.h
"
4
5
int
fb_hGfxInputBufferChanged
(
void
);
6
7
/*:::::*/
8
void
fb_GfxSleep
(
int
msecs )
9
{
10
/* infinite? wait until any key is pressed */
11
if
( msecs == -1 )
12
{
13
while
( !
fb_hGfxInputBufferChanged
( ) )
14
fb_Delay
( 50 );
15
return
;
16
}
17
18
/* if above n-mili-seconds, check for key input, otherwise,
19
don't screw the precision with slow console checks */
20
if
( msecs >= 100 )
21
while
( msecs > 50 )
22
{
23
if
(
fb_hGfxInputBufferChanged
( ) )
24
return
;
25
26
fb_Delay
( 50 );
27
msecs -= 50;
28
}
29
30
if
( msecs > 0 )
31
fb_Delay
( msecs );
32
33
}
gfxlib2
gfx_sleep.c
Generated on Thu Jan 23 2014 19:40:06 for FreeBASIC by
1.8.4