void SDLApp::setupCamera(string fname, int width, int height) { std::ifstream fin(fname.c_str(), std::ios::in); Tokenizer tok(&fin); Parser parser(&tok); while(tok.nextToken() != Tokenizer::TokenEnd) { if(tok.getTokenType() != Tokenizer::TokenName) { return ; } string token = tok.getStringValue(); if(token == "camera") { Hash* h = parser.readValue()->getHash(); string type = h->getValue("type")->getString(); if(type == "pinhole") { camera = new Pinhole(width, height); } else if(type == "thinLens") { camera = new ThinLens(width, height); } camera->setHash(h); } } }