Skip to content

refresh

Thomas Foster edited this page Mar 22, 2021 · 4 revisions

Function   Refresh screen and input buffers.

Syntaxvoid refresh(void);

Prototype in   dos.h

Return value   None.

Remarks

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.

Example

int main()
{
    while (1)
    {
        int mb = getmouse();
        if ( mb == BUTTON_LEFT )
        {
            clrscr();
            cprintf("mouse location: %d, %d", mousex(), mousey());
        }

        refresh();
    }
}

Header Files

Clone this wiki locally