Browse Source

Added pixel drawing abstraction.

Eiyeron Fulmincendii 10 years ago
parent
commit
ac111bb58d
2 changed files with 11 additions and 0 deletions
  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
          * Fill the screen with a color
          */
          */
         void fill(const WalrusRPG::Graphics::Pixel &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);
     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);
+}