diff --git a/includes/xna-dx/implementations.hpp b/includes/xna-dx/implementations.hpp index 5ee079b..33ed481 100644 --- a/includes/xna-dx/implementations.hpp +++ b/includes/xna-dx/implementations.hpp @@ -5,8 +5,19 @@ namespace xna { struct GraphicsAdapter::ImplementationBase::PlatformImplementation { - comptr dxAdapter; - comptr dxFactory; + comptr Adapter() const { + return adapter; + } + + comptr Factory() const { + return factory; + } + + private: + friend class GraphicsAdapter; + + comptr adapter; + comptr factory; }; struct SpriteFont::PlatformImplementation { diff --git a/sources/framework-dx/adapter.cpp b/sources/framework-dx/adapter.cpp index b3d53d5..73d7f52 100644 --- a/sources/framework-dx/adapter.cpp +++ b/sources/framework-dx/adapter.cpp @@ -22,8 +22,8 @@ namespace xna { if (pFactory->EnumAdapters1(0, pAdapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND) { auto adp = uptr(new GraphicsAdapter()); - adp->impl->dxAdapter = pAdapter; - adp->impl->dxFactory = pFactory; + adp->impl->adapter = pAdapter; + adp->impl->factory = pFactory; DXGI_ADAPTER_DESC1 desc{}; pAdapter->GetDesc1(&desc); @@ -62,8 +62,8 @@ namespace xna { for (UINT count = 0; pFactory->EnumAdapters1(count, pAdapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND; ++count) { auto adp = uptr(new GraphicsAdapter()); - adp->impl->dxAdapter = pAdapter; - adp->impl->dxFactory = pFactory; + adp->impl->adapter = pAdapter; + adp->impl->factory = pFactory; DXGI_ADAPTER_DESC1 desc{}; pAdapter->GetDesc1(&desc); @@ -101,7 +101,7 @@ namespace xna { comptr 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 pOutput1 = nullptr; pOutput->QueryInterface(IID_IDXGIOutput1, (void**)pOutput1.GetAddressOf()); diff --git a/sources/framework-dx/device.cpp b/sources/framework-dx/device.cpp index bb1cbd0..02d51ca 100644 --- a/sources/framework-dx/device.cpp +++ b/sources/framework-dx/device.cpp @@ -226,7 +226,7 @@ namespace xna { createDeviceFlags = D3D11_CREATE_DEVICE_FLAG::D3D11_CREATE_DEVICE_DEBUG; #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 diff --git a/sources/framework-dx/swapchain.cpp b/sources/framework-dx/swapchain.cpp index 8da6314..eadb1f4 100644 --- a/sources/framework-dx/swapchain.cpp +++ b/sources/framework-dx/swapchain.cpp @@ -27,7 +27,7 @@ namespace xna { auto adapter = device.Adapter(); comptr 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)) return false;