graphics.h 1.1 KB

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include <gui/gui.h>
  3. #include "vec2.h"
  4. // Use to draw table elements, which live on a 640 x 1280 grid
  5. // These methods will scale and round the coordinates
  6. // Also, they will (eventually) handle cases where the thing we're drawing
  7. // lies outside the table bounds.
  8. void gfx_draw_line(Canvas* canvas, float x1, float y1, float x2, float y2);
  9. void gfx_draw_line(Canvas* canvas, const Vec2& p1, const Vec2& p2);
  10. void gfx_draw_line_thick(Canvas* canvas, float x1, float y1, float x2, float y2, int thickness);
  11. void gfx_draw_line_thick(Canvas* canvas, const Vec2& p1, const Vec2& p2, int thickness);
  12. void gfx_draw_disc(Canvas* canvas, float x, float y, float r);
  13. void gfx_draw_disc(Canvas* canvas, const Vec2& p, float r);
  14. void gfx_draw_circle(Canvas* canvas, float x, float y, float r);
  15. void gfx_draw_circle(Canvas* canvas, const Vec2& p, float r);
  16. void gfx_draw_dot(Canvas* canvas, float x, float y);
  17. void gfx_draw_dot(Canvas* canvas, const Vec2& p);
  18. void gfx_draw_arc(Canvas* canvas, const Vec2& p, float r, float start, float end);
  19. // Uses the micro font
  20. void gfx_draw_str(Canvas* canvas, int x, int y, Align h, Align v, const char* str);