summaryrefslogtreecommitdiffstats
path: root/include/graphics
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-21 16:26:25 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2017-06-21 16:26:25 +0200
commitf5aa7827af55342a1ec714d366944b3e3f3129b2 (patch)
tree4f4885d2ae0f46004a22e7d4dc34f80c11ecee0c /include/graphics
parent2017-06-20 (diff)
downloadAltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.gz
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.bz2
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.lz
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.xz
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.tar.zst
AltCraft-f5aa7827af55342a1ec714d366944b3e3f3129b2.zip
Diffstat (limited to '')
-rw-r--r--include/graphics/Gui.hpp (renamed from src/gui/Gui.hpp)0
-rw-r--r--include/graphics/RenderSection.hpp41
-rw-r--r--include/graphics/Shader.hpp (renamed from src/graphics/Shader.hpp)2
-rw-r--r--include/graphics/Texture.hpp (renamed from src/graphics/Texture.hpp)0
-rw-r--r--include/graphics/Widget.hpp (renamed from src/gui/Widget.hpp)0
5 files changed, 43 insertions, 0 deletions
diff --git a/src/gui/Gui.hpp b/include/graphics/Gui.hpp
index 641b941..641b941 100644
--- a/src/gui/Gui.hpp
+++ b/include/graphics/Gui.hpp
diff --git a/include/graphics/RenderSection.hpp b/include/graphics/RenderSection.hpp
new file mode 100644
index 0000000..6a2f3ce
--- /dev/null
+++ b/include/graphics/RenderSection.hpp
@@ -0,0 +1,41 @@
+#pragma once
+
+#include <GL/glew.h>
+#include <glm/detail/type_mat.hpp>
+#include <glm/vec2.hpp>
+#include <glm/detail/type_mat4x4.hpp>
+#include <glm/gtx/transform.hpp>
+#include <easylogging++.h>
+
+#include <world/Section.hpp>
+#include <world/World.hpp>
+
+class RenderState {
+ GLuint ActiveVao;
+ GLuint ActiveShader;
+public:
+ void SetActiveVao(GLuint Vao);
+ void SetActiveShader(GLuint Shader);
+};
+
+class RenderSection {
+ Vector sectionPosition;
+ World *world;
+ GLuint Vao,VboBlocks,VboModels;
+
+ static GLuint VboVertices,VboUvs;
+ static std::map<GLuint,int> refCounterVbo;
+ static std::map<GLuint,int> refCounterVao;
+
+ size_t numOfBlocks;
+
+public:
+ RenderSection(World *world, Vector position);
+ RenderSection(const RenderSection &other);
+ ~RenderSection();
+
+ void UpdateState();
+ void Render(RenderState &state);
+
+ Section* GetSection();
+}; \ No newline at end of file
diff --git a/src/graphics/Shader.hpp b/include/graphics/Shader.hpp
index 1bcee3a..17a434e 100644
--- a/src/graphics/Shader.hpp
+++ b/include/graphics/Shader.hpp
@@ -1,7 +1,9 @@
#pragma once
+
#include <string>
#include <fstream>
#include <sstream>
+
#include <easylogging++.h>
#include <GL/glew.h>
diff --git a/src/graphics/Texture.hpp b/include/graphics/Texture.hpp
index 277806a..277806a 100644
--- a/src/graphics/Texture.hpp
+++ b/include/graphics/Texture.hpp
diff --git a/src/gui/Widget.hpp b/include/graphics/Widget.hpp
index c4d5dc1..c4d5dc1 100644
--- a/src/gui/Widget.hpp
+++ b/include/graphics/Widget.hpp