Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. struct D3DTLVERTEX
  2. {
  3. float x, y, z, rhw;
  4. DWORD color;
  5. };
  6.  
  7. void CTools::DrawLine(LPDIRECT3DDEVICE9 pDevice, float x, float y, float x2, float y2, IDirect3DPixelShader9* pShader)
  8. {
  9. DWORD dwColor = D3DCOLOR_ARGB(255, 0, 0, 0);
  10. D3DTLVERTEX qV[2] = {
  11. { (float)x , (float)y, 0.0f, 1.0f, dwColor },
  12. { (float)x2 , (float)y2 , 0.0f, 1.0f, dwColor },
  13. };
  14.  
  15. pDevice->SetTexture(0, NULL);
  16. pDevice->SetPixelShader(pShader);
  17. pDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
  18. pDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
  19. pDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1);
  20. pDevice->DrawPrimitiveUP(D3DPT_LINELIST, 2, qV, sizeof(D3DTLVERTEX));
  21. pDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
  22. pDevice->SetRenderState(D3DRS_STENCILENABLE, TRUE);
  23. pDevice->SetPixelShader(pShader);
  24. pDevice->SetTexture(1, NULL);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement