Project changed, ControlFactory (Creates large UI structures such as

menus, dialoges...) GameSession (Session information, such as filename,
reference to simulation
This commit is contained in:
Simon Robertshaw 2012-01-10 23:18:37 +00:00
parent d31d290bf9
commit 2eb09c1daa
6 changed files with 52 additions and 1 deletions

View File

@ -132,4 +132,8 @@ C:/Users/Simon/Projects/FacialTurd-PowderToypp/src/Misc.cpp
C:/Users/Simon/Projects/FacialTurd-PowderToypp/src/PowderToy.cpp
C:/Users/Simon/Projects/FacialTurd-PowderToypp/src/Renderer.cpp
C:/Users/Simon/Projects/FacialTurd-PowderToypp/src/Simulation.cpp
C:/Users/Simon/Projects/FacialTurd-PowderToypp/Changelog.txt
C:/Users/Simon/Projects/FacialTurd-PowderToypp/Changelog.txt
src/interface/ControlFactory.cpp
includes/interface/ControlFactory.h
src/GameSession.cpp
includes/GameSession.h

10
includes/GameSession.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef GAMESESSION_H
#define GAMESESSION_H
class GameSession
{
public:
GameSession();
};
#endif // GAMESESSION_H

View File

@ -0,0 +1,15 @@
#ifndef CONTROLFACTORY_H
#define CONTROLFACTORY_H
#include "Panel.h"
#include "Window.h"
#include "GameSession.h"
class ControlFactory
{
public:
static ui::Panel * MainMenu(GameSession * session, int x, int y, int width, int height);
};
#endif // CONTROLFACTORY_H

6
src/GameSession.cpp Normal file
View File

@ -0,0 +1,6 @@
#include "GameSession.h"
GameSession::GameSession()
{
//Boop
}

View File

@ -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))

View File

@ -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;
}