Changeset 117
- Timestamp:
- Nov 10, 2003, 3:00:19 AM (20 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/Makefile.am
r77 r117 4 4 5 5 SUBDIRS = libee test src 6 DIST_SUBDIRS = $(SUBDIRS) autotools d ebian6 DIST_SUBDIRS = $(SUBDIRS) autotools data debian 7 7 8 8 EXTRA_DIST = doc/shapes.txt bootstrap -
libcaca/trunk/configure.ac
r111 r117 43 43 src/Makefile 44 44 autotools/Makefile 45 data/Makefile 45 46 debian/Makefile 46 47 ]) -
libcaca/trunk/test/demo.c
r113 r117 36 36 static void demo_triangles(void); 37 37 static void demo_outlined_triangles(void); 38 static void demo_sprites(void); 38 39 39 40 int clipping = 0; 41 struct ee_sprite *sprite = NULL; 40 42 41 43 int main(int argc, char **argv) … … 49 51 } 50 52 53 /* Initialize data */ 54 sprite = ee_load_sprite("data/bar_boss"); 55 56 /* Main menu */ 51 57 display_menu(); 52 58 … … 92 98 demo = demo_outlined_triangles; 93 99 break; 100 case '7': 101 ee_clear(); 102 demo = demo_sprites; 103 break; 94 104 } 95 105 } … … 100 110 101 111 /* Clean up */ 112 ee_free_sprite(sprite); 102 113 ee_end(); 103 114 … … 134 145 ee_goto(4, 11); 135 146 ee_putstr("6: outlined triangles demo"); 147 ee_goto(4, 12); 148 ee_putstr("7: sprites demo"); 136 149 137 150 ee_goto(4, yo - 2); … … 286 299 } 287 300 301 static void demo_sprites(void) 302 { 303 static int i = 0; 304 305 int x1, y1, x2, y2, x3, y3; 306 307 i++; 308 309 x1 = 2; 310 y1 = 2; 311 312 x2 = ee_get_width() - 3; 313 y2 = ee_get_height() / 2; 314 315 x3 = ee_get_width() / 3; 316 y3 = ee_get_height() - 3; 317 318 ee_clear(); 319 320 /* Draw a sprite behind the triangle */ 321 ee_draw_sprite(ee_get_width() / 2 + cos(0.027*i) * 30, 322 ee_get_height() / 2 - sin(0.027*i) * 20, sprite); 323 324 /* Draw a background triangle */ 325 ee_color(EE_BLUE); 326 ee_fill_triangle(x1, y1, x2, y2, x3, y3, '.'); 327 ee_color(EE_CYAN); 328 ee_draw_thin_line(x1, y1, x3, y3); 329 ee_draw_thin_line(x2, y2, x1, y1); 330 ee_draw_thin_line(x3, y3, x2, y2); 331 332 /* Draw foreground sprite */ 333 ee_draw_sprite(ee_get_width() / 2 + cos(0.02*i) * 20, 334 ee_get_height() / 2 + sin(0.02*i) * 10, sprite); 335 336 ee_refresh(); 337 } 338 288 339 static void demo_pyramid(void) 289 340 {
Note: See TracChangeset
for help on using the changeset viewer.