Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct D3DTLVERTEX
- {
- float x, y, z, rhw;
- DWORD color;
- };
- void CTools::DrawLine(LPDIRECT3DDEVICE9 pDevice, float x, float y, float x2, float y2, IDirect3DPixelShader9* pShader)
- {
- DWORD dwColor = D3DCOLOR_ARGB(255, 0, 0, 0);
- D3DTLVERTEX qV[2] = {
- { (float)x , (float)y, 0.0f, 1.0f, dwColor },
- { (float)x2 , (float)y2 , 0.0f, 1.0f, dwColor },
- };
- pDevice->SetTexture(0, NULL);
- pDevice->SetPixelShader(pShader);
- pDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
- pDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
- pDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1);
- pDevice->DrawPrimitiveUP(D3DPT_LINELIST, 2, qV, sizeof(D3DTLVERTEX));
- pDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
- pDevice->SetRenderState(D3DRS_STENCILENABLE, TRUE);
- pDevice->SetPixelShader(pShader);
- pDevice->SetTexture(1, NULL);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement