Explorar o código

Added pixel drawing abstraction.

Eiyeron Fulmincendii %!s(int64=10) %!d(string=hai) anos
pai
achega
ac111bb58d
Modificáronse 2 ficheiros con 11 adicións e 0 borrados
  1. 5 0
      platform/include/Graphics.h
  2. 6 0
      platform/nspire/Graphics.cpp

+ 5 - 0
platform/include/Graphics.h

@@ -43,6 +43,11 @@ namespace WalrusRPG
          * Fill the screen with a color
          */
         void fill(const WalrusRPG::Graphics::Pixel &color);
+
+        /*
+         * Draws a pixel on the screen.
+         */
+        void pixel(uint16_t x, uint16_t y, const WalrusRPG::Graphics::Pixel &color);
     }
 }
 

+ 6 - 0
platform/nspire/Graphics.cpp

@@ -35,3 +35,9 @@ void GRAPHICS::fill(const WalrusRPG::Graphics::Pixel &color)
 {
     CXfb::buffer_fill(color);
 }
+
+void GRAPHICS::pixel(uint16_t x, uint16_t y, const WalrusRPG::Graphics::Pixel &color)
+
+{
+    CXfb::draw_pixel(x, y, color.value);
+}