Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 02 Oct 2012
Offline Last Active Oct 02 2012 11:12 AM

Topics I've Started

Learning D3D; having issues creating shaders

02 October 2012 - 02:29 AM

So when I execute this code, my program crashes.

[source lang="cpp"]//load vertex and pixel shadersID3D10Blob *VS, *PS;D3DX11CompileFromFile(L"shaders.hlsl", 0, 0, "VShader", "vs_5_0", 0, 0, 0, &VS, 0, 0);D3DX11CompileFromFile(L"shaders.hlsl", 0, 0, "PShader", "ps_5_0", 0, 0, 0, &PS, 0, 0);//create shader objectsdev->CreateVertexShader(VS->GetBufferPointer(), VS->GetBufferSize(), NULL, &pVS);dev->CreatePixelShader(PS->GetBufferPointer(), PS->GetBufferSize(), NULL, &pPS);[/source]
Despite having the shaders written to them, the blobs are null after the CompileFromFile functions and cause the program to crash when they're dereferenced on the next lines. I'm willing to bet it's because there is no "shaders.hlsl" in my project directory, but then I don't know where it would be. Do I have to download it from somewhere or am I missing something?