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

39 lines
1000 B
C++
Raw Normal View History

#ifndef XNA_GAME_GRAPHICSDEVICEMANAGER_HPP
#define XNA_GAME_GRAPHICSDEVICEMANAGER_HPP
#include "../default.hpp"
2024-05-24 14:42:12 -03:00
#include "gdeviceinfo.hpp"
namespace xna {
2024-05-24 14:42:12 -03:00
class GraphicsDeviceManager {
public:
2024-05-24 14:42:12 -03:00
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;
2024-05-30 22:14:01 -03:00
static constexpr int DefaultBackBufferHeight = 480;
2024-05-24 14:42:12 -03:00
protected:
2024-05-24 14:42:12 -03:00
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