0
votes

I'm trying to follow this simple Direct3D tutorial by Microsoft online here: http://msdn.microsoft.com/en-us/library/windows/apps/ff729719.aspx.

I've downloaded the source code, and for the life of me I can't get the code to execute properly! I'm using Visual Studio 2013 and the windows kit 8.1 DirectX SDK. I have the .hlsl and .fx files in the proper directory, but the vertex shader will not compile at run time. I've tried fiddling with a lot of the settings on visual studio, but nothing has worked thus far.

Any help would be appreciated!

EDIT: The issue is the .hlsl and .fx files are not in the same folder as the .exe file built by VS. I'm not sure how to have VS move the files to the same folder when the project is built.

1
Would you mind sharing the error message with us? Is this a desktop or Windows Store app? Windows Store apps can't compile shaders at runtime. - Nico Schertler
I'm not sure how to get the error message. The code causing the issue is: - maxbart
hr = D3DCompileFromFile( szFileName, nullptr, nullptr, szEntryPoint, szShaderModel, dwShaderFlags, 0, ppBlobOut, &pErrorBlob ); - maxbart
I've actually found that the issue is the .hlsl and .fx are not in the same folder as the .exe that VS makes. I'm not sure how to get them there by default, but pasting them into the folder and running the .exe that way worked. - maxbart

1 Answers

0
votes

The legacy DirectX SDK sample projects need modification to build with VS 2012/Windows 8.0 SDK or VS 2013/Windows 8.1 SDK. See MSDN for the details.

Rather than using the legacy DirectX SDK at all, you could just use the Direct3D tutorial for Win32 desktop on MSDN Code Gallery which builds with just VS 2013/Windows 8.1 SDK.