mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
Correção de acesso em GraphicsAdapter::ImplementationBase::PlatformImplementation
This commit is contained in:
parent
adeda5ca67
commit
02a1911532
@ -5,8 +5,19 @@
|
|||||||
|
|
||||||
namespace xna {
|
namespace xna {
|
||||||
struct GraphicsAdapter::ImplementationBase::PlatformImplementation {
|
struct GraphicsAdapter::ImplementationBase::PlatformImplementation {
|
||||||
comptr<IDXGIAdapter1> dxAdapter;
|
comptr<IDXGIAdapter1> Adapter() const {
|
||||||
comptr<IDXGIFactory1> dxFactory;
|
return adapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
comptr<IDXGIFactory1> Factory() const {
|
||||||
|
return factory;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class GraphicsAdapter;
|
||||||
|
|
||||||
|
comptr<IDXGIAdapter1> adapter;
|
||||||
|
comptr<IDXGIFactory1> factory;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpriteFont::PlatformImplementation {
|
struct SpriteFont::PlatformImplementation {
|
||||||
|
@ -22,8 +22,8 @@ namespace xna {
|
|||||||
if (pFactory->EnumAdapters1(0, pAdapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND) {
|
if (pFactory->EnumAdapters1(0, pAdapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND) {
|
||||||
auto adp = uptr<GraphicsAdapter>(new GraphicsAdapter());
|
auto adp = uptr<GraphicsAdapter>(new GraphicsAdapter());
|
||||||
|
|
||||||
adp->impl->dxAdapter = pAdapter;
|
adp->impl->adapter = pAdapter;
|
||||||
adp->impl->dxFactory = pFactory;
|
adp->impl->factory = pFactory;
|
||||||
|
|
||||||
DXGI_ADAPTER_DESC1 desc{};
|
DXGI_ADAPTER_DESC1 desc{};
|
||||||
pAdapter->GetDesc1(&desc);
|
pAdapter->GetDesc1(&desc);
|
||||||
@ -62,8 +62,8 @@ namespace xna {
|
|||||||
for (UINT count = 0; pFactory->EnumAdapters1(count, pAdapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND; ++count) {
|
for (UINT count = 0; pFactory->EnumAdapters1(count, pAdapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND; ++count) {
|
||||||
auto adp = uptr<GraphicsAdapter>(new GraphicsAdapter());
|
auto adp = uptr<GraphicsAdapter>(new GraphicsAdapter());
|
||||||
|
|
||||||
adp->impl->dxAdapter = pAdapter;
|
adp->impl->adapter = pAdapter;
|
||||||
adp->impl->dxFactory = pFactory;
|
adp->impl->factory = pFactory;
|
||||||
|
|
||||||
DXGI_ADAPTER_DESC1 desc{};
|
DXGI_ADAPTER_DESC1 desc{};
|
||||||
pAdapter->GetDesc1(&desc);
|
pAdapter->GetDesc1(&desc);
|
||||||
@ -101,7 +101,7 @@ namespace xna {
|
|||||||
|
|
||||||
comptr<IDXGIOutput> pOutput = nullptr;
|
comptr<IDXGIOutput> pOutput = nullptr;
|
||||||
|
|
||||||
if (impl->dxAdapter->EnumOutputs(0, pOutput.GetAddressOf()) != DXGI_ERROR_NOT_FOUND){
|
if (impl->adapter->EnumOutputs(0, pOutput.GetAddressOf()) != DXGI_ERROR_NOT_FOUND){
|
||||||
comptr<IDXGIOutput1> pOutput1 = nullptr;
|
comptr<IDXGIOutput1> pOutput1 = nullptr;
|
||||||
|
|
||||||
pOutput->QueryInterface(IID_IDXGIOutput1, (void**)pOutput1.GetAddressOf());
|
pOutput->QueryInterface(IID_IDXGIOutput1, (void**)pOutput1.GetAddressOf());
|
||||||
|
@ -226,7 +226,7 @@ namespace xna {
|
|||||||
createDeviceFlags = D3D11_CREATE_DEVICE_FLAG::D3D11_CREATE_DEVICE_DEBUG;
|
createDeviceFlags = D3D11_CREATE_DEVICE_FLAG::D3D11_CREATE_DEVICE_DEBUG;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const auto& pAdapter = GraphicsAdapter::UseNullDevice() ? NULL : currentAdapter.impl->dxAdapter.Get();
|
const auto& pAdapter = GraphicsAdapter::UseNullDevice() ? NULL : currentAdapter.impl->Adapter().Get();
|
||||||
|
|
||||||
//
|
//
|
||||||
// if pAdapter is not NULL driverType must be D3D_DRIVER_TYPE_UNKNOWN
|
// if pAdapter is not NULL driverType must be D3D_DRIVER_TYPE_UNKNOWN
|
||||||
|
@ -27,7 +27,7 @@ namespace xna {
|
|||||||
auto adapter = device.Adapter();
|
auto adapter = device.Adapter();
|
||||||
|
|
||||||
comptr<IDXGIFactory2> dxFactory2 = nullptr;
|
comptr<IDXGIFactory2> dxFactory2 = nullptr;
|
||||||
const auto hr = adapter->impl->dxFactory->QueryInterface(IID_IDXGIFactory2, (void**)&dxFactory2);
|
const auto hr = adapter->impl->Factory()->QueryInterface(IID_IDXGIFactory2, (void**)&dxFactory2);
|
||||||
|
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user