/* * CS5600 University of Utah * Charles McGarvey * mcgarvey@eng.utah.edu */ #include #include "pixmap.h" #include "scene.h" /* * Read a scene file, construct the scene object, draw the scene to a pixmap, * and export the pixmap in PPM and BMP formats. */ int main(int argc, char* argv[]) { scene_t* scene = scene_alloc("scene.u2d"); if (scene == NULL) { fprintf(stderr, "An error prevented the scene from loading. Aborting!\n"); return 1; } pixmap_t* raster = scene_render(scene); scene_destroy(scene); pixmap_export_ppm(raster, "scene.ppm"); pixmap_export_bmp(raster, "scene.bmp"); pixmap_destroy(raster); #ifndef NDEBUG int _blocks = mem_blocks(); if (_blocks != 0) { fprintf(stderr, " *** Leaked %d blocks of memory! ***\n", _blocks); return 1; } #endif return 0; }