#ifndef XNA_PLATFORM_GAME_DX_HPP #define XNA_PLATFORM_GAME_DX_HPP #include "../default.hpp" #include "../game/game.hpp" #include "dxheaders.hpp" #include "dx/StepTimer.hpp" namespace xna { class Game : public IGame { public: Game(); virtual ~Game() override { } virtual void Exit() override; virtual int Run() override; virtual sptr Window() override { return _gameWindow; } virtual sptr GetGraphicsDevice() override { return _graphicsDevice; } sptr Components() override { return _gameComponents; } constexpr void EnableGameComponents(bool value) { _enabledGameComponents = value; } protected: virtual void Draw(GameTime const& gameTime) override; virtual void Initialize() override; virtual void LoadContent() override{} virtual void Update(GameTime const& gameTime) override; public: sptr _graphicsDevice{ nullptr }; protected: sptr _gameWindow{ nullptr }; sptr _audioEngine = nullptr; GameTime _currentGameTime{}; DX::StepTimer _stepTimer; private: int startLoop(); void step(); sptr _gameComponents = nullptr; std::vector> _drawableGameComponents; size_t _drawableGameComponentsCount{ 0 }; bool _enabledGameComponents{ false }; }; } #endif