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:
parent
d31d290bf9
commit
2eb09c1daa
@ -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
10
includes/GameSession.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef GAMESESSION_H
|
||||
#define GAMESESSION_H
|
||||
|
||||
class GameSession
|
||||
{
|
||||
public:
|
||||
GameSession();
|
||||
};
|
||||
|
||||
#endif // GAMESESSION_H
|
15
includes/interface/ControlFactory.h
Normal file
15
includes/interface/ControlFactory.h
Normal 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
6
src/GameSession.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "GameSession.h"
|
||||
|
||||
GameSession::GameSession()
|
||||
{
|
||||
//Boop
|
||||
}
|
@ -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))
|
||||
|
11
src/interface/ControlFactory.cpp
Normal file
11
src/interface/ControlFactory.cpp
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user