aboutsummaryrefslogtreecommitdiffstats
path: root/include/pixel/pixel.hpp
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-03-20 02:38:20 +0100
committerSven Göthel <[email protected]>2024-03-20 02:38:20 +0100
commit4bbd02e2b6f878bc6593c17cf98ced68d9dcc617 (patch)
tree5a47b822452ef71cdf765d04329d5fbdb5bed26d /include/pixel/pixel.hpp
parenteb4cac59ae6343ef8369b5ad8e9ef2b3a6a8df04 (diff)
make_text: Add variant w/ custom font_size; texture_t adds custom dest_s[xy] (dest-scale)
Diffstat (limited to 'include/pixel/pixel.hpp')
-rw-r--r--include/pixel/pixel.hpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/include/pixel/pixel.hpp b/include/pixel/pixel.hpp
index e3fadb3..308b6d1 100644
--- a/include/pixel/pixel.hpp
+++ b/include/pixel/pixel.hpp
@@ -367,12 +367,16 @@ namespace pixel {
int dest_x;
/** dest texture pos-y */
int dest_y;
+ /** dest texture scale-x */
+ float dest_sx;
+ /** dest texture scale-y */
+ float dest_sy;
texture_t(void* data_, const int x_, const int y_, const int width_, const int height_) noexcept
- : data(data_), x(x_), y(y_), width(width_), height(height_), dest_x(0), dest_y(0) {}
+ : data(data_), x(x_), y(y_), width(width_), height(height_), dest_x(0), dest_y(0), dest_sx(1), dest_sy(1) {}
texture_t() noexcept
- : data(nullptr), x(0), y(0), width(0), height(0), dest_x(0), dest_y(0) {}
+ : data(nullptr), x(0), y(0), width(0), height(0), dest_x(0), dest_y(0), dest_sx(1), dest_sy(1) {}
texture_t(const texture_t&) = delete;
void operator=(const texture_t&) = delete;
@@ -404,9 +408,15 @@ namespace pixel {
texture_ref make_text_texture(const std::string& text) noexcept;
- texture_ref make_text(const pixel::f2::point_t& origin, const int lineno,
- const std::string& text,
- const pixel::f4::vec_t& color) noexcept;
+ texture_ref make_text(const pixel::f2::point_t& tl, const int lineno,
+ const pixel::f4::vec_t& color, const int font_height_usr,
+ const std::string& text) noexcept;
+
+ inline texture_ref make_text(const pixel::f2::point_t& tl, const int lineno,
+ const pixel::f4::vec_t& color,
+ const std::string& text) noexcept {
+ return make_text(tl, lineno, color, font_height, text);
+ }
//
// input