diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-17 20:46:06 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-17 20:46:06 (GMT) |
| commit | 4a60b97c700c2f1843b7e99313554cb89fb5da4e (patch) | |
| tree | 3b33ef6f74a4e8a4ff5968a81b9c4c429ccaa7c6 /src/PowderToy.cpp | |
| parent | 6273089bf486bf46ad325d72c7290ebb272bd3d8 (diff) | |
| download | powder-4a60b97c700c2f1843b7e99313554cb89fb5da4e.zip powder-4a60b97c700c2f1843b7e99313554cb89fb5da4e.tar.gz | |
Some minor changes
Diffstat (limited to 'src/PowderToy.cpp')
| -rw-r--r-- | src/PowderToy.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/PowderToy.cpp b/src/PowderToy.cpp index 1e9630c..cf7d804 100644 --- a/src/PowderToy.cpp +++ b/src/PowderToy.cpp @@ -19,6 +19,9 @@ #include "interface/Point.h" #include "interface/Label.h" +#include "game/GameController.h" +#include "game/GameView.h" + using namespace std; SDL_Surface * SDLOpen() @@ -66,20 +69,24 @@ int main(int argc, char * argv[]) //Simulation * sim = new Simulation(); //ren = new Renderer(g, sim); - Global::Ref().g = new Graphics(); - Global::Ref().g->AttachSDLSurface(SDLOpen()); + ui::Engine::Ref().g = new Graphics(); + ui::Engine::Ref().g->AttachSDLSurface(SDLOpen()); ui::Engine * engine = &ui::Engine::Ref();//new ui::Engine(); - ui::State * engineState = new ui::State(); - ui::Sandbox * sandbox = new ui::Sandbox(); - ui::Button * button = new ui::Button(ui::Point(100, 100), ui::Point(100, 100), std::string("poP")); + //ui::State * engineState = new ui::State(); ui::Label * fpsLabel = new ui::Label(ui::Point(2, 2), ui::Point(200, 14), std::string("FPS: 0")); + //engineState->AddComponent(fpsLabel); engine->Begin(XRES, YRES); - engine->SetState(engineState); +// engine->SetState(engineState); + + GameController * gameController = new GameController(); + engine->ShowWindow(gameController->GetView()); + /*ui::Sandbox * sandbox = new ui::Sandbox(); + ui::Button * button = new ui::Button(ui::Point(100, 100), ui::Point(100, 100), std::string("poP")); engineState->AddComponent(fpsLabel); engineState->AddComponent(sandbox); engineState->AddComponent(button); - engineState->AddComponent(ControlFactory::MainMenu(0, YRES+MENUSIZE-17, XRES+BARSIZE, 16)); + engineState->AddComponent(ControlFactory::MainMenu(0, YRES+MENUSIZE-17, XRES+BARSIZE, 16));*/ SDL_Event event; while(engine->Running()) |
