update DrawContext

This commit is contained in:
MihailRis
2024-07-21 16:06:40 +03:00
parent cf12338a32
commit 3590bd14cd
9 changed files with 67 additions and 45 deletions
+6 -2
View File
@@ -12,19 +12,22 @@ class DrawContext {
const DrawContext* parent;
Viewport viewport;
Batch2D* const g2d;
Flushable* flushable = nullptr;
Framebuffer* fbo = nullptr;
bool depthMask = true;
bool depthTest = false;
bool cullFace = false;
BlendMode blendMode = BlendMode::normal;
int scissorsCount = 0;
float lineWidth = 1.0f;
public:
DrawContext(const DrawContext* parent, Viewport viewport, Batch2D* g2d);
DrawContext(const DrawContext* parent, Viewport viewport, Batch2D* g2d);
~DrawContext();
Batch2D* getBatch2D() const;
const Viewport& getViewport() const;
DrawContext sub() const;
DrawContext sub(Flushable* flushable=nullptr) const;
void setViewport(const Viewport& viewport);
void setFramebuffer(Framebuffer* fbo);
@@ -33,6 +36,7 @@ public:
void setCullFace(bool flag);
void setBlendMode(BlendMode mode);
void setScissors(glm::vec4 area);
void setLineWidth(float width);
};
#endif // GRAPHICS_CORE_GFX_CONTEXT_HPP_