2024-03-30 14:25:08 -03:00
|
|
|
|
#include "gdevicemanager-dx.hpp"
|
|
|
|
|
#include "device-dx.hpp"
|
|
|
|
|
#include "game-dx.hpp"
|
|
|
|
|
#include "window-dx.hpp"
|
|
|
|
|
#include "gdeviceinfo-dx.hpp"
|
|
|
|
|
|
|
|
|
|
namespace xna {
|
2024-04-01 11:29:32 -03:00
|
|
|
|
GraphicsDeviceManager::GraphicsDeviceManager(Game* game) : _game(game){
|
|
|
|
|
GraphicsDeviceInformation information;
|
|
|
|
|
|
|
|
|
|
const auto adp = GraphicsAdapter::DefaultAdapter();
|
|
|
|
|
information.Adapter(adp);
|
|
|
|
|
information.GraphicsProfile(xna::GraphicsProfile::HiDef);
|
|
|
|
|
|
|
|
|
|
PresentationParameters parameters;
|
|
|
|
|
parameters.BackBufferWidth = _backBufferWidth;
|
|
|
|
|
parameters.BackBufferHeight = _backBufferHeight;
|
|
|
|
|
information.PresentationParameters(parameters);
|
|
|
|
|
|
|
|
|
|
information.Window(game->Window());
|
|
|
|
|
|
|
|
|
|
CreateDevice(information);
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-30 14:25:08 -03:00
|
|
|
|
void GraphicsDeviceManager::ApplyChanges() {
|
2024-04-01 11:29:32 -03:00
|
|
|
|
//_game->_graphicsDevice = _device;
|
2024-03-30 14:25:08 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraphicsDeviceManager::ToggleFullScreen() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraphicsDeviceManager::CreateDevice(GraphicsDeviceInformation const& info) {
|
2024-04-01 11:29:32 -03:00
|
|
|
|
_device = New<GraphicsDevice>(info);
|
2024-03-30 14:25:08 -03:00
|
|
|
|
auto window = _game->Window();
|
|
|
|
|
|
2024-04-01 11:29:32 -03:00
|
|
|
|
if (!window->Create()) {
|
|
|
|
|
MessageBox(nullptr, "Falha na cria<69><61>o da janela", "Xna Game Engine", MB_OK);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//_device->Initialize(*window);
|
|
|
|
|
if (!_device->Initialize(*window)) {
|
|
|
|
|
MessageBox(nullptr, "Falha na inicializa<7A><61>o do dispositivo gr<67>fico", "Xna Game Engine", MB_OK);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-07 14:06:12 -03:00
|
|
|
|
_game->_graphicsDevice = _device;
|
2024-03-30 14:25:08 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraphicsDeviceManager::ChangeDevice() {
|
|
|
|
|
}
|
|
|
|
|
}
|