Made DisplayDevice more robust

This commit is contained in:
Ken Van Hoeylandt 2025-09-06 23:01:55 +02:00
parent 67b79b0efa
commit a0c818b4ca
2 changed files with 11 additions and 12 deletions

View File

@ -13,19 +13,18 @@ public:
std::string getName() const override { return "SDL Display"; }
std::string getDescription() const override { return ""; }
bool start() override {
return displayHandle != nullptr;
}
bool start() override { return true; }
bool stop() override { tt_crash("Not supported"); }
bool supportsLvgl() const override { return true; }
bool startLvgl() override { return true; }
bool startLvgl() override { return displayHandle != nullptr; }
bool stopLvgl() override { tt_crash("Not supported"); }
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable getTouchDevice() override { return std::make_shared<SdlTouch>(); }
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
bool supportsDisplayDriver() const override { return false; }
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable getDisplayDriver() override { return nullptr; }
};
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {

View File

@ -34,16 +34,16 @@ public:
/** Set a value in the range [0, 255] */
virtual void setGammaCurve(uint8_t index) { /* NO-OP */ }
virtual uint8_t getGammaCurveCount() const { return 0; };
virtual uint8_t getGammaCurveCount() const { return 0; }
virtual bool supportsLvgl() const { return false; }
virtual bool startLvgl() { return false; }
virtual bool stopLvgl() { return false; }
virtual bool supportsLvgl() const = 0;
virtual bool startLvgl() = 0;
virtual bool stopLvgl() = 0;
virtual lv_display_t* _Nullable getLvglDisplay() const = 0;
virtual bool supportsDisplayDriver() const { return false; }
virtual std::shared_ptr<DisplayDriver> _Nullable getDisplayDriver() { return nullptr; }
virtual bool supportsDisplayDriver() const = 0;
virtual std::shared_ptr<DisplayDriver> _Nullable getDisplayDriver() = 0;
};
} // namespace tt::hal::display