Code:
void CDirect3D::DrawTexQuad( LPDIRECT3DDEVICE9 pDevice, int x, int y, int w, int h , const D3DXVECTOR4 & uv, IDirect3DTexture9 * texture ) {
struct textured_vertex{
float x, y, z, rhw; // The transformed(screen space) position for the vertex.
float tu,tv; // Texture coordinates
};
textured_vertex qV[4] = {
{ (float)x , (float)(y+h), 0.0f, 0.0f, uv.x, uv.w },
{ (float)x , (float)y , 0.0f, 0.0f, uv.x, uv.y },
{ (float)(x+w), (float)(y+h), 0.0f, 0.0f, uv.z, uv.w },
{ (float)(x+w), (float)y , 0.0f, 0.0f, uv.z, uv.y }
};
pDevice->SetRenderState( D3DRS_ZENABLE,false );
DWORD state1, state2, state3;
pDevice->GetRenderState( D3DRS_ALPHABLENDENABLE, &state1 );
pDevice->GetRenderState(D3DRS_SRCBLEND,&state2);
pDevice->GetRenderState(D3DRS_DESTBLEND,&state3);
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
pDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);
pDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);
DWORD stage1, stage2, stage3;
pDevice->GetTextureStageState(0,D3DTSS_COLOROP, &stage1);
pDevice->GetTextureStageState(0,D3DTSS_COLORARG1,&stage2);
pDevice->GetTextureStageState(0,D3DTSS_COLORARG2,&stage3);
pDevice->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG1);
pDevice->SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
pDevice->SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_DIFFUSE); //Ignored
DWORD _fvf;
pDevice->GetFVF( &_fvf );
pDevice->SetFVF( D3DFVF_XYZRHW | D3DFVF_TEX1 );
pDevice->SetPixelShader(NULL);
pDevice->SetTexture(0, texture );
pDevice->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 2, qV, sizeof( textured_vertex ) );
pDevice->SetFVF( _fvf );
pDevice->SetTextureStageState(0,D3DTSS_COLOROP,stage1);
pDevice->SetTextureStageState(0,D3DTSS_COLORARG1,stage2);
pDevice->SetTextureStageState(0,D3DTSS_COLORARG2,stage3); //Ignored
pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, stage1 );
pDevice->SetRenderState(D3DRS_SRCBLEND, stage2 );
pDevice->SetRenderState(D3DRS_DESTBLEND, stage3 );
}
da und mach dir eine eign Draw Function.
Code ist von jfareal aber benutze ihn Selber.
Edit:Wenn der Hack ingame sein soll wie wollt ihr das dann mit AutoIt und D3D Lib machen ?