瀏覽代碼

Added pixel drawing abstraction.

Eiyeron Fulmincendii 10 年之前
父節點
當前提交
ac111bb58d
共有 2 個文件被更改,包括 11 次插入0 次删除
  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);
+}