2013-09-05 21:58:58 -07:00
|
|
|
/* charles.c
|
|
|
|
*
|
|
|
|
* Entry point for Charles, including main().
|
|
|
|
*
|
|
|
|
* Eryn Wells <eryn@erynwells.me>
|
|
|
|
*/
|
|
|
|
|
2013-09-09 22:48:52 -07:00
|
|
|
#include <cstdio>
|
2013-09-07 16:10:42 -07:00
|
|
|
|
2013-09-08 08:45:32 -07:00
|
|
|
#include "basics.h"
|
2013-09-07 16:10:42 -07:00
|
|
|
|
2013-09-09 22:51:55 -07:00
|
|
|
const char *OUT_FILE = "charles_out.png";
|
2013-09-07 16:10:42 -07:00
|
|
|
|
2013-09-05 21:58:58 -07:00
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc,
|
|
|
|
const char *argv[])
|
|
|
|
{
|
2013-09-09 22:48:52 -07:00
|
|
|
#if 0
|
2013-09-07 16:10:42 -07:00
|
|
|
FILE *out_file = fopen(OUT_FILE, "wb");
|
|
|
|
if (!out_file) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
Scene *scene = scene_init();
|
2013-09-08 20:46:22 -07:00
|
|
|
|
2013-09-08 08:45:32 -07:00
|
|
|
Object *obj = object_init(ObjectTypeSphere);
|
|
|
|
Texture *tex = texture_init();
|
|
|
|
Color color = {255, 0, 0, 255};
|
|
|
|
texture_set_color(tex, color);
|
2013-09-08 20:46:22 -07:00
|
|
|
object_set_texture(obj, tex);
|
2013-09-08 12:09:19 -07:00
|
|
|
Vector3 loc = {233, 290, 0};
|
|
|
|
object_set_location(obj, loc);
|
2013-09-08 20:46:22 -07:00
|
|
|
object_sphere_set_radius(obj, 100);
|
|
|
|
scene_add_object(scene, obj);
|
|
|
|
|
|
|
|
obj = object_init(ObjectTypeSphere);
|
|
|
|
tex = texture_init();
|
|
|
|
Color color2 = {0, 255, 0, 255};
|
|
|
|
texture_set_color(tex, color2);
|
2013-09-08 08:45:32 -07:00
|
|
|
object_set_texture(obj, tex);
|
2013-09-08 20:46:22 -07:00
|
|
|
loc = vector_init(407, 290, 0);
|
|
|
|
object_set_location(obj, loc);
|
|
|
|
object_sphere_set_radius(obj, 100);
|
|
|
|
scene_add_object(scene, obj);
|
|
|
|
|
|
|
|
obj = object_init(ObjectTypeSphere);
|
|
|
|
tex = texture_init();
|
|
|
|
Color color3 = {0, 0, 255, 255};
|
|
|
|
texture_set_color(tex, color3);
|
|
|
|
object_set_texture(obj, tex);
|
|
|
|
loc = vector_init(320, 140, 0);
|
|
|
|
object_set_location(obj, loc);
|
2013-09-08 12:09:19 -07:00
|
|
|
object_sphere_set_radius(obj, 100);
|
2013-09-08 08:45:32 -07:00
|
|
|
scene_add_object(scene, obj);
|
2013-09-07 16:10:42 -07:00
|
|
|
|
|
|
|
scene_render(scene);
|
|
|
|
write_scene_png(scene, out_file);
|
|
|
|
|
|
|
|
scene_destroy(scene);
|
|
|
|
fclose(out_file);
|
2013-09-09 22:48:52 -07:00
|
|
|
#endif
|
2013-09-07 16:10:42 -07:00
|
|
|
|
2013-09-05 21:58:58 -07:00
|
|
|
return 0;
|
|
|
|
}
|