Original Post
Alright, i'm using D3DX10CreateEffectFromFile and its returning E_FAIL. However the issue arises with the ID3D10Blob output on the function, its returning nothing. I don't know whether this means somethings wrong with the arguments I'm passing or that DirectX just really does not like me.
Here is the code if anyone can help.
Specific function where its called.
Class its part of
Effect File
Here is the code if anyone can help.
Specific function where its called.
bool gShaderHandle::buildFX(LPCWSTR filename)
{
HRESULT hr = NULL;
ID3D10Blob* errorTwo = 0;
hr = D3DX10CreateEffectFromFile(filename,
NULL,
NULL,
"fx_4_0",
D3D10_SHADER_DEBUG,
0,
device,
0,
0,
&gEffect,
&errorTwo,
0);
if(FAILED(hr))
{
if(errorTwo)
{
MessageBoxA(0, (char*)errorTwo->GetBufferPointer(), 0, 0);
errorTwo->Release();
}
}
gTech = gEffect->GetTechniqueByName("techPass");
return true;
}Class its part of
class gShaderHandle
{
private:
ID3D10Effect* gEffect;
ID3D10EffectTechnique* gTech;
ID3D10InputLayout* gVertexLayout;
ID3D10Device* device;
public:
bool buildFX(LPCWSTR filename);
bool buildVertexLayouts();
ID3D10Effect* returnEffect();
ID3D10EffectTechnique* returnTech();
gShaderHandle(ID3D10Device* *device = NULL);
gShaderHandle(ID3D10Device* *device, bool WTF);
void modDevice(ID3D10Device* *d3ddevice);
};
Effect File
cbuffer cbPerObject
{
float4x4 gWVP;
};
void vs(float3 iPosL : POSITION,
float4 iColor : COLOR,
out float4 oPosH : SV_POSITION,
out float4 oColor : COLOR)
{
oPosH = mul(float4(iPosL, 1.0f), gWVP);
oColor = iColor;
}
float4 ps(float4 posH : SV_POSITION,
float4 color : COLOR) : SV_Target
{
return color;
}
technique10 techPass
{
pass P0
{
SetVertexShader( CompileShader( vs_4_0, vs() ) );
SetGeometryShader( NULL );
SetPixelShader( CompileShader( ps_4_0, ps() ) );
}
}