Graphics.h 823 B

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