C++ Learning Community Forum
August 01, 2010, 03:11:53 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Hello. Smiley
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [solved] D3DXEFFECT Problem  (Read 703 times)
*brammie*
my rank:
C++ Freak
***
Posts: 309



View Profile WWW
« on: January 30, 2009, 10:33:34 PM »

i made a very simple pixel shader to test D3DXEFFECT, but i'm having a little problem with it..
creation code:
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:
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:
Code:
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();
}
}
« Last Edit: January 30, 2009, 10:40:07 PM by *brammie* » Logged
*brammie*
my rank:
C++ Freak
***
Posts: 309



View Profile WWW
« Reply #1 on: January 30, 2009, 10:40:29 PM »

oops.. thats kinda dumb.. xD
i forget eff->Begin() and eff->End()
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!