Advertisement
Guest User

QTS no. 3 - Primitive line drawing function

a guest
Jul 9th, 2010
1,108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. /*
  2. -----------------------------------------
  3. * Game hacking QTS ( Quickie Tip Series )
  4. * no. 3 - Primitive line 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. LPD3DXLINE g_pLine; // global
  23.  
  24. void DrawLine ( long Xa, long Ya, long Xb, long Yb, DWORD dwWidth, D3DCOLOR Color )
  25. {
  26. D3DXVECTOR2 vLine[ 2 ]; // Two points
  27. g_pLine->SetAntialias( 0 ); // To smooth edges
  28.  
  29. g_pLine->SetWidth( dwWidth ); // Width of the line
  30. g_pLine->Begin();
  31.  
  32. vLine[ 0 ][ 0 ] = Xa; // Set points into array
  33. vLine[ 0 ][ 1 ] = Ya;
  34. vLine[ 1 ][ 0 ] = Xb;
  35. vLine[ 1 ][ 1 ] = Yb;
  36.  
  37. g_pLine->Draw( vLine, 2, Color ); // Draw with Line, number of lines, and color
  38. g_pLine->End(); // finish
  39. }
  40. //----------------------------------//
  41.  
  42. //----------------------------------//
  43. if( !g_pLine )
  44. D3DXCreateLine( pDevice, &g_pLine ); // Make sure to create before calling DrawLine, use in endscene, present, etc
  45. //----------------------------------//
  46. // Make sure to reset as well to avoid crashes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement