diff --git a/includes/xna-dx/implementations.hpp b/includes/xna-dx/implementations.hpp index ef82b23..6fd6026 100644 --- a/includes/xna-dx/implementations.hpp +++ b/includes/xna-dx/implementations.hpp @@ -4,20 +4,11 @@ #include "headers.hpp" namespace xna { - struct GraphicsAdapterImpl { - comptr Adapter() const { - return adapter; - } - - comptr Factory() const { - return factory; - } - - private: + struct GraphicsAdapterImplementation { friend class GraphicsAdapter; - comptr adapter; - comptr factory; + comptr Adapter; + comptr Factory; }; struct BlendRenderTarget { diff --git a/includes/xna/graphics/adapter.hpp b/includes/xna/graphics/adapter.hpp index 77ef9e5..7f9b570 100644 --- a/includes/xna/graphics/adapter.hpp +++ b/includes/xna/graphics/adapter.hpp @@ -9,9 +9,10 @@ namespace xna { - struct GraphicsAdapterImpl; + struct GraphicsAdapterImplementation; + //Provides methods to retrieve and manipulate graphics adapters. - class GraphicsAdapter : public ImplementationBase { + class GraphicsAdapter : public ImplementationBase { public: //Collection of available adapters on the system. static void Adapters(std::vector>& adapters); diff --git a/sources/framework-dx/adapter.cpp b/sources/framework-dx/adapter.cpp index d24df7d..41afe0f 100644 --- a/sources/framework-dx/adapter.cpp +++ b/sources/framework-dx/adapter.cpp @@ -8,7 +8,7 @@ namespace xna { static sptr getSupportedDisplayModes(comptr& dxAdapter); GraphicsAdapter::GraphicsAdapter() { - Implementation = unew(); + Implementation = unew(); } uptr GraphicsAdapter::DefaultAdapter() { @@ -22,8 +22,8 @@ namespace xna { if (pFactory->EnumAdapters1(0, pAdapter.GetAddressOf()) != DXGI_ERROR_NOT_FOUND) { auto adp = uptr(new GraphicsAdapter()); - adp->Implementation->adapter = pAdapter; - adp->Implementation->factory = pFactory; + adp->Implementation->Adapter = pAdapter; + adp->Implementation->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->Implementation->adapter = pAdapter; - adp->Implementation->factory = pFactory; + adp->Implementation->Adapter = pAdapter; + adp->Implementation->Factory = pFactory; DXGI_ADAPTER_DESC1 desc{}; pAdapter->GetDesc1(&desc); @@ -101,7 +101,7 @@ namespace xna { comptr pOutput = nullptr; - if (Implementation->adapter->EnumOutputs(0, pOutput.GetAddressOf()) != DXGI_ERROR_NOT_FOUND){ + if (Implementation->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 9f36328..51ae38f 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.Implementation->Adapter().Get(); + const auto& pAdapter = GraphicsAdapter::UseNullDevice() ? NULL : currentAdapter.Implementation->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 6c6bdc3..c7f6ac9 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->Implementation->Factory()->QueryInterface(IID_IDXGIFactory2, (void**)&dxFactory2); + const auto hr = adapter->Implementation->Factory->QueryInterface(IID_IDXGIFactory2, (void**)&dxFactory2); if (FAILED(hr)) return false;