#pragma once
#include <Adafruit_GFX.h>
#include "GTag6Display.h"

class GTag6GFX : public Adafruit_GFX {
public:
    explicit GTag6GFX(GTag6Display& d)
        : Adafruit_GFX(GTag6Display::W, GTag6Display::H), d_(d) {}

    void drawPixel(int16_t x, int16_t y, uint16_t color) override {
        d_.pixel(x, y, color != 0);
    }

    void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) override {
        d_.hline(x, y, w, color != 0);
    }
    void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) override {
        d_.vline(x, y, h, color != 0);
    }
    void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) override {
        d_.fillRect(x, y, w, h, color != 0);
    }

    void flush() { d_.show(); }
    void clearScreen(bool black = false) { d_.clear(black); }

private:
    GTag6Display& d_;
};