Changeset 217
- Timestamp:
- Nov 24, 2003, 8:56:04 PM (17 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/configure.ac
r207 r217 71 71 AM_CONDITIONAL(NEED_PIC, ${NEED_PIC}) 72 72 73 # Build cacaview? 74 AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no) 75 AM_CONDITIONAL(IMLIB2_CONFIG, test "${IMLIB2_CONFIG}" != "no") 76 73 77 # Build documentation? 74 78 AC_PATH_PROG(DOXYGEN, doxygen, no) -
libcaca/trunk/examples/Makefile.am
r215 r217 14 14 endif 15 15 16 bin_PROGRAMS = cacademo caca-spritedit cacaview16 bin_PROGRAMS = cacademo caca-spritedit $(cacaview) 17 17 18 18 cacademo_SOURCES = demo.c … … 24 24 caca_spritedit_CPPFLAGS = -I$(top_srcdir)/src 25 25 26 if IMLIB2_CONFIG 27 cacaview = cacaview 26 28 cacaview_SOURCES = view.c 27 cacaview_LDADD = ../src/libcaca.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) -lm29 cacaview_LDADD = ../src/libcaca.a $(LDFLAGS_slang) $(LDFLAGS_ncurses) 28 30 cacaview_CPPFLAGS = -I$(top_srcdir)/src 29 31 cacaview_CFLAGS = `imlib2-config --cflags` 30 32 cacaview_LDFLAGS = `imlib2-config --libs` 33 endif 34 -
libcaca/trunk/examples/demo.c
r213 r217 28 28 #include <stdio.h> 29 29 30 #if 031 #include <gdk/gdk.h>32 #include <gdk/gdkpixbuf.h>33 #endif34 35 30 #include "caca.h" 36 31 … … 46 41 static void demo_triangles(void); 47 42 static void demo_sprites(void); 48 #if 049 static void demo_blit(void);50 #endif51 43 52 44 int bounds = 0; … … 55 47 struct caca_sprite *sprite = NULL; 56 48 57 #if 058 GdkPixbuf *pixbuf;59 char *pixels;60 int bufx, bufy, bufpitch;61 #endif62 63 49 int main(int argc, char **argv) 64 50 { … … 67 53 68 54 if(caca_init()) 69 {70 55 return 1; 71 }72 56 73 57 caca_set_delay(40000); … … 79 63 if(!sprite) 80 64 sprite = caca_load_sprite("examples/caca.txt"); 81 82 #if 0 83 gdk_init (&argc, &argv); 84 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/gally4.jpeg", NULL); 85 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/badge1.jpeg", NULL); 86 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/union.png", NULL); 87 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/pikachu.jpeg", NULL); 88 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/gradient.png", NULL); 89 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/beastie.png", NULL); 90 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/stitch.jpg", NULL); 91 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/caca.jpg", NULL); 92 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/dranac.jpeg", NULL); 93 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/artwork/aboire.png", NULL); 94 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/web/sam.zoy.org/artwork/goret.png", NULL); 95 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/lilkim02.jpg", NULL); 96 //pixbuf = gdk_pixbuf_new_from_file("/home/sam/etw.bmp", NULL); 97 pixbuf = gdk_pixbuf_new_from_file("/home/sam/pix/lena_std.png", NULL); 98 if(!pixbuf) return -2; 99 pixels = gdk_pixbuf_get_pixels(pixbuf); 100 bufx = gdk_pixbuf_get_width(pixbuf); 101 bufy = gdk_pixbuf_get_height(pixbuf); 102 bufpitch = gdk_pixbuf_get_rowstride(pixbuf); 103 fprintf(stderr, "bits: %i\n", gdk_pixbuf_get_bits_per_sample(pixbuf)); 104 fprintf(stderr, "w %i, h %i, stride %i\n", bufx, bufy, bufpitch); 105 #endif 65 if(!sprite) 66 return 1; 106 67 107 68 /* Main menu */ … … 174 135 demo = demo_sprites; 175 136 break; 176 #if 0177 case 'i':178 case 'I':179 demo = demo_blit;180 break;181 #endif182 137 } 183 138 … … 243 198 caca_putstr(4, 13, "'s': sprites"); 244 199 caca_putstr(4, 14, "'c': color"); 245 #if 0246 caca_putstr(4, 15, "'i': image blit");247 #endif248 200 249 201 caca_putstr(4, 17, "settings:"); … … 503 455 } 504 456 505 #if 0506 static void demo_blit(void)507 {508 caca_blit(6, 4, caca_get_width() - 6, caca_get_height() - 4,509 pixels, bufx, bufy);510 }511 #endif512 -
libcaca/trunk/examples/view.c
r215 r217 35 35 struct caca_bitmap *bitmap = NULL; 36 36 37 int dithering = 0;37 int dithering = 1; 38 38 const enum caca_dithering dithering_list[] = 39 39 { CACA_DITHER_NONE, CACA_DITHER_ORDERED, CACA_DITHER_RANDOM }; … … 110 110 break; 111 111 case CACA_EVENT_KEY_PRESS | CACA_KEY_UP: 112 if(zoom > 0) y -= h / (2 + zoom) / 8;112 if(zoom > 0) y -= 1 + h / (2 + zoom) / 8; 113 113 update = 1; 114 114 break; 115 115 case CACA_EVENT_KEY_PRESS | CACA_KEY_DOWN: 116 if(zoom > 0) y += h / (2 + zoom) / 8;116 if(zoom > 0) y += 1 + h / (2 + zoom) / 8; 117 117 update = 1; 118 118 break; 119 119 case CACA_EVENT_KEY_PRESS | CACA_KEY_LEFT: 120 if(zoom > 0) x -= w / (2 + zoom) / 8;120 if(zoom > 0) x -= 1 + w / (2 + zoom) / 8; 121 121 update = 1; 122 122 break; 123 123 case CACA_EVENT_KEY_PRESS | CACA_KEY_RIGHT: 124 if(zoom > 0) x += w / (2 + zoom) / 8;124 if(zoom > 0) x += 1 + w / (2 + zoom) / 8; 125 125 update = 1; 126 126 break;
Note: See TracChangeset
for help on using the changeset viewer.