【发布时间】:2015-06-10 13:24:01
【问题描述】:
我可能忽略了一些简单的事情,但是着色器编译调用的编译声称没有重载函数的实例,尽管代码在其他项目中工作。
//Globals
IDXGISwapChain *swapChain; //Pointer to the swapchain interface
ID3D11Device *dev; //Pointer to the Direct3D Device interface
ID3D11DeviceContext *devcon; //Pointer to the Direct3D Device context
ID3D11RenderTargetView *backBuffer;
//Shaders
ID3D11VertexShader* pVS;
ID3D11PixelShader* pPS;
void InitPipeline()
{
//Load and Compile Shaders
ID3D10Blob *VS;
ID3D10Blob *PS;
D3DX11CompileFromFile(L"shader.shader", 0, 0, "VShader", "vs_4_0", 0, 0, 0, &VS, 0, 0);
D3DX11CompileFromFile(L"shader.shader", 0, 0, "PShader", "ps_4_0", 0, 0, 0, &PS, 0, 0);
//encapsulate shaders into shader objects
dev->CreateVertexShader(VS->GetBufferPointer(), VS->GetBufferSize(), NULL, &pVS);
dev->CreatePixelShader(PS->GetBufferPointer(), PS->GetBufferSize(), NULL, &pPS);
//Set Shader Objects
devcon->VSSetShader(pVS, 0, 0);
devcon->PSSetShader(pPS, 0, 0);
}
错误是:
no instance of overloaded function "D3DX11CompileFromFileA" matches the argument list argument types are: (const wchar_t [14], int, int, const char [8], const char [7], int, int, int, ID3D10Blob **, int, int)
【问题讨论】:
-
请给出您遇到的错误的文本。
-
1 IntelliSense:没有重载函数“D3DX11CompileFromFileA”的实例与参数列表参数类型匹配:(const wchar_t [14], int, int, const char [8], const char [7], int, int, int, ID3D10Blob **, int, int) d:\Documents\GitHub\Matrixology\Engine\Engine\D3D.cpp 73