summaryrefslogtreecommitdiff
path: root/sample/d3d11/Effects11/EffectAPI.cpp
diff options
context:
space:
mode:
authorJason Maskell <[email protected]>2016-05-09 10:39:54 +0200
committerJason Maskell <[email protected]>2016-05-09 10:39:54 +0200
commit79b3462799c28af8ba586349bd671b1b56e72353 (patch)
tree3b06e36c390254c0dc7f3733a0d32af213d87293 /sample/d3d11/Effects11/EffectAPI.cpp
downloadwaveworks_archive-79b3462799c28af8ba586349bd671b1b56e72353.tar.xz
waveworks_archive-79b3462799c28af8ba586349bd671b1b56e72353.zip
Initial commit with PS4 and XBone stuff trimmed.
Diffstat (limited to 'sample/d3d11/Effects11/EffectAPI.cpp')
-rw-r--r--sample/d3d11/Effects11/EffectAPI.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/sample/d3d11/Effects11/EffectAPI.cpp b/sample/d3d11/Effects11/EffectAPI.cpp
new file mode 100644
index 0000000..e373e51
--- /dev/null
+++ b/sample/d3d11/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<UINT>(DataLength)) );
+ VH( ((CEffect*)(*ppEffect))->BindToDevice(pDevice) );
+
+lExit:
+ if (FAILED(hr))
+ {
+ SAFE_RELEASE(*ppEffect);
+ }
+ return hr;
+}