started implementing intersection functions and the main renderer data
[cyberay] / src / image.c
1 #include <imago2.h>
2 #include "image.h"
3
4 int load_image(struct image *img, const char *fname)
5 {
6         if(!(img->pixels = img_load_pixels(fname, &img->width, &img->height, IMG_FMT_RGBF))) {
7                 fprintf(stderr, "load_image: failed to load %s\n", fname);
8                 return -1;
9         }
10         return 0;
11 }
12
13 void destroy_image(struct image *img)
14 {
15         img_free_pixels(img->pixels);
16         img->pixels = 0;
17 }