Graphics.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef INCLUDE_GRAPHICS_H
  2. #define INCLUDE_GRAPHICS_H
  3. /*
  4. * Graphics.h
  5. * Graphics backend abstraction
  6. */
  7. #include <cstdint>
  8. #include "render/Pixel.h"
  9. #include "utility/Rect.h"
  10. namespace WalrusRPG
  11. {
  12. namespace Graphics
  13. {
  14. void init();
  15. void deinit();
  16. /*
  17. * Allows doing stuff before drawing, the GC requires this,
  18. * and it's a nice to have
  19. */
  20. void frame_begin();
  21. /*
  22. * Signal the graphics system that we're done drawing so that
  23. * the frame can be pushed to the screen
  24. */
  25. void frame_end();
  26. /*
  27. * Current prototype is the same as the nspire fb implementation
  28. * for now, need to add a texture type and get rid of the Rect
  29. * (not sure the GC supports drawing parts of a texture, but it
  30. * may be worth trying
  31. */
  32. void put_sprite(const uint16_t *sheet, int x, int y,
  33. const WalrusRPG::Utils::Rect &window);
  34. /*
  35. * Fill the screen with a color
  36. */
  37. void fill(const WalrusRPG::Graphics::Pixel &color);
  38. }
  39. }
  40. #endif