1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/inc/xna/game/gdevicemanager.hpp
2024-06-03 21:55:09 -03:00

39 lines
1000 B
C++

#ifndef XNA_GAME_GRAPHICSDEVICEMANAGER_HPP
#define XNA_GAME_GRAPHICSDEVICEMANAGER_HPP
#include "../default.hpp"
#include "gdeviceinfo.hpp"
namespace xna {
class GraphicsDeviceManager {
public:
GraphicsDeviceManager(sptr<Game> const& game);
~GraphicsDeviceManager() {}
void ApplyChanges();
bool Initialize();
bool ToggleFullScreen();
Int PreferredBackBufferWidth() const;
Int PreferredBackBufferHeight() const;
void PreferredBackBufferWidth(Int value);
void PreferredBackBufferHeight(Int value);
public:
static constexpr int DefaultBackBufferWidth = 800;
static constexpr int DefaultBackBufferHeight = 480;
protected:
bool CreateDevice();
void ChangeDevice();
private:
sptr<Game> _game = nullptr;
Int _backBufferWidth{ DefaultBackBufferWidth };
Int _backBufferHeight{ DefaultBackBufferHeight };
bool _isDeviceDirty{ false };
sptr<GraphicsDevice> _device = nullptr;
bool _isFullScreen{ false };
GraphicsDeviceInformation _information{};
};
}
#endif