#ifndef XNA_GAME_GAME_HPP #define XNA_GAME_GAME_HPP #include "../default.hpp" #include "time.hpp" namespace xna { class Game : public std::enable_shared_from_this { public: Game(); void Exit(); int Run(); sptr Window(); sptr GetGraphicsDevice(); sptr Components(); sptr Services(); sptr Content(); void EnableGameComponents(bool value); void AttachGraphicsDevice(sptr const& graphicsDevice); void ResizeWindow(int width, int heigth); protected: virtual void Draw(GameTime const& gameTime); virtual void Initialize(); virtual void LoadContent(){} virtual void Update(GameTime const& gameTime); int StartGameLoop(); void Step(); public: sptr graphicsDevice = nullptr; protected: sptr services = nullptr; private: sptr _gameComponents = nullptr; sptr _gameWindow{ nullptr }; sptr _audioEngine = nullptr; sptr _contentManager; std::vector> _drawableGameComponents; size_t _drawableGameComponentsCount{ 0 }; bool _enabledGameComponents{ false }; GameTime _currentGameTime{}; public: struct PlatformImplementation; uptr impl = nullptr; }; } #endif