Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. void MethodsLab1::DrawTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
  2. {
  3.     GAME_ENGINE->DrawLine(x1, y1, x2, y2);
  4.     GAME_ENGINE->DrawLine(x2, y2, x3, y3);
  5.     GAME_ENGINE->DrawLine(x3, y3, x1, y1);
  6. }
  7.  
  8. void MethodsLab1::DrawTriangle(POINT p1,POINT p2,POINT p3)
  9. {
  10.     GAME_ENGINE->DrawLine(p1.x, p1.y, p2.x, p2.y);
  11.     GAME_ENGINE->DrawLine(p2.x, p2.y, p3.x, p3.y);
  12.     GAME_ENGINE->DrawLine(p3.x, p3.y, p1.x, p1.y);
  13. }
  14.  
  15. void MethodsLab1::DrawLinearGradient(int x, int y, int height)
  16. {
  17.     for (int value = 0; value <= 255; value++)
  18.     {
  19.         GAME_ENGINE->SetColor(COLOR(0, 255 - value, value));
  20.         GAME_ENGINE->DrawLine(x + value, y, x + value, y + height);
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement