Support Version number and change font to BIOS for ControllerTest

This commit is contained in:
2024-01-05 13:35:37 -06:00
parent 60aa84ef28
commit 111a42a7e1
3 changed files with 23 additions and 6 deletions

View File

@@ -30,6 +30,15 @@ namespace JabyEngine {
constexpr GPU::SizeU16 get_font_size() const {
return GPU::SizeU16::from(this->render_info.font_size);
}
constexpr GPU::SizeU16 get_kern_size() const {
return GPU::SizeU16::from(this->render_info.kern_size);
}
template<size_t Size>
constexpr size_t estimate_str_render_length(const char (&str)[Size]) const {
return (Size - 1)*FontInfo::get_kern_size().width;
}
};
struct Cursor {
@@ -39,6 +48,11 @@ namespace JabyEngine {
static constexpr Cursor create(GPU::PositionI16 pos, uint8_t wiggle_count = 0) {
return Cursor{.pos = pos, .wiggle_count = wiggle_count};
}
constexpr Cursor& change_position(GPU::PositionI16 pos) {
this->pos = pos;
return *this;
}
};
using Wiggle = GPU::PositionI8[8];