Advertisement
Guest User

QTS no. 4 - Primitive rectangle drawing function

a guest
Jul 2nd, 2010
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. /*
  2. -----------------------------------------
  3. * Game hacking QTS ( Quickie Tip Series )
  4. * no. 4 - Primitive rectangle drawing function
  5. -----------------------------------------
  6. * Author: SEGnosis - GHAnon.net
  7. * Thanks to:
  8. * bitterbanana - No known site
  9. * Drunken Cheetah - No known site
  10. * fatboy88 - No known site
  11. * Geek4Ever - No known site
  12. * learn_more - www.uc-forum.com
  13. * Novocaine - http://ilsken.net/blog/?page_id=64
  14. * Philly0494 - No known site
  15. * Roverturbo - www.uc-forum.com
  16. * SilentKarma - www.halocoders.com - offline
  17. * Strife - www.uc-forum.com
  18. * Wieter20 - No known site
  19. */
  20.  
  21. //----------------------------------//
  22. // Uses same Line variable as from no. 3 - Primitive line drawing function.
  23. // Why this is better than Clear() is because it supports alpha transparency.
  24.  
  25. void DrawRect ( long X, long Y, long W, long H, D3DCOLOR Color )
  26. {
  27. D3DXVECTOR2 vLine[ 2 ];
  28. g_pLine->SetWidth( W );
  29. g_pLine->SetAntialias( 0 );
  30. g_pLine->SetGLLines( 1 );
  31.  
  32. g_pLine->SetWidth( W );
  33. g_pLine->Begin();
  34.  
  35. vLine[ 0 ][ 0 ] = X+W/2;
  36. vLine[ 0 ][ 1 ] = Y;
  37. vLine[ 1 ][ 0 ] = X+W/2;
  38. vLine[ 1 ][ 1 ] = Y+H;
  39.  
  40. g_pLine->Draw( vLine, 2, Color );
  41. g_pLine->End();
  42. }
  43. //----------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement