i made a very simple pixel shader to test D3DXEFFECT, but i'm having a little problem with it..
creation code:
GeSHi (cpp):
LPD3DXEFFECT eff;
LPD3DXBUFFER buf;
if (FAILED(D3DXCreateEffectFromFileA(App.GetDevice(),"myshader.fx",NULL,NULL,0,NULL,&eff,&buf)))
{
if (buf) std::cout << (char*)buf->GetBufferPointer() << std::endl;
}
Created by GeSHI 1.0.7.18
draw code:
GeSHi (cpp):
App.GetDevice()->Clear(0,NULL,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,D3DCOLOR_XRGB(128,128,128),1.0f,0);
App.GetDevice()->BeginScene();
eff->SetTechnique("mytechnique");
eff->BeginPass(0);
App.GetDevice()->SetFVF(D3DFVF_DEFAULT);
App.GetDevice()->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,2,mQuad,sizeof(D3DVERTEX_DEFAULT));
eff->EndPass();
///... draw more...
App.GetDevice()->EndScene();
App.GetDevice()->Present(NULL,NULL,NULL,NULL);
Created by GeSHI 1.0.7.18
i think the problem is in my draw code.. the quad i'm drawing remains unchanged
or maybe it's my shader:
float4 psmain(float2 Pos:TEXCOORD0):COLOR0
{
return float4(0.0,0.0,1.0,1.0);
}
technique mytechnique
{
pass p0
{
VertexShader = null;
PixelShader = compile ps_2_0 psmain();
}
}