Tscope5
display02.c
////////////////////////////////////////////////////////////////////////////////
//
// __ ______
// / /_______________ ____ ___ / ____/
// / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
// / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
// \__/____/\___/\____/ .___/\___/ /_____/
// /_/
//
// display02.c
// - Open a windowed display.
// - Count back from 10 to 0:
// - Draw on a bitmap.
// - Then display the bitmap.
// - Wait for a click.
//
// - The visual output of this example is identical to display01.c.
// - This functionality is mainly useful if it takes a long time
// to draw your stimuli.
////////////////////////////////////////////////////////////////////////////////
#include <tscope5.h>
int main()
{
// open a display
// query the display size of the first display
double w, h;
// allocate a bitmap, same size as the display
TS5_BITMAP *map = ts5_alloc_bitmap(w, h);
int i;
for (i=10; i>=0; i--) {
// set the bitmap as the drawing target
// clear it
// and print the number on the bitmap
ts5_printf(0.0, 0.0, "%d", i);
// set the first display as the drawing target
// draw the bitmap
ts5_draw_bitmap(map, 0.0, 0.0);
ts5_wait(0.5);
}
// always free the objects you allocated!
// wait for a click
return 0;
}