summaryrefslogtreecommitdiffstats
path: root/src/RendererSky.cpp
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-11-19 07:48:37 +0100
committerLaG1924 <lag1924@gmail.com>2021-11-19 08:28:15 +0100
commit8ab6abaae252050bf0ee03cd2a988c0e4e502718 (patch)
tree6c96eb7314da49db1d2ac5a142623bc443e3ee33 /src/RendererSky.cpp
parentOptimized entities rendering (diff)
downloadAltCraft-8ab6abaae252050bf0ee03cd2a988c0e4e502718.tar
AltCraft-8ab6abaae252050bf0ee03cd2a988c0e4e502718.tar.gz
AltCraft-8ab6abaae252050bf0ee03cd2a988c0e4e502718.tar.bz2
AltCraft-8ab6abaae252050bf0ee03cd2a988c0e4e502718.tar.lz
AltCraft-8ab6abaae252050bf0ee03cd2a988c0e4e502718.tar.xz
AltCraft-8ab6abaae252050bf0ee03cd2a988c0e4e502718.tar.zst
AltCraft-8ab6abaae252050bf0ee03cd2a988c0e4e502718.zip
Diffstat (limited to '')
-rw-r--r--src/RendererSky.cpp144
1 files changed, 0 insertions, 144 deletions
diff --git a/src/RendererSky.cpp b/src/RendererSky.cpp
deleted file mode 100644
index 1eab369..0000000
--- a/src/RendererSky.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-#include "RendererSky.hpp"
-
-#include <optick.h>
-
-#include "Renderer.hpp"
-#include "Utility.hpp"
-
-const GLfloat vertices[] = {
- //Z+ edge
- -0.5f, -0.5f, 0.5f,
- -0.5f, 0.5f, 0.5f,
- 0.5f, -0.5f, 0.5f,
- 0.5f, -0.5f, 0.5f,
- -0.5f, 0.5f, 0.5f,
- 0.5f, 0.5f, 0.5f,
-
- //Z- edge
- -0.5f, 0.5f, -0.5f,
- -0.5f, -0.5f, -0.5f,
- 0.5f, -0.5f, -0.5f,
- -0.5f, 0.5f, -0.5f,
- 0.5f, -0.5f, -0.5f,
- 0.5f, 0.5f, -0.5f,
-
- //X+ edge
- -0.5f, -0.5f, 0.5f,
- -0.5f, -0.5f, -0.5f,
- -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- 1.0f, 0.0f,
-};
-
-RendererSky::RendererSky() {
- glGenBuffers(1, &VboVert);
- glBindBuffer(GL_ARRAY_BUFFER, VboVert);
- glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
-
- glGenBuffers(1, &VboUv);
- glBindBuffer(GL_ARRAY_BUFFER, VboUv);
- glBufferData(GL_ARRAY_BUFFER, sizeof(uv_coords), uv_coords, GL_STATIC_DRAW);
- glGenVertexArrays(1, &Vao);
-
- glBindVertexArray(Vao);
- {
- glBindBuffer(GL_ARRAY_BUFFER, VboVert);
- glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0);
- glEnableVertexAttribArray(0);
-
- glBindBuffer(GL_ARRAY_BUFFER, VboUv);
- glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), (GLvoid*)0);
- glEnableVertexAttribArray(1);
- }
- glBindVertexArray(0);
- glCheckError();
-}
-
-RendererSky::~RendererSky() {
- glDeleteBuffers(1, &VboVert);
- glDeleteBuffers(1, &VboUv);
- glDeleteVertexArrays(1, &Vao);
- //glCheckError();
-}
-
-void RendererSky::Render(RenderState &renderState) {
- OPTICK_EVENT();
- renderState.SetActiveVao(Vao);
- glDrawArrays(GL_TRIANGLES, 0, 36);
- glCheckError();
-}