Just making tiny improvements to things.
This commit is contained in:
10
src/dawnplatformergame/game/CMakeLists.txt
Normal file
10
src/dawnplatformergame/game/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2022 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
# Sources
|
||||
target_sources(${DAWN_TARGET_NAME}
|
||||
PRIVATE
|
||||
DawnGame.cpp
|
||||
)
|
40
src/dawnplatformergame/game/DawnGame.cpp
Normal file
40
src/dawnplatformergame/game/DawnGame.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "DawnGame.hpp"
|
||||
#include "scenes/TestScene.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
DawnGame::DawnGame(DawnHost *host) :
|
||||
host(host),
|
||||
renderManager(this),
|
||||
inputManager(this),
|
||||
localeManager(this),
|
||||
saveManager(this)
|
||||
{
|
||||
}
|
||||
|
||||
int32_t DawnGame::init() {
|
||||
this->assetManager.init();
|
||||
this->localeManager.init();
|
||||
this->renderManager.init();
|
||||
|
||||
this->scene = new TestScene(this);
|
||||
|
||||
return DAWN_GAME_INIT_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t DawnGame::update(float_t delta) {
|
||||
this->assetManager.update();
|
||||
this->inputManager.update();
|
||||
this->timeManager.update(delta);
|
||||
|
||||
if(this->scene != nullptr) this->scene->update();
|
||||
|
||||
this->renderManager.update();
|
||||
|
||||
return DAWN_GAME_UPDATE_RESULT_SUCCESS;
|
||||
}
|
26
src/dawnplatformergame/game/DawnGame.hpp
Normal file
26
src/dawnplatformergame/game/DawnGame.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "game/_DawnGame.hpp"
|
||||
#include "scene/components/Components.hpp"
|
||||
#include "save/DawnGameSaveManager.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class DawnGame : public IDawnGame {
|
||||
public:
|
||||
DawnHost *host;
|
||||
RenderManager renderManager;
|
||||
AssetManager assetManager;
|
||||
InputManager inputManager;
|
||||
TimeManager timeManager;
|
||||
LocaleManager localeManager;
|
||||
DawnGameSaveManager saveManager;
|
||||
|
||||
DawnGame(DawnHost *host);
|
||||
int32_t init() override;
|
||||
int32_t update(float_t delta) override;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user