diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
| commit | e4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch) | |
| tree | ed58c3c246e3af1af337697695d780aa31f6ad9a /src/client/draw.hh | |
| parent | 1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff) | |
Update to most recent version (old initial commit)
Diffstat (limited to 'src/client/draw.hh')
| -rw-r--r-- | src/client/draw.hh | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/client/draw.hh b/src/client/draw.hh deleted file mode 100644 index 821d67b..0000000 --- a/src/client/draw.hh +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef CLIENT_DRAW_HH_ -#define CLIENT_DRAW_HH_ - -#include <string_view> - -#include <glm/glm.hpp> - -#include "client/movement.hh" -#include "client/player.hh" -#include "client/render/camera.hh" -#include "client/render/render.hh" -#include "client/render/program.hh" -#include "client/shared.hh" -#include "client/window.hh" -#include "client/world.hh" - -namespace client { -namespace draw { - -// Scale takes the range [0, 1] and represents an amount of the screen. -// Offset is any value that is added after scale. -struct relative_arg { - glm::vec2 extent; - glm::vec2 offset; - - glm::vec2 to_vec2() const noexcept { - const glm::vec2& window = render::get_window_size(); - const float x = this->extent.x * window.x + this->offset.x; - const float y = this->extent.y * window.y + this->offset.y; - return {x, y}; - } -}; - -struct rectangle_args { - relative_arg pos; - relative_arg size; - glm::vec4 colour; -}; - -struct text_args { - relative_arg pos; - float extent_height; // we don't get width here, - float offset_height; - glm::vec4 colour; - bool has_backing; - bool is_centered; - bool is_vcentered; -}; - -void draw_rectangle(const rectangle_args& args) noexcept; -void draw_colour(const glm::vec4& colour) noexcept; -void draw_text(const std::string_view text, const text_args& args) noexcept; - -void draw(client::players& players, client::world::chunk::map& chunks) noexcept; - -} // namespace draw -} // namespace client - -#endif |
