diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-10 23:18:37 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-10 23:18:37 (GMT) |
| commit | 2eb09c1daac8199532694167f418146fa57e7735 (patch) | |
| tree | 245dc05e825ad049435b14adc3abb8593acf3cc5 /src | |
| parent | d31d290bf9205999e7a849e5974241f2fd615259 (diff) | |
| download | powder-2eb09c1daac8199532694167f418146fa57e7735.zip powder-2eb09c1daac8199532694167f418146fa57e7735.tar.gz | |
Project changed, ControlFactory (Creates large UI structures such as
menus, dialoges...) GameSession (Session information, such as filename,
reference to simulation
Diffstat (limited to 'src')
| -rw-r--r-- | src/GameSession.cpp | 6 | ||||
| -rw-r--r-- | src/PowderToy.cpp | 5 | ||||
| -rw-r--r-- | src/interface/ControlFactory.cpp | 11 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/GameSession.cpp b/src/GameSession.cpp new file mode 100644 index 0000000..364f268 --- /dev/null +++ b/src/GameSession.cpp @@ -0,0 +1,6 @@ +#include "GameSession.h" + +GameSession::GameSession() +{ + //Boop +} diff --git a/src/PowderToy.cpp b/src/PowderToy.cpp index d634cce..973aaa3 100644 --- a/src/PowderToy.cpp +++ b/src/PowderToy.cpp @@ -10,6 +10,9 @@ #include "interface/Window.h" #include "interface/Button.h" #include "interface/Sandbox.h" +#include "interface/Panel.h" +#include "interface/ControlFactory.h" +#include "GameSession.h" SDL_Surface * SDLOpen() { @@ -45,11 +48,13 @@ int main(int argc, char * argv[]) //Simulation * sim = new Simulation(); //ren = new Renderer(g, sim); + GameSession * gameSession = new GameSession(); ui::Window * window = new ui::Window(); ui::Sandbox * sandbox = new ui::Sandbox(); ui::Button * button = new ui::Button(100, 100, 100, 100, "poP"); window->Add(sandbox); window->Add(button); + window->Add(ControlFactory::MainMenu(gameSession, 0, 0, 200, 200)); SDL_Event event; while(!SDLPoll(&event)) diff --git a/src/interface/ControlFactory.cpp b/src/interface/ControlFactory.cpp new file mode 100644 index 0000000..300ceba --- /dev/null +++ b/src/interface/ControlFactory.cpp @@ -0,0 +1,11 @@ +#include "interface/ControlFactory.h" +#include "interface/Button.h" +#include "interface/Panel.h" +#include "interface/Window.h" + +ui::Panel * ControlFactory::MainMenu(GameSession * session, int x, int y, int width, int height) +{ + ui::Panel * mainMenu = new ui::Panel(x, y, width, height); + //mainMenu->Add(new ui::Button(0, 0, 20, 20, "Turd")); + return mainMenu; +} |
