From 79b3462799c28af8ba586349bd671b1b56e72353 Mon Sep 17 00:00:00 2001 From: Jason Maskell Date: Mon, 9 May 2016 10:39:54 +0200 Subject: Initial commit with PS4 and XBone stuff trimmed. --- test/Effects11/EffectAPI.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/Effects11/EffectAPI.cpp (limited to 'test/Effects11/EffectAPI.cpp') diff --git a/test/Effects11/EffectAPI.cpp b/test/Effects11/EffectAPI.cpp new file mode 100644 index 0000000..e373e51 --- /dev/null +++ b/test/Effects11/EffectAPI.cpp @@ -0,0 +1,29 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) Microsoft Corporation. All Rights Reserved. +// +// File: EffectAPI.cpp +// Content: D3DX11 Effect DLL entry points +// +////////////////////////////////////////////////////////////////////////////// + +#include "pchfx.h" + +using namespace D3DX11Effects; + +HRESULT WINAPI D3DX11CreateEffectFromMemory(CONST void *pData, SIZE_T DataLength, UINT FXFlags, ID3D11Device *pDevice, ID3DX11Effect **ppEffect) +{ + HRESULT hr = S_OK; + + // Note that pData must point to a compiled effect, not HLSL + VN( *ppEffect = NEW CEffect( FXFlags & D3DX11_EFFECT_RUNTIME_VALID_FLAGS) ); + VH( ((CEffect*)(*ppEffect))->LoadEffect(pData, static_cast(DataLength)) ); + VH( ((CEffect*)(*ppEffect))->BindToDevice(pDevice) ); + +lExit: + if (FAILED(hr)) + { + SAFE_RELEASE(*ppEffect); + } + return hr; +} -- cgit v1.2.3