- Timestamp:
- Nov 10, 2003, 1:27:33 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ttyvaders/trunk/test/demo.c
r108 r114 35 35 static void demo_circles(void); 36 36 static void demo_triangles(void); 37 static void demo_outlined_triangles(void); 37 38 38 39 int clipping = 0; … … 87 88 demo = demo_triangles; 88 89 break; 90 case '6': 91 ee_clear(); 92 demo = demo_outlined_triangles; 93 break; 89 94 } 90 95 } … … 127 132 ee_goto(4, 10); 128 133 ee_putstr("5: triangles demo"); 134 ee_goto(4, 11); 135 ee_putstr("6: outlined triangles demo"); 129 136 130 137 ee_goto(4, yo - 2); … … 241 248 ee_rand(0, w - 1), ee_rand(0, h - 1), 242 249 ee_rand(0, w - 1), ee_rand(0, h - 1), '#'); 250 } 251 ee_refresh(); 252 } 253 254 static void demo_outlined_triangles(void) 255 { 256 int w = ee_get_width(); 257 int h = ee_get_height(); 258 259 /* Draw lines */ 260 ee_color(ee_rand(1, 10)); 261 if(clipping) 262 { 263 ee_fill_triangle(ee_rand(- w, 2 * w), ee_rand(- h, 2 * h), 264 ee_rand(- w, 2 * w), ee_rand(- h, 2 * h), 265 ee_rand(- w, 2 * w), ee_rand(- h, 2 * h), '#'); 266 } 267 else 268 { 269 int x1, y1, x2, y2, x3, y3; 270 271 x1 = ee_rand(0, w - 1); 272 y1 = ee_rand(0, h - 1); 273 x2 = ee_rand(0, w - 1); 274 y2 = ee_rand(0, h - 1); 275 x3 = ee_rand(0, w - 1); 276 y3 = ee_rand(0, h - 1); 277 278 ee_fill_triangle(x1, y1, x2, y2, x3, y3, '#'); 279 280 ee_color(ee_rand(1, 10)); 281 ee_draw_thin_line(x1, y1, x2, y2); 282 ee_draw_thin_line(x2, y2, x3, y3); 283 ee_draw_thin_line(x3, y3, x1, y1); 243 284 } 244 285 ee_refresh();
Note: See TracChangeset
for help on using the changeset viewer.