2024-03-30 14:25:08 -03:00
|
|
|
#ifndef XNA_GAME_GRAPHICSDEVICEMANAGER_HPP
|
|
|
|
#define XNA_GAME_GRAPHICSDEVICEMANAGER_HPP
|
|
|
|
|
2024-04-26 10:13:00 -03:00
|
|
|
#include "../default.hpp"
|
2024-05-24 14:42:12 -03:00
|
|
|
#include "gdeviceinfo.hpp"
|
2024-03-30 14:25:08 -03:00
|
|
|
|
|
|
|
namespace xna {
|
2024-05-24 14:42:12 -03:00
|
|
|
class GraphicsDeviceManager {
|
2024-03-30 14:25:08 -03:00
|
|
|
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;
|
|
|
|
static constexpr int DefaultBackBufferHeight = 600;
|
|
|
|
|
2024-03-30 14:25:08 -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{};
|
2024-03-30 14:25:08 -03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|