Tscope5
display06.c
////////////////////////////////////////////////////////////////////////////////
//
// __ ______
// / /_______________ ____ ___ / ____/
// / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
// / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
// \__/____/\___/\____/ .___/\___/ /_____/
// /_/
//
// display06.c
// - Multiplexing example.
////////////////////////////////////////////////////////////////////////////////
#include <tscope5.h>
#include <allegro5/allegro_color.h>
#include <allegro5/allegro_primitives.h>
#include <math.h>
int main()
{
ts5_set_coordinate_system(TS5_DISPLAY_COORDINATES);
// open a first display with multisampling
ts5_set_multisampling(TS5_MULTISAMPLING_ON);
ts5_draw_pixel(50.0, 50.0);
ts5_draw_line(0.0, 0.0, 200.0, 100.0);
ts5_draw_rectangle(0.0, 0.0, 300.0, 100.0);
ts5_draw_rounded_rectangle(0.0, 0.0, 400.0, 300.0, 50.0, 50.0);
ts5_draw_triangle(0.0, 0.0, 0.0, 320.0, 640.0, 0.0);
ts5_draw_circle(400.0, 400.0, 100.0);
ts5_draw_ellipse(400.0, 400.0, 100.0, 200.0);
ts5_draw_arc(200.0, 200.0, 300.0, 0.0, 90.0);
ts5_printf(200.0, 200.0, "Multisampling on");
// open a second display without multisampling
// in the centre of the right half of the display
ts5_set_multisampling(TS5_MULTISAMPLING_OFF);
ts5_draw_pixel(50.0, 50.0);
ts5_draw_line(0.0, 0.0, 200.0, 100.0);
ts5_draw_rectangle(0.0, 0.0, 300.0, 100.0);
ts5_draw_rounded_rectangle(0.0, 0.0, 400.0, 300.0, 50.0, 50.0);
ts5_draw_triangle(0.0, 0.0, 0.0, 320.0, 640.0, 0.0);
ts5_draw_circle(400.0, 400.0, 100.0);
ts5_draw_ellipse(400.0, 400.0, 100.0, 200.0);
ts5_draw_arc(200.0, 200.0, 300.0, 0.0, 90.0);
ts5_printf(200.0, 200.0, "Multisampling off");
// wait for a click
ts5_draw_mouse_button(200.0, 200.0);
return 0;
}