Advertisement
TheGeek2004

Untitled

Aug 19th, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. void hMenuCore::hDrawBox(int x, int y, int w, int h, D3DCOLOR Color,LPDIRECT3DDEVICE9 pDevice)
  2. {
  3. struct Vertex
  4. {
  5. float x,y,z,ht;
  6. DWORD Color;
  7. };
  8. Vertex V[8];
  9.  
  10. V[0].Color = V[1].Color = V[2].Color = V[3].Color = Color;
  11. V[0].z = V[1].z = V[2].z = V[3].z = 0.0f;
  12. V[0].ht = V[1].ht = V[2].ht = V[3].ht = 0.0f;
  13.  
  14. V[0].x = V[1].x = (float)x;
  15. V[0].y = V[2].y = (float)(y + h);
  16. V[1].y = V[3].y = (float)y;
  17. V[2].x = V[3].x = (float)(x + w);
  18.  
  19. pDevice->SetPixelShader( 0 );
  20. pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
  21. pDevice->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA );
  22. pDevice->SetTexture( 0, 0 );
  23. pDevice->DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 2, V, sizeof( V[0] ) );
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement