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

52 lines
1.3 KiB
C++
Raw Normal View History

#include "gdevicemanager-dx.hpp"
#include "device-dx.hpp"
#include "game-dx.hpp"
#include "window-dx.hpp"
#include "gdeviceinfo-dx.hpp"
namespace xna {
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);
}
void GraphicsDeviceManager::ApplyChanges() {
//_game->_graphicsDevice = _device;
}
void GraphicsDeviceManager::ToggleFullScreen() {
}
void GraphicsDeviceManager::CreateDevice(GraphicsDeviceInformation const& info) {
_device = New<GraphicsDevice>(info);
auto window = _game->Window();
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;
}
void GraphicsDeviceManager::ChangeDevice() {
}
}