Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using DirectX Effect11 with Visual Studio 2012

I recently updated to Visual Studio 2012 Ultimate. I was programming previously with DirectX 11 June 2010 SDK and want to continue to do so using Visual Studio 2012. However, I discovered that VS2012 comes with its own DirectX SDK (in Windows Kit 8.0) and I've been trying to migrate my code using the newer versions of d3d11. Everything went fine until I try to use effect files in my project (.fx files). I had to compile the Effects11 Sample in the DirectX SDK using VS2012 and link the lib file in my project. That went fine too. However, when I compile my project the function D3DX11CreateEffectFromMemory returns a E_NOINTERFACE error (no such interface is supported). Can anyone tell me why is that? Note that I'm using the d3d11.lib from the Windows Kit and the d3dx11.lib from the DirectX SDK. Perhaps I shouldn't mix them? However, everything else works fine when I mix them, except for the effect file creation.

Any help would be appreciated.

P.S. I don't know if this is helpful but just so you know, if I add an additional library directory in the project settings of "DirectXSDKInstallPath\lib\x86\" it works. Why is that? Does it mean I'm using the older version of the libraries? This will give a ton of warnings about redefined headers in winerror.h

like image 203
l3utterfly Avatar asked Nov 17 '25 17:11

l3utterfly


2 Answers

D3DX Library has been deprecated for the newest version of DirectX 11 (Windows 8). See http://msdn.microsoft.com/en-us/library/windows/desktop/bb172965(v=vs.85).aspx

Effects are now handled a different way. You can program your own library to load effects or use DirectX Tool Kit (DirectXTK): http://directxtk.codeplex.com/

Microsoft has recommended this tool kit on their web site, see http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx for more information.

like image 131
Carlos Ch Avatar answered Nov 19 '25 08:11

Carlos Ch


Effect11 has moved to https://fx11.codeplex.com/, you need to compile it and link yourself.

DirectXTK does not provide the effect11 interface, but only simplified effects

like image 28
bumpmann Avatar answered Nov 19 '25 08:11

bumpmann