[86] | 1 | /* |
---|
| 2 | * demo demo using libee |
---|
| 3 | * Copyright (c) 2003 Sam Hocevar <sam@zoy.org> |
---|
| 4 | * All Rights Reserved |
---|
| 5 | * |
---|
| 6 | * $Id: demo.c 184 2003-11-16 00:09:09Z sam $ |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or modify |
---|
| 9 | * it under the terms of the GNU General Public License as published by |
---|
| 10 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 11 | * (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 21 | */ |
---|
| 22 | |
---|
[106] | 23 | #include "config.h" |
---|
| 24 | |
---|
[100] | 25 | #include <math.h> |
---|
| 26 | #include <string.h> |
---|
[160] | 27 | #include <stdio.h> |
---|
[100] | 28 | |
---|
[184] | 29 | #include <gdk/gdk.h> |
---|
| 30 | #include <gdk/gdkpixbuf.h> |
---|
| 31 | |
---|
[86] | 32 | #include "ee.h" |
---|
| 33 | |
---|
[100] | 34 | static void display_menu(void); |
---|
| 35 | |
---|
[124] | 36 | static void demo_all(void); |
---|
| 37 | |
---|
[160] | 38 | static void demo_color(void); |
---|
[100] | 39 | static void demo_dots(void); |
---|
| 40 | static void demo_lines(void); |
---|
[152] | 41 | static void demo_boxes(void); |
---|
[134] | 42 | static void demo_ellipses(void); |
---|
[108] | 43 | static void demo_triangles(void); |
---|
[118] | 44 | static void demo_sprites(void); |
---|
[184] | 45 | static void demo_blit(void); |
---|
[100] | 46 | |
---|
[182] | 47 | int bounds = 0; |
---|
[152] | 48 | int outline = 0; |
---|
[118] | 49 | struct ee_sprite *sprite = NULL; |
---|
[100] | 50 | |
---|
[184] | 51 | GdkPixbuf *pixbuf; |
---|
| 52 | char *pixels; |
---|
| 53 | int bufx, bufy, bufpitch; |
---|
| 54 | |
---|
[86] | 55 | int main(int argc, char **argv) |
---|
| 56 | { |
---|
[100] | 57 | void (*demo)(void) = NULL; |
---|
[86] | 58 | int quit = 0; |
---|
| 59 | |
---|
| 60 | if(ee_init()) |
---|
| 61 | { |
---|
| 62 | return 1; |
---|
| 63 | } |
---|
| 64 | |
---|
[178] | 65 | ee_set_delay(40000); |
---|
| 66 | |
---|
[118] | 67 | /* Initialize data */ |
---|
[164] | 68 | sprite = ee_load_sprite("data/barboss.txt"); |
---|
[118] | 69 | |
---|
[184] | 70 | gdk_init (&argc, &argv); |
---|
| 71 | //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/gally4.jpeg", NULL); |
---|
| 72 | //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/badge1.jpeg", NULL); |
---|
| 73 | //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/union.png", NULL); |
---|
| 74 | pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/pikachu.jpeg", NULL); |
---|
| 75 | if(!pixbuf) return -2; |
---|
| 76 | pixels = gdk_pixbuf_get_pixels(pixbuf); |
---|
| 77 | bufx = gdk_pixbuf_get_width(pixbuf); |
---|
| 78 | bufy = gdk_pixbuf_get_height(pixbuf); |
---|
| 79 | bufpitch = gdk_pixbuf_get_rowstride(pixbuf); |
---|
| 80 | fprintf(stderr, "bits: %i\n", gdk_pixbuf_get_bits_per_sample(pixbuf)); |
---|
| 81 | fprintf(stderr, "w %i, h %i, stride %i\n", bufx, bufy, bufpitch); |
---|
| 82 | |
---|
[118] | 83 | /* Main menu */ |
---|
[100] | 84 | display_menu(); |
---|
[182] | 85 | ee_refresh(); |
---|
[100] | 86 | |
---|
[86] | 87 | /* Go ! */ |
---|
| 88 | while(!quit) |
---|
| 89 | { |
---|
| 90 | char key = ee_get_key(); |
---|
[182] | 91 | |
---|
[100] | 92 | if(key && demo) |
---|
[86] | 93 | { |
---|
[100] | 94 | display_menu(); |
---|
[182] | 95 | ee_refresh(); |
---|
[100] | 96 | demo = NULL; |
---|
[86] | 97 | } |
---|
[100] | 98 | else if(key) |
---|
[94] | 99 | { |
---|
[182] | 100 | handle_key: |
---|
[100] | 101 | switch(key) |
---|
| 102 | { |
---|
| 103 | case 'q': |
---|
[182] | 104 | case 'Q': |
---|
[100] | 105 | demo = NULL; |
---|
| 106 | quit = 1; |
---|
| 107 | break; |
---|
[182] | 108 | case 'o': |
---|
| 109 | case 'O': |
---|
| 110 | outline = (outline + 1) % 3; |
---|
| 111 | display_menu(); |
---|
| 112 | break; |
---|
| 113 | case 'b': |
---|
| 114 | case 'B': |
---|
| 115 | bounds = (bounds + 1) % 2; |
---|
| 116 | display_menu(); |
---|
| 117 | break; |
---|
[160] | 118 | case 'c': |
---|
| 119 | demo = demo_color; |
---|
| 120 | break; |
---|
[182] | 121 | case 'f': |
---|
| 122 | case 'F': |
---|
[124] | 123 | demo = demo_all; |
---|
| 124 | break; |
---|
[100] | 125 | case '1': |
---|
| 126 | demo = demo_dots; |
---|
| 127 | break; |
---|
| 128 | case '2': |
---|
| 129 | demo = demo_lines; |
---|
| 130 | break; |
---|
| 131 | case '3': |
---|
[182] | 132 | demo = demo_boxes; |
---|
[100] | 133 | break; |
---|
| 134 | case '4': |
---|
[182] | 135 | demo = demo_triangles; |
---|
[104] | 136 | break; |
---|
| 137 | case '5': |
---|
[152] | 138 | demo = demo_ellipses; |
---|
[114] | 139 | break; |
---|
[182] | 140 | case 's': |
---|
| 141 | case 'S': |
---|
[118] | 142 | demo = demo_sprites; |
---|
| 143 | break; |
---|
[184] | 144 | case 'i': |
---|
| 145 | case 'I': |
---|
| 146 | demo = demo_blit; |
---|
| 147 | break; |
---|
[100] | 148 | } |
---|
[182] | 149 | |
---|
| 150 | if(demo) |
---|
| 151 | ee_clear(); |
---|
| 152 | |
---|
| 153 | key = ee_get_key(); |
---|
| 154 | if(key) |
---|
| 155 | goto handle_key; |
---|
| 156 | |
---|
| 157 | ee_refresh(); |
---|
[94] | 158 | } |
---|
| 159 | |
---|
[100] | 160 | if(demo) |
---|
[182] | 161 | { |
---|
[100] | 162 | demo(); |
---|
[182] | 163 | |
---|
| 164 | ee_set_color(EE_WHITE); |
---|
| 165 | ee_draw_thin_box(1, 1, ee_get_width() - 2, ee_get_height() - 2); |
---|
| 166 | ee_printf(4, 1, "[%i.%i fps]----", |
---|
| 167 | 1000000 / ee_get_rendertime(), |
---|
| 168 | (10000000 / ee_get_rendertime()) % 10); |
---|
| 169 | ee_refresh(); |
---|
| 170 | } |
---|
[86] | 171 | } |
---|
| 172 | |
---|
| 173 | /* Clean up */ |
---|
[118] | 174 | ee_free_sprite(sprite); |
---|
[86] | 175 | ee_end(); |
---|
| 176 | |
---|
| 177 | return 0; |
---|
| 178 | } |
---|
| 179 | |
---|
[100] | 180 | static void display_menu(void) |
---|
| 181 | { |
---|
| 182 | int xo = ee_get_width() - 2; |
---|
| 183 | int yo = ee_get_height() - 2; |
---|
| 184 | |
---|
| 185 | ee_clear(); |
---|
[154] | 186 | ee_set_color(EE_WHITE); |
---|
[160] | 187 | ee_draw_thin_box(1, 1, xo, yo); |
---|
[100] | 188 | |
---|
[148] | 189 | ee_putstr((xo - strlen("libee demo")) / 2, 3, "libee demo"); |
---|
| 190 | ee_putstr((xo - strlen("============")) / 2, 4, "============"); |
---|
[100] | 191 | |
---|
[182] | 192 | ee_putstr(4, 6, "demos:"); |
---|
| 193 | ee_putstr(4, 7, "'f': full"); |
---|
| 194 | ee_putstr(4, 8, "'1': dots"); |
---|
| 195 | ee_putstr(4, 9, "'2': lines"); |
---|
| 196 | ee_putstr(4, 10, "'3': boxes"); |
---|
| 197 | ee_putstr(4, 11, "'4': triangles"); |
---|
| 198 | ee_putstr(4, 12, "'5': ellipses"); |
---|
| 199 | ee_putstr(4, 13, "'s': sprites"); |
---|
| 200 | ee_putstr(4, 14, "'c': color"); |
---|
[184] | 201 | ee_putstr(4, 15, "'i': image blit"); |
---|
[100] | 202 | |
---|
[184] | 203 | ee_putstr(4, 17, "settings:"); |
---|
| 204 | ee_printf(4, 18, "'o': outline: %s", |
---|
[182] | 205 | outline == 0 ? "none" : outline == 1 ? "solid" : "thin"); |
---|
[184] | 206 | ee_printf(4, 19, "'b': drawing boundaries: %s", |
---|
[182] | 207 | bounds == 0 ? "screen" : "infinite"); |
---|
[100] | 208 | |
---|
[182] | 209 | ee_putstr(4, yo - 2, "'q': quit"); |
---|
[100] | 210 | } |
---|
| 211 | |
---|
[124] | 212 | static void demo_all(void) |
---|
| 213 | { |
---|
| 214 | static int i = 0; |
---|
| 215 | |
---|
[160] | 216 | int j, xo, yo, xa, ya, xb, yb, xc, yc; |
---|
[124] | 217 | |
---|
| 218 | i++; |
---|
| 219 | |
---|
| 220 | ee_clear(); |
---|
| 221 | |
---|
| 222 | /* Draw the sun */ |
---|
[154] | 223 | ee_set_color(EE_YELLOW); |
---|
[124] | 224 | xo = ee_get_width() / 4; |
---|
| 225 | yo = ee_get_height() / 4 + 5 * sin(0.03*i); |
---|
| 226 | |
---|
| 227 | for(j = 0; j < 16; j++) |
---|
| 228 | { |
---|
[160] | 229 | xa = xo - (30 + sin(0.03*i) * 8) * sin(0.03*i + M_PI*j/8); |
---|
| 230 | ya = yo + (15 + sin(0.03*i) * 4) * cos(0.03*i + M_PI*j/8); |
---|
| 231 | ee_draw_thin_line(xo, yo, xa, ya); |
---|
[124] | 232 | } |
---|
| 233 | |
---|
[152] | 234 | j = 15 + sin(0.03*i) * 8; |
---|
[154] | 235 | ee_set_color(EE_WHITE); |
---|
[152] | 236 | ee_fill_ellipse(xo, yo, j, j / 2, '#'); |
---|
[154] | 237 | ee_set_color(EE_YELLOW); |
---|
[152] | 238 | ee_draw_ellipse(xo, yo, j, j / 2, '#'); |
---|
[124] | 239 | |
---|
| 240 | /* Draw the pyramid */ |
---|
| 241 | xo = ee_get_width() * 5 / 8; |
---|
| 242 | yo = 2; |
---|
| 243 | |
---|
[160] | 244 | xa = ee_get_width() / 8 + sin(0.03*i) * 5; |
---|
| 245 | ya = ee_get_height() / 2 + cos(0.03*i) * 5; |
---|
[124] | 246 | |
---|
[160] | 247 | xb = ee_get_width() - 10 - cos(0.02*i) * 10; |
---|
| 248 | yb = ee_get_height() * 3 / 4 - 5 + sin(0.02*i) * 5; |
---|
[124] | 249 | |
---|
[160] | 250 | xc = ee_get_width() / 4 - sin(0.02*i) * 5; |
---|
| 251 | yc = ee_get_height() * 3 / 4 + cos(0.02*i) * 5; |
---|
[124] | 252 | |
---|
[154] | 253 | ee_set_color(EE_GREEN); |
---|
[160] | 254 | ee_fill_triangle(xo, yo, xb, yb, xa, ya, '%'); |
---|
[154] | 255 | ee_set_color(EE_YELLOW); |
---|
[160] | 256 | ee_draw_thin_triangle(xo, yo, xb, yb, xa, ya); |
---|
[124] | 257 | |
---|
[154] | 258 | ee_set_color(EE_RED); |
---|
[160] | 259 | ee_fill_triangle(xa, ya, xb, yb, xc, yc, '#'); |
---|
[154] | 260 | ee_set_color(EE_YELLOW); |
---|
[160] | 261 | ee_draw_thin_triangle(xa, ya, xb, yb, xc, yc); |
---|
[124] | 262 | |
---|
[154] | 263 | ee_set_color(EE_BLUE); |
---|
[160] | 264 | ee_fill_triangle(xo, yo, xb, yb, xc, yc, '%'); |
---|
[154] | 265 | ee_set_color(EE_YELLOW); |
---|
[160] | 266 | ee_draw_thin_triangle(xo, yo, xb, yb, xc, yc); |
---|
[124] | 267 | |
---|
| 268 | /* Draw a background triangle */ |
---|
[160] | 269 | xa = 2; |
---|
| 270 | ya = 2; |
---|
[124] | 271 | |
---|
[160] | 272 | xb = ee_get_width() - 3; |
---|
| 273 | yb = ee_get_height() / 2; |
---|
[124] | 274 | |
---|
[160] | 275 | xc = ee_get_width() / 3; |
---|
| 276 | yc = ee_get_height() - 3; |
---|
[124] | 277 | |
---|
[154] | 278 | ee_set_color(EE_CYAN); |
---|
[160] | 279 | ee_draw_thin_triangle(xa, ya, xb, yb, xc, yc); |
---|
[124] | 280 | |
---|
| 281 | xo = ee_get_width() / 2 + cos(0.027*i) * ee_get_width() / 3; |
---|
| 282 | yo = ee_get_height() / 2 - sin(0.027*i) * ee_get_height() / 2; |
---|
| 283 | |
---|
[160] | 284 | ee_draw_thin_line(xa, ya, xo, yo); |
---|
| 285 | ee_draw_thin_line(xb, yb, xo, yo); |
---|
| 286 | ee_draw_thin_line(xc, yc, xo, yo); |
---|
[124] | 287 | |
---|
[152] | 288 | /* Draw a sprite on the pyramid */ |
---|
[154] | 289 | ee_draw_sprite(xo, yo, sprite, 0); |
---|
[124] | 290 | |
---|
| 291 | /* Draw a trail behind the foreground sprite */ |
---|
| 292 | for(j = i - 60; j < i; j++) |
---|
| 293 | { |
---|
| 294 | int delta = ee_rand(-5, 5); |
---|
[160] | 295 | ee_set_color(ee_rand(0, 15)); |
---|
[148] | 296 | ee_putchar(ee_get_width() / 2 |
---|
| 297 | + cos(0.02*j) * (delta + ee_get_width() / 4), |
---|
| 298 | ee_get_height() / 2 |
---|
| 299 | + sin(0.02*j) * (delta + ee_get_height() / 3), |
---|
| 300 | '#'); |
---|
[124] | 301 | } |
---|
| 302 | |
---|
| 303 | /* Draw foreground sprite */ |
---|
| 304 | ee_draw_sprite(ee_get_width() / 2 + cos(0.02*i) * ee_get_width() / 4, |
---|
| 305 | ee_get_height() / 2 + sin(0.02*i) * ee_get_height() / 3, |
---|
[154] | 306 | sprite, 0); |
---|
[124] | 307 | } |
---|
| 308 | |
---|
[100] | 309 | static void demo_dots(void) |
---|
| 310 | { |
---|
[104] | 311 | int xmax = ee_get_width() - 1; |
---|
| 312 | int ymax = ee_get_height() - 1; |
---|
[100] | 313 | int i; |
---|
| 314 | |
---|
[104] | 315 | for(i = 1000; i--;) |
---|
[100] | 316 | { |
---|
| 317 | /* Putpixel */ |
---|
[160] | 318 | ee_set_color(ee_rand(0, 15)); |
---|
[148] | 319 | ee_putchar(ee_rand(0, xmax), ee_rand(0, ymax), '#'); |
---|
[100] | 320 | } |
---|
| 321 | } |
---|
| 322 | |
---|
[160] | 323 | static void demo_color(void) |
---|
| 324 | { |
---|
| 325 | int i; |
---|
| 326 | char buf[BUFSIZ]; |
---|
| 327 | |
---|
| 328 | ee_clear(); |
---|
| 329 | for(i = 0; i < 16; i++) |
---|
| 330 | { |
---|
[182] | 331 | sprintf(buf, "'%c': %i (%s)", 'a' + i, i, ee_get_color_name(i)); |
---|
[160] | 332 | ee_set_color(EE_WHITE); |
---|
| 333 | ee_putstr(4, i + 3, buf); |
---|
| 334 | ee_set_color(i); |
---|
| 335 | ee_putstr(40, i + 3, "XXXXXXXXXX-XX--X----------"); |
---|
| 336 | } |
---|
| 337 | } |
---|
| 338 | |
---|
[100] | 339 | static void demo_lines(void) |
---|
| 340 | { |
---|
[104] | 341 | int w = ee_get_width(); |
---|
| 342 | int h = ee_get_height(); |
---|
[160] | 343 | int xa, ya, xb, yb; |
---|
[104] | 344 | |
---|
[182] | 345 | if(bounds) |
---|
[100] | 346 | { |
---|
[160] | 347 | xa = ee_rand(- w, 2 * w); ya = ee_rand(- h, 2 * h); |
---|
| 348 | xb = ee_rand(- w, 2 * w); yb = ee_rand(- h, 2 * h); |
---|
[100] | 349 | } |
---|
| 350 | else |
---|
| 351 | { |
---|
[160] | 352 | xa = ee_rand(0, w - 1); ya = ee_rand(0, h - 1); |
---|
| 353 | xb = ee_rand(0, w - 1); yb = ee_rand(0, h - 1); |
---|
[100] | 354 | } |
---|
| 355 | |
---|
[160] | 356 | ee_set_color(ee_rand(0, 15)); |
---|
[182] | 357 | if(outline > 1) |
---|
[160] | 358 | ee_draw_thin_line(xa, ya, xb, yb); |
---|
[104] | 359 | else |
---|
[160] | 360 | ee_draw_line(xa, ya, xb, yb, '#'); |
---|
[104] | 361 | } |
---|
| 362 | |
---|
[152] | 363 | static void demo_boxes(void) |
---|
[100] | 364 | { |
---|
[104] | 365 | int w = ee_get_width(); |
---|
| 366 | int h = ee_get_height(); |
---|
[160] | 367 | int xa, ya, xb, yb; |
---|
[104] | 368 | |
---|
[182] | 369 | if(bounds) |
---|
[100] | 370 | { |
---|
[160] | 371 | xa = ee_rand(- w, 2 * w); ya = ee_rand(- h, 2 * h); |
---|
| 372 | xb = ee_rand(- w, 2 * w); yb = ee_rand(- h, 2 * h); |
---|
[100] | 373 | } |
---|
| 374 | else |
---|
| 375 | { |
---|
[160] | 376 | xa = ee_rand(0, w - 1); ya = ee_rand(0, h - 1); |
---|
| 377 | xb = ee_rand(0, w - 1); yb = ee_rand(0, h - 1); |
---|
[152] | 378 | } |
---|
[100] | 379 | |
---|
[160] | 380 | ee_set_color(ee_rand(0, 15)); |
---|
| 381 | ee_fill_box(xa, ya, xb, yb, '#'); |
---|
[100] | 382 | |
---|
[182] | 383 | ee_set_color(ee_rand(0, 15)); |
---|
| 384 | if(outline == 2) |
---|
[160] | 385 | ee_draw_thin_box(xa, ya, xb, yb); |
---|
[182] | 386 | else if(outline == 1) |
---|
| 387 | ee_draw_box(xa, ya, xb, yb, '#'); |
---|
[100] | 388 | } |
---|
| 389 | |
---|
[134] | 390 | static void demo_ellipses(void) |
---|
| 391 | { |
---|
| 392 | int w = ee_get_width(); |
---|
| 393 | int h = ee_get_height(); |
---|
[152] | 394 | int x, y, a, b; |
---|
[134] | 395 | |
---|
[182] | 396 | if(bounds) |
---|
[134] | 397 | { |
---|
[152] | 398 | x = ee_rand(- w, 2 * w); y = ee_rand(- h, 2 * h); |
---|
| 399 | a = ee_rand(0, w); b = ee_rand(0, h); |
---|
[134] | 400 | } |
---|
| 401 | else |
---|
| 402 | { |
---|
[152] | 403 | do |
---|
[134] | 404 | { |
---|
[152] | 405 | x = ee_rand(0, w); y = ee_rand(0, h); |
---|
| 406 | a = ee_rand(0, w); b = ee_rand(0, h); |
---|
[134] | 407 | |
---|
[152] | 408 | } while(x - a < 0 || x + a >= w || y - b < 0 || y + b >= h); |
---|
[134] | 409 | } |
---|
| 410 | |
---|
[160] | 411 | ee_set_color(ee_rand(0, 15)); |
---|
[152] | 412 | ee_fill_ellipse(x, y, a, b, '#'); |
---|
[134] | 413 | |
---|
[182] | 414 | ee_set_color(ee_rand(0, 15)); |
---|
| 415 | if(outline == 2) |
---|
[152] | 416 | ee_draw_thin_ellipse(x, y, a, b); |
---|
[182] | 417 | else if(outline == 1) |
---|
| 418 | ee_draw_ellipse(x, y, a, b, '#'); |
---|
[108] | 419 | } |
---|
| 420 | |
---|
[152] | 421 | static void demo_triangles(void) |
---|
[114] | 422 | { |
---|
| 423 | int w = ee_get_width(); |
---|
| 424 | int h = ee_get_height(); |
---|
[160] | 425 | int xa, ya, xb, yb, xc, yc; |
---|
[114] | 426 | |
---|
[182] | 427 | if(bounds) |
---|
[114] | 428 | { |
---|
[160] | 429 | xa = ee_rand(- w, 2 * w); ya = ee_rand(- h, 2 * h); |
---|
| 430 | xb = ee_rand(- w, 2 * w); yb = ee_rand(- h, 2 * h); |
---|
| 431 | xc = ee_rand(- w, 2 * w); yc = ee_rand(- h, 2 * h); |
---|
[114] | 432 | } |
---|
| 433 | else |
---|
| 434 | { |
---|
| 435 | |
---|
[160] | 436 | xa = ee_rand(0, w - 1); ya = ee_rand(0, h - 1); |
---|
| 437 | xb = ee_rand(0, w - 1); yb = ee_rand(0, h - 1); |
---|
| 438 | xc = ee_rand(0, w - 1); yc = ee_rand(0, h - 1); |
---|
[124] | 439 | } |
---|
[114] | 440 | |
---|
[160] | 441 | ee_set_color(ee_rand(0, 15)); |
---|
| 442 | ee_fill_triangle(xa, ya, xb, yb, xc, yc, '#'); |
---|
[114] | 443 | |
---|
[182] | 444 | ee_set_color(ee_rand(0, 15)); |
---|
| 445 | if(outline == 2) |
---|
[160] | 446 | ee_draw_thin_triangle(xa, ya, xb, yb, xc, yc); |
---|
[182] | 447 | else if(outline == 1) |
---|
| 448 | ee_draw_triangle(xa, ya, xb, yb, xc, yc, '#'); |
---|
[114] | 449 | } |
---|
| 450 | |
---|
[118] | 451 | static void demo_sprites(void) |
---|
| 452 | { |
---|
[124] | 453 | ee_draw_sprite(ee_rand(0, ee_get_width() - 1), |
---|
[154] | 454 | ee_rand(0, ee_get_height() - 1), sprite, 0); |
---|
[118] | 455 | } |
---|
| 456 | |
---|
[184] | 457 | static void demo_blit(void) |
---|
| 458 | { |
---|
| 459 | ee_set_color(EE_LIGHTGRAY); |
---|
| 460 | ee_blit(6, 4, ee_get_width() - 6, ee_get_height() - 4, pixels, bufx, bufy); |
---|
| 461 | } |
---|
| 462 | |
---|