-
Notifications
You must be signed in to change notification settings - Fork 0
refresh
Thomas Foster edited this page Mar 22, 2021
·
4 revisions
Function Refresh screen and input buffers.
Syntax void refresh(void);
Prototype in dos.h
Return value None.
Call refresh to display any visual changes, such as text printed with cprintf, and to update the keyboard and mouse input buffers. Typically, refresh should be called once in your program loop.
refresh limits the speed of your program to 60 FPS as well as checks for and handles quit events, like the window's close button being pressed.
int main()
{
while (1)
{
int mb = getmouse();
if ( mb == BUTTON_LEFT )
{
clrscr();
cprintf("mouse location: %d, %d", mousex(), mousey());
}
refresh();
}
}