graphics.h 680 B

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