graphics.h 609 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_copy();
  15. void buffer_fill(unsigned color);
  16. /*
  17. * Misc LCD functions
  18. */
  19. void lcd_vsync();
  20. /*
  21. * Drawing
  22. */
  23. void draw_pixel(unsigned x, unsigned y, unsigned short color);
  24. void draw_sprite_sheet(const unsigned short *sheet, int x, int y, const Rect_t *window);
  25. /*
  26. * Sprite manipulation
  27. */
  28. unsigned short sprite_pixel_get(const unsigned short *sprite, unsigned x, unsigned y);
  29. #endif