GfxContext renamed to DrawContext

This commit is contained in:
MihailRis
2024-04-30 00:31:13 +03:00
parent 4af0a8acf7
commit bcf2f5029d
37 changed files with 101 additions and 101 deletions
+39
View File
@@ -0,0 +1,39 @@
#ifndef GRAPHICS_CORE_GFX_CONTEXT_HPP_
#define GRAPHICS_CORE_GFX_CONTEXT_HPP_
#include "commons.hpp"
#include "Viewport.hpp"
#include "../../window/Window.h"
#include "../../typedefs.h"
class Batch2D;
class Framebuffer;
class DrawContext {
const DrawContext* parent;
Viewport viewport;
Batch2D* const g2d;
Framebuffer* fbo = nullptr;
bool depthMask = true;
bool depthTest = false;
bool cullFace = false;
BlendMode blendMode = BlendMode::normal;
int scissorsCount = 0;
public:
DrawContext(const DrawContext* parent, const Viewport& viewport, Batch2D* g2d);
~DrawContext();
Batch2D* getBatch2D() const;
const Viewport& getViewport() const;
DrawContext sub() const;
void setViewport(const Viewport& viewport);
void setFramebuffer(Framebuffer* fbo);
void setDepthMask(bool flag);
void setDepthTest(bool flag);
void setCullFace(bool flag);
void setBlendMode(BlendMode mode);
void setScissors(glm::vec4 area);
};
#endif // GRAPHICS_CORE_GFX_CONTEXT_HPP_