refactor textures access

This commit is contained in:
MihailRis
2024-11-01 02:13:21 +03:00
parent 673f235ff9
commit 4f377b2056
13 changed files with 74 additions and 49 deletions
+2 -2
View File
@@ -17,7 +17,7 @@ class Batch2D : public Flushable {
std::unique_ptr<Texture> blank;
size_t index;
glm::vec4 color;
Texture* currentTexture;
const Texture* currentTexture;
DrawPrimitive primitive = DrawPrimitive::triangle;
UVRegion region {0.0f, 0.0f, 1.0f, 1.0f};
@@ -40,7 +40,7 @@ public:
~Batch2D();
void begin();
void texture(Texture* texture);
void texture(const Texture* texture);
void untexture();
void setRegion(UVRegion region);
void sprite(float x, float y, float w, float h, const UVRegion& region, glm::vec4 tint);