summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.hpp
diff options
context:
space:
mode:
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;