Graphics.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * Set a background color or texture to be used by frame_begin()
  36. * To be defined further
  37. */
  38. void set_bg(const WalrusRPG::Graphics::Pixel &new_bg);
  39. }
  40. }
  41. #endif