charles/src/scene.c

76 lines
1.1 KiB
C
Raw Normal View History

/* scene.c
*
* Definition of Scene-related functions.
*
* Eryn Wells <eryn@erynwells.me>
*/
#include <stdlib.h>
#include "scene.h"
/*
* scene_init --
*
* Initialize and return a new Scene. If the Scene could not be created, NULL is returned.
*/
Scene *
scene_init()
{
Scene *new_scene = malloc(sizeof(Scene));
if (!new_scene) {
return NULL;
}
// Set some default values.
new_scene->height = 0;
new_scene->width = 0;
2013-09-06 19:01:15 -07:00
new_scene->camera = camera_init();
return new_scene;
}
/*
* scene_destroy --
*
* Cleanup a Scene.
*/
void
scene_destroy(Scene *scene)
{
if (scene == NULL) {
return;
}
2013-09-06 19:01:15 -07:00
camera_destroy(scene->camera);
free(scene);
}
/*
* scene_load --
*
* Load a scene from a file into the given Scene object.
*/
void
scene_load(Scene *scene, FILE *scene_file)
{ }
2013-09-05 22:08:55 -07:00
/*
* scene_render --
*
* Render the given Scene.
2013-09-05 22:08:55 -07:00
*/
void
scene_render(Scene *scene)
{
for (int y = 0; y < scene->height; y++) {
for (int x = 0; x < scene->width; x++) {
// TODO: Process the scene.
}
}
}