updated main/Scene to accept std::map of parameters

git-svn-id: svn://anubis/fart/trunk@23 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-01-22 02:26:32 +00:00
parent 5c9857e9a1
commit 959219ffb8
3 changed files with 32 additions and 1 deletions

View File

@ -1,5 +1,24 @@
#include "Scene.h" #include "Scene.h"
#include <string>
#include <map>
using namespace std;
Scene::Scene(map<string, const char *> options,
const char * filename)
{
m_width = 800;
m_height = 600;
m_multisample_level = 1;
m_output_file_name = "fart.bmp";
m_verbose = false;
load(filename);
}
void Scene::load(const char * filename)
{
}
void Scene::render() void Scene::render()
{ {

View File

@ -2,12 +2,24 @@
#ifndef SCENE_H #ifndef SCENE_H
#define SCENE_H SCENE_H #define SCENE_H SCENE_H
#include <string>
#include <map>
class Scene class Scene
{ {
public: public:
Scene(std::map<std::string, const char *> options,
const char * filename);
void render(); void render();
private: private:
void load(const char * filename);
int m_width;
int m_height;
int m_multisample_level;
std::string m_output_file_name;
bool m_verbose;
}; };
#endif #endif

View File

@ -24,7 +24,7 @@ int main(int argc, char * argv[])
{ {
int opt; int opt;
int option_index; int option_index;
map<string, char *> scene_options; map<string, const char *> scene_options;
static const struct option long_options[] = { static const struct option long_options[] = {
{ "output-file", required_argument, NULL, 'o' }, { "output-file", required_argument, NULL, 'o' },