behaviour.tags/v0.99.beta14
@@ -48,8 +48,8 @@ int main(void) | |||||
/* Initialise libcaca */ | /* Initialise libcaca */ | ||||
cucul_canvas_t *cv; | cucul_canvas_t *cv; | ||||
caca_display_t *dp; | caca_display_t *dp; | ||||
cv = cucul_create_canvas(0, 0); | |||||
dp = caca_create_display(cv); | dp = caca_create_display(cv); | ||||
cv = caca_get_canvas(dp); | |||||
/* Set window title */ | /* Set window title */ | ||||
caca_set_display_title(dp, "Window"); | caca_set_display_title(dp, "Window"); | ||||
/* Choose drawing colours */ | /* Choose drawing colours */ | ||||
@@ -64,7 +64,6 @@ int main(void) | |||||
NULL, -1); | NULL, -1); | ||||
/* Clean up library */ | /* Clean up library */ | ||||
caca_free_display(dp); | caca_free_display(dp); | ||||
cucul_free_canvas(cv); | |||||
return 0; | return 0; | ||||
} | } | ||||
@@ -20,10 +20,9 @@ int main(void) | |||||
{ | { | ||||
/* Initialise libcaca */ | /* Initialise libcaca */ | ||||
cucul_canvas_t *cv; caca_display_t *dp; caca_event_t ev; | cucul_canvas_t *cv; caca_display_t *dp; caca_event_t ev; | ||||
cv = cucul_create_canvas(0, 0); | |||||
if(!cv) return 1; | |||||
dp = caca_create_display(cv); | |||||
dp = caca_create_display(NULL); | |||||
if(!dp) return 1; | if(!dp) return 1; | ||||
cv = caca_get_canvas(dp); | |||||
/* Set window title */ | /* Set window title */ | ||||
caca_set_display_title(dp, "Hello!"); | caca_set_display_title(dp, "Hello!"); | ||||
/* Choose drawing colours */ | /* Choose drawing colours */ | ||||
@@ -36,7 +35,6 @@ int main(void) | |||||
caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1); | caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1); | ||||
/* Clean up library */ | /* Clean up library */ | ||||
caca_free_display(dp); | caca_free_display(dp); | ||||
cucul_free_canvas(cv); | |||||
return 0; | return 0; | ||||
} | } | ||||
@@ -29,25 +29,21 @@ uint32_t buffer[256*256]; | |||||
int main(int argc, char *argv[]) | int main(int argc, char *argv[]) | ||||
{ | { | ||||
cucul_canvas_t *cv; | |||||
caca_display_t *dp; | caca_display_t *dp; | ||||
cucul_canvas_t *cv; | |||||
cucul_dither_t *dither; | cucul_dither_t *dither; | ||||
int x, y; | int x, y; | ||||
cv = cucul_create_canvas(0, 0); | |||||
if(cv == NULL) | |||||
{ | |||||
printf("Can't created canvas\n"); | |||||
return -1; | |||||
} | |||||
dp = caca_create_display(cv); | |||||
dp = caca_create_display(NULL); | |||||
if(dp == NULL) | if(dp == NULL) | ||||
{ | { | ||||
printf("Can't create display\n"); | printf("Can't create display\n"); | ||||
return -1; | return -1; | ||||
} | } | ||||
cv = caca_get_canvas(dp); | |||||
for(y = 0; y < 256; y++) | for(y = 0; y < 256; y++) | ||||
for(x = 0; x < 256; x++) | for(x = 0; x < 256; x++) | ||||
{ | { | ||||
@@ -56,7 +52,7 @@ int main(int argc, char *argv[]) | |||||
dither = cucul_create_dither(32, 256, 256, 4 * 256, | dither = cucul_create_dither(32, 256, 256, 4 * 256, | ||||
0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | 0x00ff0000, 0x0000ff00, 0x000000ff, 0x0); | ||||
cucul_dither_bitmap(cv, 0, 0, cucul_get_canvas_width(cv), | |||||
cucul_dither_bitmap(caca_get_canvas(dp), 0, 0, cucul_get_canvas_width(cv), | |||||
cucul_get_canvas_height(cv), dither, buffer); | cucul_get_canvas_height(cv), dither, buffer); | ||||
cucul_free_dither(dither); | cucul_free_dither(dither); | ||||
@@ -65,7 +61,6 @@ int main(int argc, char *argv[]) | |||||
caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); | caca_get_event(dp, CACA_EVENT_KEY_PRESS, NULL, -1); | ||||
caca_free_display(dp); | caca_free_display(dp); | ||||
cucul_free_canvas(cv); | |||||
return 0; | return 0; | ||||
} | } | ||||