From fd1ed1c23713de58b817ad2bbe2d027c9d1e04cb Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 30 Jan 2020 21:37:55 -0800 Subject: Implemented C API --- unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.cpp | 2 +- unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.h | 2 +- unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp | 4 ++-- unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp | 4 ++-- unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp | 4 ++-- unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'unityplugin/GhostCubePlugin/PluginSource') diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.cpp index a46d275..73badff 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.cpp @@ -1,7 +1,7 @@ #include "RenderAPI.h" #include "PlatformBase.h" #include "Unity/IUnityGraphics.h" -#include "GraphicsAccessories.h" +#include "GraphicsAccessories.hpp" using namespace Diligent; diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.h b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.h index 8d80f6e..0d6b25e 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.h +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI.h @@ -3,7 +3,7 @@ #include "Unity/IUnityGraphics.h" #include "RenderDevice.h" #include "DeviceContext.h" -#include "RefCntAutoPtr.h" +#include "RefCntAutoPtr.hpp" struct IUnityInterfaces; diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp index 3564939..b3f2fd2 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D11.cpp @@ -80,11 +80,11 @@ void RenderAPI_D3D11::AttachToNativeRenderTexture(void *nativeRenderTargetHandle auto *pd3d11RenderTarget = reinterpret_cast(nativeRenderTargetHandle); RefCntAutoPtr pRenderTarget; - pDeviceD3D11->CreateTextureFromD3DResource(pd3d11RenderTarget, RESOURCE_STATE_UNDEFINED, &pRenderTarget); + pDeviceD3D11->CreateTexture2DFromD3DResource(pd3d11RenderTarget, RESOURCE_STATE_UNDEFINED, &pRenderTarget); auto *pd3d11DepthBuffer = reinterpret_cast(nativeDepthTextureHandle); RefCntAutoPtr pDepthBuffer; - pDeviceD3D11->CreateTextureFromD3DResource(pd3d11DepthBuffer, RESOURCE_STATE_UNDEFINED, &pDepthBuffer); + pDeviceD3D11->CreateTexture2DFromD3DResource(pd3d11DepthBuffer, RESOURCE_STATE_UNDEFINED, &pDepthBuffer); CreateTextureViews(pRenderTarget, pDepthBuffer); } diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp index 05c76d9..edb3fc2 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/RenderAPI_D3D12.cpp @@ -18,8 +18,8 @@ #include "RenderDeviceD3D12.h" #include "CommandQueueD3D12.h" #include "TextureD3D12.h" -#include "ObjectBase.h" -#include "DefaultRawMemoryAllocator.h" +#include "ObjectBase.hpp" +#include "DefaultRawMemoryAllocator.hpp" using namespace Diligent; diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp index 05321af..0b3e3c7 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp +++ b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.cpp @@ -1,7 +1,7 @@ #include "SamplePlugin.h" #include "GraphicsUtilities.h" -#include "MapHelper.h" +#include "MapHelper.hpp" using namespace Diligent; @@ -51,7 +51,7 @@ SamplePlugin::SamplePlugin(Diligent::IRenderDevice *pDevice, bool UseReverseZ, T PSODesc.GraphicsPipeline.DSVFormat = DSVFormat; PSODesc.GraphicsPipeline.PrimitiveTopology = PRIMITIVE_TOPOLOGY_TRIANGLE_LIST; PSODesc.GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_BACK; - PSODesc.GraphicsPipeline.RasterizerDesc.FrontCounterClockwise = deviceType == DeviceType::D3D11 || deviceType == DeviceType::D3D12 ? true : false; + PSODesc.GraphicsPipeline.RasterizerDesc.FrontCounterClockwise = deviceType == RENDER_DEVICE_TYPE_D3D11 || deviceType == RENDER_DEVICE_TYPE_D3D12 ? true : false; PSODesc.GraphicsPipeline.DepthStencilDesc.DepthFunc = UseReverseZ ? COMPARISON_FUNC_GREATER_EQUAL : COMPARISON_FUNC_LESS_EQUAL; PSODesc.GraphicsPipeline.BlendDesc.RenderTargets[0].BlendEnable = True; diff --git a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h index 291149f..0becc7f 100644 --- a/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h +++ b/unityplugin/GhostCubePlugin/PluginSource/src/SamplePlugin.h @@ -2,9 +2,9 @@ #include "RenderDevice.h" #include "DeviceContext.h" -#include "RefCntAutoPtr.h" +#include "RefCntAutoPtr.hpp" #include "RenderAPI.h" -#include "BasicMath.h" +#include "BasicMath.hpp" class SamplePlugin { -- cgit v1.2.3