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

52 lines
1.3 KiB
C++
Raw Normal View History

#ifndef XNA_PLATFORM_GDEVICEMANAGER_DX_HPP
#define XNA_PLATFORM_GDEVICEMANAGER_DX_HPP
#include "../game/gdevicemanager.hpp"
2024-04-26 10:37:49 -03:00
#include "gdeviceinfo-dx.hpp"
namespace xna {
class GraphicsDeviceManager : public IGraphicsDeviceManager {
public:
GraphicsDeviceManager(Game*& game);
2024-04-02 09:32:06 -03:00
virtual ~GraphicsDeviceManager() override{}
virtual void ApplyChanges() override;
virtual bool Initialize() override;
virtual bool ToggleFullScreen() override;
virtual constexpr Int PreferredBackBufferWidth() const {
return _backBufferWidth;
}
virtual constexpr Int PreferredBackBufferHeight() const {
return _backBufferHeight;
}
virtual void PreferredBackBufferWidth(Int value);
virtual void PreferredBackBufferHeight(Int value);
protected:
virtual bool CreateDevice() override;
virtual void ChangeDevice() override;
public:
2024-04-22 16:14:55 -03:00
static constexpr int DefaultBackBufferWidth = 800;//800;
2024-04-23 16:11:17 -03:00
static constexpr int DefaultBackBufferHeight = 600;// 480;
private:
2024-04-22 16:14:55 -03:00
Game* _game;
Int _backBufferWidth{ DefaultBackBufferWidth };
Int _backBufferHeight{ DefaultBackBufferHeight };
2024-04-22 16:14:55 -03:00
bool _isDeviceDirty{ false };
2024-04-26 11:35:59 -03:00
sptr<GraphicsDevice> _device = nullptr;
bool _isFullScreen{ false };
GraphicsDeviceInformation _information{};
bool initWindow();
bool initDevice();
};
}
#endif