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
+3 -3
View File
@@ -9,7 +9,7 @@
#include "../graphics/core/Batch2D.hpp"
#include "../graphics/core/Batch3D.hpp"
#include "../graphics/core/Font.hpp"
#include "../graphics/core/GfxContext.hpp"
#include "../graphics/core/DrawContext.hpp"
#include "../graphics/core/Mesh.hpp"
#include "../graphics/core/Shader.hpp"
#include "../graphics/core/Texture.hpp"
@@ -422,7 +422,7 @@ void Hud::remove(std::shared_ptr<UINode> node) {
cleanup();
}
void Hud::draw(const GfxContext& ctx){
void Hud::draw(const DrawContext& ctx){
const Viewport& viewport = ctx.getViewport();
const uint width = viewport.getWidth();
const uint height = viewport.getHeight();
@@ -440,7 +440,7 @@ void Hud::draw(const GfxContext& ctx){
// Crosshair
if (!pause && !inventoryOpen && !player->debug) {
GfxContext chctx = ctx.sub();
DrawContext chctx = ctx.sub();
chctx.setBlendMode(BlendMode::inversion);
auto texture = assets->getTexture("gui/crosshair");
batch->texture(texture);
+2 -2
View File
@@ -16,7 +16,7 @@ class Engine;
class Inventory;
class LevelFrontend;
class UiDocument;
class GfxContext;
class DrawContext;
class Viewport;
namespace gui {
@@ -116,7 +116,7 @@ public:
~Hud();
void update(bool hudVisible);
void draw(const GfxContext& context);
void draw(const DrawContext& context);
/// @brief Check if inventory mode on
bool isInventoryOpen() const;
+3 -3
View File
@@ -6,7 +6,7 @@
#include "../../audio/audio.h"
#include "../../coders/imageio.hpp"
#include "../../graphics/core/PostProcessing.h"
#include "../../graphics/core/GfxContext.hpp"
#include "../../graphics/core/DrawContext.hpp"
#include "../../graphics/core/Viewport.hpp"
#include "../../graphics/core/ImageData.hpp"
#include "../../graphics/ui/GUI.hpp"
@@ -79,7 +79,7 @@ void LevelScreen::saveWorldPreview() {
Camera camera = *player->camera;
camera.setFov(glm::radians(70.0f));
Viewport viewport(previewSize * 1.5, previewSize);
GfxContext ctx(nullptr, viewport, batch.get());
DrawContext ctx(nullptr, viewport, batch.get());
worldRenderer->draw(ctx, &camera, false, postProcessing.get());
auto image = postProcessing->toImage();
@@ -141,7 +141,7 @@ void LevelScreen::draw(float delta) {
auto camera = controller->getPlayer()->currentCamera;
Viewport viewport(Window::width, Window::height);
GfxContext ctx(nullptr, viewport, batch.get());
DrawContext ctx(nullptr, viewport, batch.get());
worldRenderer->draw(ctx, camera.get(), hudVisible, postProcessing.get());