summaryrefslogtreecommitdiffstats
path: root/src/RendererSky.cpp
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/RendererSky.cpp
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/RendererSky.cpp')
-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,
- -0.5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.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();
-}