graphics.h 589 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef SRC_GRAPHICS_H
  2. #define SRC_GRAPHICS_H
  3. typedef struct Rect Rect_t;
  4. struct Rect
  5. {
  6. int x, y, w, h;
  7. };
  8. /*
  9. * Buffer management
  10. */
  11. void buffer_allocate();
  12. void buffer_free();
  13. void buffer_swap();
  14. void buffer_fill(unsigned color);
  15. /*
  16. * Misc LCD functions
  17. */
  18. void lcd_vsync();
  19. /*
  20. * Drawing
  21. */
  22. void draw_pixel(unsigned x, unsigned y, unsigned short color);
  23. void draw_sprite_sheet(const unsigned short *sheet, int x, int y, const Rect_t *window);
  24. /*
  25. * Sprite manipulation
  26. */
  27. unsigned short sprite_pixel_get(const unsigned short *sprite, unsigned x, unsigned y);
  28. #endif