setting GameManager dimensions

This commit is contained in:
devZoGok
2021-11-01 20:48:31 +02:00
parent 768ed2207c
commit 306283a4d4
3 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -24,9 +24,12 @@ namespace battleship{
GameManager::~GameManager() {}
void GameManager::start() {
void GameManager::start(int width, int height) {
this->width = 800;
this->height = 600;
Root *root = Root::getSingleton();
root->start(800, 600, "../../vb01/", "Battleship");
root->start(width, height, "../../vb01/", "Battleship");
stateManager = new StateManager();
listener = new InputManager(root->getWindow());
+1 -1
View File
@@ -16,7 +16,7 @@ namespace battleship{
class GameManager {
public:
static GameManager* getSingleton();
void start();
void start(int, int);
void update();
inline int getWidth(){return width;}
inline int getHeight(){return height;}
+1 -1
View File
@@ -7,7 +7,7 @@ using namespace battleship;
int main() {
GameManager *gameManager = GameManager::getSingleton();
gameManager->start();
gameManager->start(800, 600);
GuiAppState *state = new GuiAppState();
gameManager->getStateManager()->attachState(state);
makeTitlescreenButtons(state);