#include <tscope.h>
int main()
{
ts_doublebuff(ON);
ts_init();
ts_bgcolor(BLUE);
ts_tobuff();
ts_fgcolor(GREEN);
ts_fill(TRUE);
ts_circle(0, 0, 100);
ts_floodfill(0, 0);
ts_toscr();
ts_fgcolor(WHITE);
ts_printf_centre(0, 105, "double buffer example");
ts_printf_centre(0, 75, "at this moment, the double buffer");
ts_printf_centre(0, 60, "contains a circle");
ts_printf_centre(0, 30, "we don't see anything yet");
ts_button(XMAX - 20, -YMAX + 20);
ts_blitbuff();
ts_printf_centre(0, 105, "now we blit the double buffer");
ts_printf_centre(0, 90, "to the screen");
ts_button(XMAX - 20, -YMAX + 20);
ts_clrbuff();
ts_printf_centre(0, 60, "when we clear the double buffer");
ts_printf_centre(0, 45, "the screen image remains");
ts_button(XMAX - 20, -YMAX + 20);
ts_blitbuff();
ts_printf_centre(0, 105, "if we blit the buffer again");
ts_printf_centre(0, 90, "we can see that it's empty");
ts_button(XMAX - 20, -YMAX + 20);
return 0;
}
END_OF_MAIN();