ctypes pointer narf working now

This commit is contained in:
jaseg 2014-02-17 00:57:47 +01:00
parent a1c175138d
commit 18fd12e916
5 changed files with 58 additions and 23 deletions

View file

@ -20,6 +20,7 @@
void free_framebuffer(framebuffer_t *fb){
printf("Freeing %lx and %lx\n", fb->data, fb);
free(fb->data);
free(fb);
}
@ -78,6 +79,7 @@ framebuffer_t *framebuffer_render_text(char *s, glyphtable_t *glyph_table){
if(g->height > gbufheight)
gbufheight = g->height;
gbufwidth += g->width;
}
/* For easier rendering on the terminal, round up to multiples of two */
@ -301,6 +303,7 @@ framebuffer_t *framebuffer_render_text(char *s, glyphtable_t *glyph_table){
fb->w = gbufwidth;
fb->h = gbufheight;
fb->data = gbuf;
printf("Returning buffer with w %ld h %ld memory location %lx\n", gbufwidth, gbufheight, gbuf);
return fb;
error:
free(gbuf);
@ -354,5 +357,6 @@ void console_render_buffer(framebuffer_t *fb){
}
printf("\n");
}
printf("\033[0m");
}