Tscope5
Main Page
Related Pages
Files
Examples
bitmaps5.c
prepare stimuli using memory bitmaps
#include <tscope5.h>
int
main()
{
ts5_install_display
();
double
w, h;
ts5_get_display_size
(1, &w, &h);
TS5_BITMAP *map1 =
ts5_alloc_bitmap
(w, h);
TS5_BITMAP *map2 =
ts5_alloc_bitmap
(w, h);
TS5_BITMAP *map3 =
ts5_alloc_bitmap
(w, h);
double
i;
for
(i=0; i<400; i+=3) {
ts5_set_drawing_target
(map1);
ts5_draw_circle
(0.0, 0.0, i);
ts5_set_drawing_target
(map2);
ts5_draw_circle
(0.0, 0.0, i+1.0);
ts5_set_drawing_target
(map3);
ts5_draw_circle
(0.0, 0.0, i+2.0);
}
ts5_set_active_display
(1);
for
(i=0; i<100; i++) {
ts5_clear_display
();
ts5_draw_bitmap
(map1, 0.0, 0.0);
ts5_flip_display
();
ts5_wait
(0.02);
ts5_clear_display
();
ts5_draw_bitmap
(map2, 0.0, 0.0);
ts5_flip_display
();
ts5_wait
(0.02);
ts5_clear_display
();
ts5_draw_bitmap
(map3, 0.0, 0.0);
ts5_flip_display
();
ts5_wait
(0.02);
}
ts5_draw_mouse_button
(w/2.0-50.0, -h/2.0+50.0);
ts5_free_bitmap
(map1);
ts5_free_bitmap
(map2);
return
0;
}