при вызове в хуке present(17 идекс или что это EndScene) не отрисовывается не чего
Код:
void render_Line(IDirect3DDevice9* m_pDevice, float startX, float startY, float endX, float endY)
{
D3DTLVERTEX Vertex[2] = {
{ (float)startX, (float)startY, 0.0f, 1.0f, D3DCOLOR_ARGB(255,252,35, 255) },
{ (float)endX, (float)endY, 1.0f, 1.0f, D3DCOLOR_ARGB(255,252,35, 255) },
};
const DWORD FVFTL = D3DFVF_XYZRHW | D3DFVF_DIFFUSE;
IDirect3DBaseTexture9* pTexture = NULL;
DWORD dwLighting = 0, dwZEnable = 0, dwZFunc = 0, dwFVF = 0, dwColorOp = 0, dwColorArg = 0;
m_pDevice->GetTexture(0, &pTexture);
m_pDevice->GetRenderState(D3DRS_LIGHTING, &dwLighting);
m_pDevice->GetRenderState(D3DRS_ZENABLE, &dwZEnable);
m_pDevice->GetRenderState(D3DRS_ZFUNC, &dwZFunc);
m_pDevice->GetFVF(&dwFVF);
m_pDevice->GetTextureStageState(0, D3DTSS_COLOROP, &dwColorOp);
m_pDevice->GetTextureStageState(0, D3DTSS_COLORARG1, &dwColorArg);
m_pDevice->SetTexture(0, NULL);
m_pDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
m_pDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
m_pDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
m_pDevice->SetFVF(FVFTL);
m_pDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
m_pDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
m_pDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, 1, &Vertex, sizeof(D3DTLVERTEX));
m_pDevice->SetTexture(0, pTexture);
m_pDevice->SetRenderState(D3DRS_LIGHTING, dwLighting);
m_pDevice->SetRenderState(D3DRS_ZENABLE, dwZEnable);
m_pDevice->SetRenderState(D3DRS_ZFUNC, dwZFunc);
m_pDevice->SetFVF(dwFVF);
m_pDevice->SetTextureStageState(0, D3DTSS_COLOROP, dwColorOp);
m_pDevice->SetTextureStageState(0, D3DTSS_COLORARG1, dwColorArg);
}
HRESULT __stdcall EndSceen(IDirect3DDevice9* Device, const RECT* pSourceRect, const RECT* pDestRect, HWND hDestWindowOverride, const RGNDATA* pDirtyRegion)
{
render_Line(Device, 10, 20, 100, 1000);
return oEndSceen(Device, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
}
static IRender* GetTableD3d9dx()
{
return *(IRender**)(0x141E90050);
}
DWORD64* GetDevice()
{
return (DWORD64*)*(DWORD64*)((DWORD64)this + 0xA6E8);
}