mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
Implementa modificações em GraphicsDevice
This commit is contained in:
parent
1d21955efb
commit
2ea523d36b
@ -18,6 +18,17 @@ namespace xna {
|
||||
}
|
||||
|
||||
bool GraphicsDevice::Initialize(GameWindow& gameWindow) {
|
||||
if (_factory) {
|
||||
_factory->Release();
|
||||
_factory = nullptr;
|
||||
}
|
||||
|
||||
auto hr = CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&_factory);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_blendState == nullptr)
|
||||
_blendState = BlendState::NonPremultiplied();
|
||||
|
||||
@ -56,13 +67,9 @@ namespace xna {
|
||||
_swapChain->Initialize(gameWindow);
|
||||
|
||||
if (!_swapChain->Apply())
|
||||
return false;
|
||||
return false;
|
||||
|
||||
IDXGIFactory1* dxgiFactory = nullptr;
|
||||
if FAILED(CreateDXGIFactory1(__uuidof(IDXGIFactory1), (void**)&dxgiFactory))
|
||||
return false;
|
||||
|
||||
if FAILED(dxgiFactory->MakeWindowAssociation(gameWindow.WindowHandle(), DXGI_MWA_NO_ALT_ENTER))
|
||||
if FAILED(_factory->MakeWindowAssociation(gameWindow.WindowHandle(), DXGI_MWA_NO_ALT_ENTER))
|
||||
return false;
|
||||
|
||||
if (!_renderTarget2D) {
|
||||
|
@ -22,6 +22,11 @@ namespace xna {
|
||||
_context->Release();
|
||||
_context = nullptr;
|
||||
}
|
||||
|
||||
if (_factory) {
|
||||
_factory->Release();
|
||||
_factory = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void Clear() override;
|
||||
@ -61,6 +66,7 @@ namespace xna {
|
||||
public:
|
||||
ID3D11Device* _device{ nullptr };
|
||||
ID3D11DeviceContext* _context{ nullptr };
|
||||
IDXGIFactory1* _factory = nullptr;
|
||||
|
||||
private:
|
||||
unsigned int _createDeviceFlags{ 0 };
|
||||
|
Loading…
x
Reference in New Issue
Block a user