Tscope5
Main Page
Related Pages
Files
Examples
display03.c
////////////////////////////////////////////////////////////////////////////////
//
// __ ______
// / /_______________ ____ ___ / ____/
// / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
// / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
// \__/____/\___/\____/ .___/\___/ /_____/
// /_/
//
// display03.c
// - Open two windowed displays.
// - Count back from 10 to 0 (alternate between the displays).
// - Wait for a click.
////////////////////////////////////////////////////////////////////////////////
#include <tscope5.h>
int
main()
{
// we need to know the size of the display adapter
// to position the displays properly
double
w =
ts5_get_display_adapter_width
(1);
// open a first display
// in the centre of the left half of the display
ts5_set_display_position
(-w/4.0, 0.0);
ts5_install_display
();
// open a second display
// in the centre of the right half of the display
ts5_set_display_position
(w/4.0, 0.0);
ts5_install_display
();
int
i;
for
(i=10; i>=0; i--) {
// switch the active display
// (use the modulo opeartor)
ts5_set_active_display
(i%2 + 1);
// print the number
ts5_printf
(0.0, 0.0,
"%d"
, i);
ts5_flip_display
();
ts5_wait
(0.5);
// remove the number
ts5_clear_display
();
ts5_flip_display
();
}
// wait for a click
ts5_draw_mouse_button
(0.0,0.0);
return
0;
}