diff options
Diffstat (limited to 'src/renderer/Renderer.hpp')
| -rw-r--r-- | src/renderer/Renderer.hpp | 37 | 
1 files changed, 21 insertions, 16 deletions
diff --git a/src/renderer/Renderer.hpp b/src/renderer/Renderer.hpp index 4fdf524..fc037d6 100644 --- a/src/renderer/Renderer.hpp +++ b/src/renderer/Renderer.hpp @@ -1,6 +1,8 @@  #pragma once -#include <basic/math.hpp> +#include <common/math.hpp> +#include <common/Font.hpp> +#include <common/shapes.hpp>  #include <SDL3/SDL.h>  #include <SDL3/SDL_video.h> @@ -19,32 +21,35 @@ extern Renderer g_renderer;  enum REntityType : int32_t {      REntityType_Rectangle,      REntityType_MonoBitmap, +    REntityType_Circle, +}; + +struct REntity_MonoBitmap { +    REntityType type; +    V3F32 pos; +    MonoBitmap& bitmap; +    Color color;  };  struct REntity_Rectangle {      REntityType type; -    float x0; -    float y0; -    float x1; -    float y1; +    Rectangle rect;      float z;      Color color;  }; -struct REntity_MonoBitmap { +struct REntity_Circle {      REntityType type; -    float x; -    float y; -    int32_t w; -    int32_t h; +    Circle circle;      float z; -    void *data; +    Color color;  };  union REntity {      REntityType type; -    REntity_Rectangle rect;      REntity_MonoBitmap bitmap; +    REntity_Rectangle rect; +    REntity_Circle circle;  };  struct RSortEntry { @@ -64,8 +69,9 @@ public:      void Reset();      void Clear(Color color); -    void PushRectangle(RectF32 rect, float z, Color color); -    void PushMonoBitmap(V3F32 pos, int w, int h, void* bitmap); +    void PushRectangle(Rectangle rect, float z, Color color); +    void PushMonoBitmap(MonoBitmap& bitmap, V3F32 pos, Color color); +    void PushCircle(Circle circle, float z, Color color);      /* helper functions */ @@ -82,6 +88,7 @@ public:      /* temporary helper functions (from old RGroup api) */ +      float GetScale();      V2F32 ViewPosToScreenPos(V2F32 view_pos);      V2F32 ViewSizeToScreenSize(V2F32 view_size); @@ -90,7 +97,6 @@ public: -    // Todo: make this private  public:      int32_t m_screen_w;      int32_t m_screen_h; @@ -102,7 +108,6 @@ public:      std::vector<REntity> m_render_entities;      std::vector<RSortEntry> m_sort_entries; -      std::unique_ptr<RSoftwareBackend> m_backend;  | 
