summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2021-12-25 07:42:52 +0100
committerGitHub <noreply@github.com>2021-12-25 07:42:52 +0100
commit40421159568518bb7573903d14a2c69c64dead95 (patch)
tree15c830dce151bf0b427123efd214173742887e8e /src/RendererWorld.hpp
parentMerge pull request #70 from LaG1924/ftr/build-3 (diff)
parentFixed missing APIENTRY linux build (diff)
downloadAltCraft-40421159568518bb7573903d14a2c69c64dead95.tar
AltCraft-40421159568518bb7573903d14a2c69c64dead95.tar.gz
AltCraft-40421159568518bb7573903d14a2c69c64dead95.tar.bz2
AltCraft-40421159568518bb7573903d14a2c69c64dead95.tar.lz
AltCraft-40421159568518bb7573903d14a2c69c64dead95.tar.xz
AltCraft-40421159568518bb7573903d14a2c69c64dead95.tar.zst
AltCraft-40421159568518bb7573903d14a2c69c64dead95.zip
Diffstat (limited to 'src/RendererWorld.hpp')
-rw-r--r--src/RendererWorld.hpp43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/RendererWorld.hpp b/src/RendererWorld.hpp
index 85cb736..e645b30 100644
--- a/src/RendererWorld.hpp
+++ b/src/RendererWorld.hpp
@@ -9,7 +9,6 @@
#include "RendererSection.hpp"
#include "RendererEntity.hpp"
-#include "RendererSky.hpp"
#include "RendererSectionData.hpp"
class Frustum;
@@ -20,11 +19,11 @@ class EventListener;
class RenderState;
class RendererWorld {
- struct SectionParsing {
- SectionsData data;
- RendererSectionData renderer;
- bool parsing = false;
- };
+ struct SectionParsing {
+ SectionsData data;
+ RendererSectionData renderer;
+ bool parsing = false;
+ };
//General
std::unique_ptr<EventListener> listener;
@@ -33,28 +32,34 @@ class RendererWorld {
std::vector<std::thread> workers;
void WorkerFunction(size_t WorkerId);
bool isRunning = true;
- const static size_t parsingBufferSize = 64;
- SectionParsing parsing[parsingBufferSize];
- std::queue<Vector> parseQueue;
- bool parseQueueNeedRemoveUnnecessary = false;
- void ParseQueueUpdate();
- void ParseQeueueRemoveUnnecessary();
+ const static size_t parsingBufferSize = 64;
+ SectionParsing parsing[parsingBufferSize];
+ std::queue<Vector> parseQueue;
+ bool parseQueueNeedRemoveUnnecessary = false;
+ void ParseQueueUpdate();
+ void ParseQeueueRemoveUnnecessary();
//Blocks
std::vector<Vector> renderList;
std::map<Vector, RendererSection> sections;
void UpdateAllSections(VectorF playerPos);
- std::chrono::time_point<std::chrono::high_resolution_clock> globalTimeStart;
+ std::chrono::time_point<std::chrono::high_resolution_clock> globalTimeStart;
+ std::shared_ptr<Gal::Pipeline> sectionsPipeline;
+ std::shared_ptr<Gal::BufferBinding> sectionsBufferBinding;
//Entities
std::vector<RendererEntity> entities;
+ std::shared_ptr<Gal::Pipeline> entitiesPipeline;
+ std::shared_ptr<Gal::PipelineInstance> entitiesPipelineInstance;
+ std::shared_ptr<Gal::Buffer> entitiesPosBuffer, entitiesIndexBuffer;
//Sky
- Texture *skyTexture;
- RendererSky rendererSky;
+ std::shared_ptr<Gal::Pipeline> skyPipeline;
+ std::shared_ptr<Gal::PipelineInstance> skyPipelineInstance;
+ std::shared_ptr<Gal::Buffer> skyBuffer;
public:
- RendererWorld();
- ~RendererWorld();
+ RendererWorld(std::shared_ptr<Gal::Framebuffer> target);
+ ~RendererWorld();
- void Render(RenderState& renderState);
- void PrepareRender();
+ void Render(float screenRatio);
+ void PrepareRender(std::shared_ptr<Gal::Framebuffer> target);
double MaxRenderingDistance;