void Setup(){
	SetupGL();

	view1=Menu(ScreenQuad::MAIN,ProjectionType::ORTHOGONAL,
		PolygonMode::FILL,0,0,-10,0,1,0);
	//gluLookAt(0, 0, -10, 0, 0, 0, 0, 1, 0);
	view2=Viewport(ScreenQuad::GAME,ProjectionType::ORTHOGONAL,
		PolygonMode::FILL, -12, 9, -20, 0, 1, 0);
	
	loader=SceneLoader("test.txt");
}
Example #2
0
Game::Game() {
	fps_ = 0;

	window_ = new sf::RenderWindow(sf::VideoMode(640, 480), "Longevity"); // change window size to scale	
	camera_ = new Camera(window_, sf::IntRect(0, 0, 320, 240));  // view size is 1:1 scale
	input_handler_ = new InputHandler(window_, &player_);

	// Set up camera
	camera_->SetTarget(&player_);

	// Register textures
	texture_factory_ = new TextureFactory();
	texture_factory_->RegisterTexture("test", "test.png");

	// Set up scene
	scene_ = new Scene(texture_factory_);
	SceneLoader scene_loader = SceneLoader();
	scene_loader.Load("test_map.txt", *scene_);
	sf::IntRect scene_size = scene_->GetSizeInPixels();
	camera_->SetBoundary(scene_size.width, scene_size.height);
	scene_->AddEntity(&player_);
}
 SceneLoader Scene::getSceneLoader() {
     return SceneLoader(*this);
 }