/*
          __
         / /_______________  ____  ___
        / __/ ___/ ___/ __ \/ __ \/ _ \
       / /_(__  ) /__/ /_/ / /_/ /  __/
       \__/____/\___/\____/ .___/\___/
                         /_/

    screen1.c
    usage of the screen parameters
*/

#include <tscope.h>

int main()
{

    // print some text (tscope is automatically opened)
    ts_printf_centre(0, 105, "The first call of a graphics function");
    ts_printf_centre(0, 90, "automatically opens Tscope");

    ts_printf_centre(0, 60, "By default, Tscope opens in a ");
    ts_printf_centre(0, 45, "small window on the desktop");

    ts_printf_centre(0, 15, "There are some parameter functions");
    ts_printf_centre(0, 0, "that change the screen parameters");

    ts_printf_centre(0, -30, "There functions have to be called");
    ts_printf_centre(0, -45, "before Tscope is automatically opened");
    ts_printf_centre(0, -60, "or before you explicitely open Tscope");
    ts_printf_centre(0, -75, "by calling ts_init();");

    // wait for a mouse click
    ts_button(XMAX - 20, -YMAX + 20);

    // change some graphics parameters
    ts_scrsize(SIZE2);
    ts_scrmode(FULLSCREEN);

    // print some more text
    ts_clrscr();

    ts_printf_centre(0, 105, "Once the graphics screen is opened");
    ts_printf_centre(0, 90, "the parameter functions will have");
    ts_printf_centre(0, 75, "no effect until you explicitly");
    ts_printf_centre(0, 60, "open Tscope again");

    ts_printf_centre(0, 30, "This program has called the functions");
    ts_printf_centre(0, 15, "ts_scrsize and ts_scrmode");
    ts_printf_centre(0, 0, "when Tscope was already opened");

    ts_printf_centre(0, -30, "the screen settings have");
    ts_printf_centre(0, -45, "not changed yet");

    ts_printf_centre(0, -75, "if we explicitely re-open tscope ...");

    // wait for a mouse click
    ts_button(XMAX - 20, -YMAX + 20);

    // re-open tscope
    ts_init();

    // text + click
    ts_printf_centre(0, 105, "the new settings are used");
    ts_button(XMAX - 20, -YMAX + 20);
    return 0;
}

END_OF_MAIN();


top
Persoonlijke pagina Universiteit GentTscope
Allegro | Cygwin | Gcc
© See license.html for copyright information