1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/inc/platform-dx/game-dx.hpp

53 lines
1.6 KiB
C++
Raw Normal View History

2024-03-21 16:01:47 -03:00
#ifndef XNA_PLATFORM_GAME_DX_HPP
#define XNA_PLATFORM_GAME_DX_HPP
2024-05-06 14:54:13 -03:00
#include "../content/manager.hpp"
2024-04-20 13:39:19 -03:00
#include "../default.hpp"
2024-03-21 16:01:47 -03:00
#include "../game/game.hpp"
2024-04-23 16:11:17 -03:00
#include "dx/StepTimer.hpp"
2024-05-06 14:54:13 -03:00
#include "dxheaders.hpp"
2024-03-21 16:01:47 -03:00
namespace xna {
class Game : public IGame {
public:
2024-05-06 14:54:13 -03:00
Game();
2024-03-21 16:01:47 -03:00
2024-05-06 14:54:13 -03:00
void Exit() override;
int Run() override;
2024-05-06 14:54:13 -03:00
inline sptr<GameWindow> Window() override { return _gameWindow; }
inline sptr<GraphicsDevice> GetGraphicsDevice() override { return graphicsDevice; }
inline sptr<GameComponentCollection> Components() override { return _gameComponents; }
inline sptr<GameServiceContainer> Services() override { return services; }
inline sptr<ContentManager> Content() override { return _contentManager; }
constexpr void EnableGameComponents(bool value) { _enabledGameComponents = value; }
2024-04-27 00:10:07 -03:00
2024-03-21 16:01:47 -03:00
protected:
2024-05-06 14:54:13 -03:00
virtual void Draw(GameTime const& gameTime) override;
2024-04-20 13:39:19 -03:00
virtual void Initialize() override;
2024-05-06 14:54:13 -03:00
virtual void LoadContent() override{}
2024-04-20 13:39:19 -03:00
virtual void Update(GameTime const& gameTime) override;
2024-03-21 16:01:47 -03:00
public:
2024-05-06 14:54:13 -03:00
sptr<GraphicsDevice> graphicsDevice = nullptr;
2024-05-06 14:54:13 -03:00
protected:
sptr<GameServiceContainer> services = nullptr;
2024-05-06 10:32:17 -03:00
2024-05-06 14:54:13 -03:00
private:
2024-04-27 00:10:07 -03:00
sptr<GameComponentCollection> _gameComponents = nullptr;
2024-05-06 14:54:13 -03:00
sptr<GameWindow> _gameWindow{ nullptr };
sptr<AudioEngine> _audioEngine = nullptr;
sptr<ContentManager> _contentManager;
2024-04-27 00:10:07 -03:00
std::vector<sptr<IGameComponent>> _drawableGameComponents;
2024-04-28 20:19:37 -03:00
size_t _drawableGameComponentsCount{ 0 };
2024-05-06 10:32:17 -03:00
bool _enabledGameComponents{ false };
2024-05-06 14:54:13 -03:00
GameTime _currentGameTime{};
DX::StepTimer _stepTimer{};
int startLoop();
void step();
2024-03-21 16:01:47 -03:00
};
}
#endif