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