C Language Development Kit/Functions/LoadDisplay

From OptiWiki

Jump to: navigation, search
Description Restores the pixels of a screen display that were previously stored in a file. This function is useful when implementing help

screens after which the original screen must be restored.

Syntax
int loaddisplay(char * filename);
Arguments
char * filename
Points to a string containing the name of a file into which a screen display was stored previously with

savedisplay().

Returns
OK loaddisplay() opened the file and loaded the contents into the screen display.
ERROR loaddisplay() could not open the file.
Remarks The settings of the font, cursor and contrast from the orginal screen are also restored.
Example
#include "lib.h"
#include <stdio.h>
 
void main( void )
{
    int turn;
 
    printf("\fThis is screen\nnumber ONE.");
    savedisplay("screen1.dat");
    delay( 100 );
    printf("\fThis is screen\nnumber TWO.");
    savedisplay("screen2.dat");
 
    turn = 1;
    for(;;)
    {
        resetkey();
        while( !kbhit())
            idle();
        if( turn == 1)
        {
            loaddisplay("screen1.dat");
            turn = 2;
        }
        else
        {
            loaddisplay("screen2.dat");
            turn = 1;
        }
    }
}


Views
Personal tools