GfxContext renamed to DrawContext
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#include "../core/Atlas.hpp"
|
||||
#include "../core/Batch3D.hpp"
|
||||
#include "../core/Framebuffer.hpp"
|
||||
#include "../core/GfxContext.hpp"
|
||||
#include "../core/DrawContext.hpp"
|
||||
#include "../core/Shader.hpp"
|
||||
#include "../core/Texture.hpp"
|
||||
#include "../core/Viewport.hpp"
|
||||
@@ -124,8 +124,8 @@ std::unique_ptr<Atlas> BlocksPreview::build(
|
||||
Atlas* atlas = assets->getAtlas("blocks");
|
||||
|
||||
Viewport viewport(iconSize, iconSize);
|
||||
GfxContext pctx(nullptr, viewport, nullptr);
|
||||
GfxContext ctx = pctx.sub();
|
||||
DrawContext pctx(nullptr, viewport, nullptr);
|
||||
DrawContext ctx = pctx.sub();
|
||||
ctx.setCullFace(true);
|
||||
ctx.setDepthTest(true);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "../../graphics/core/Texture.hpp"
|
||||
#include "../../graphics/core/Cubemap.hpp"
|
||||
#include "../../graphics/core/Framebuffer.hpp"
|
||||
#include "../../graphics/core/GfxContext.hpp"
|
||||
#include "../../graphics/core/DrawContext.hpp"
|
||||
#include "../../window/Window.h"
|
||||
#include "../../window/Camera.h"
|
||||
|
||||
@@ -91,7 +91,7 @@ void Skybox::drawStars(float angle, float opacity) {
|
||||
}
|
||||
|
||||
void Skybox::draw(
|
||||
const GfxContext& pctx,
|
||||
const DrawContext& pctx,
|
||||
Camera* camera,
|
||||
Assets* assets,
|
||||
float daytime,
|
||||
@@ -103,7 +103,7 @@ void Skybox::draw(
|
||||
|
||||
drawBackground(camera, assets, width, height);
|
||||
|
||||
GfxContext ctx = pctx.sub();
|
||||
DrawContext ctx = pctx.sub();
|
||||
ctx.setBlendMode(BlendMode::addition);
|
||||
|
||||
Shader* shader = assets->getShader("ui3d");
|
||||
@@ -134,8 +134,8 @@ void Skybox::draw(
|
||||
drawStars(angle, opacity);
|
||||
}
|
||||
|
||||
void Skybox::refresh(const GfxContext& pctx, float t, float mie, uint quality) {
|
||||
GfxContext ctx = pctx.sub();
|
||||
void Skybox::refresh(const DrawContext& pctx, float t, float mie, uint quality) {
|
||||
DrawContext ctx = pctx.sub();
|
||||
ctx.setDepthMask(false);
|
||||
ctx.setDepthTest(false);
|
||||
ctx.setFramebuffer(fbo.get());
|
||||
|
||||
@@ -13,7 +13,7 @@ class Assets;
|
||||
class Camera;
|
||||
class Batch3D;
|
||||
class Framebuffer;
|
||||
class GfxContext;
|
||||
class DrawContext;
|
||||
|
||||
struct skysprite {
|
||||
std::string texture;
|
||||
@@ -40,14 +40,14 @@ public:
|
||||
~Skybox();
|
||||
|
||||
void draw(
|
||||
const GfxContext& pctx,
|
||||
const DrawContext& pctx,
|
||||
Camera* camera,
|
||||
Assets* assets,
|
||||
float daytime,
|
||||
float fog
|
||||
);
|
||||
|
||||
void refresh(const GfxContext& pctx, float t, float mie, uint quality);
|
||||
void refresh(const DrawContext& pctx, float t, float mie, uint quality);
|
||||
void bind() const;
|
||||
void unbind() const;
|
||||
bool isReady() const {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "../../world/World.h"
|
||||
#include "../core/Atlas.hpp"
|
||||
#include "../core/Batch3D.hpp"
|
||||
#include "../core/GfxContext.hpp"
|
||||
#include "../core/DrawContext.hpp"
|
||||
#include "../core/LineBatch.hpp"
|
||||
#include "../core/Mesh.hpp"
|
||||
#include "../core/PostProcessing.h"
|
||||
@@ -140,7 +140,7 @@ void WorldRenderer::drawChunks(Chunks* chunks, Camera* camera, Shader* shader) {
|
||||
}
|
||||
|
||||
void WorldRenderer::renderLevel(
|
||||
const GfxContext& ctx,
|
||||
const DrawContext& ctx,
|
||||
Camera* camera,
|
||||
const EngineSettings& settings
|
||||
) {
|
||||
@@ -213,12 +213,12 @@ void WorldRenderer::renderBlockSelection(Camera* camera, Shader* linesShader) {
|
||||
}
|
||||
|
||||
void WorldRenderer::renderDebugLines(
|
||||
const GfxContext& pctx,
|
||||
const DrawContext& pctx,
|
||||
Camera* camera,
|
||||
Shader* linesShader,
|
||||
const EngineSettings& settings
|
||||
) {
|
||||
GfxContext ctx = pctx.sub();
|
||||
DrawContext ctx = pctx.sub();
|
||||
const auto& viewport = ctx.getViewport();
|
||||
uint displayWidth = viewport.getWidth();
|
||||
uint displayHeight = viewport.getHeight();
|
||||
@@ -266,7 +266,7 @@ void WorldRenderer::renderDebugLines(
|
||||
}
|
||||
|
||||
void WorldRenderer::draw(
|
||||
const GfxContext& pctx,
|
||||
const DrawContext& pctx,
|
||||
Camera* camera,
|
||||
bool hudVisible,
|
||||
PostProcessing* postProcessing
|
||||
@@ -282,7 +282,7 @@ void WorldRenderer::draw(
|
||||
|
||||
// World render scope with diegetic HUD included
|
||||
{
|
||||
GfxContext wctx = pctx.sub();
|
||||
DrawContext wctx = pctx.sub();
|
||||
postProcessing->use(wctx);
|
||||
|
||||
Window::clearDepth();
|
||||
@@ -292,7 +292,7 @@ void WorldRenderer::draw(
|
||||
|
||||
// Actually world render with depth buffer on
|
||||
{
|
||||
GfxContext ctx = wctx.sub();
|
||||
DrawContext ctx = wctx.sub();
|
||||
ctx.setDepthTest(true);
|
||||
ctx.setCullFace(true);
|
||||
renderLevel(ctx, camera, settings);
|
||||
|
||||
@@ -24,7 +24,7 @@ class Chunks;
|
||||
class LevelFrontend;
|
||||
class Skybox;
|
||||
class PostProcessing;
|
||||
class GfxContext;
|
||||
class DrawContext;
|
||||
struct EngineSettings;
|
||||
|
||||
class WorldRenderer {
|
||||
@@ -50,7 +50,7 @@ class WorldRenderer {
|
||||
/// @param linesShader shader used
|
||||
/// @param settings engine settings
|
||||
void renderDebugLines(
|
||||
const GfxContext& context,
|
||||
const DrawContext& context,
|
||||
Camera* camera,
|
||||
Shader* linesShader,
|
||||
const EngineSettings& settings
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
~WorldRenderer();
|
||||
|
||||
void draw(
|
||||
const GfxContext& context,
|
||||
const DrawContext& context,
|
||||
Camera* camera,
|
||||
bool hudVisible,
|
||||
PostProcessing* postProcessing
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
/// @param camera active camera
|
||||
/// @param settings engine settings
|
||||
void renderLevel(
|
||||
const GfxContext& context,
|
||||
const DrawContext& context,
|
||||
Camera* camera,
|
||||
const EngineSettings& settings
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user