From f728e4c8d202de241673a13ce61570b6acb4bba7 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Fri, 25 May 2018 23:47:27 +0200 Subject: Restructure source directory --- src/texture_display_buffer.h | 57 -------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/texture_display_buffer.h (limited to 'src/texture_display_buffer.h') diff --git a/src/texture_display_buffer.h b/src/texture_display_buffer.h deleted file mode 100644 index b38f9c0..0000000 --- a/src/texture_display_buffer.h +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -#include - -class TextureDisplayBuffer { -private: - const std::vector _data; - - GLuint _array; - GLuint _buffer; - -public: - TextureDisplayBuffer(): - _data{ - -1.f, 1.f, 0.f, 1.f, - -1.f, -1.f, 0.f, 0.f, - 1.f, -1.f, 1.f, 0.f, - - -1.f, 1.f, 0.f, 1.f, - 1.f, -1.f, 1.f, 0.f, - 1.f, 1.f, 1.f, 1.f - } { - glGenVertexArrays(1, &_array); - glGenBuffers(1, &_buffer); - - glBindVertexArray(_array); - glBindBuffer(GL_ARRAY_BUFFER, _buffer); - glBufferData( - GL_ARRAY_BUFFER, - _data.size() * sizeof(GLfloat), - _data.data(), - GL_STATIC_DRAW - ); - - glEnableVertexAttribArray(0); - glVertexAttribPointer( - 0, 2, GL_FLOAT, GL_FALSE, 4*sizeof(GLfloat), (void*)0); - glEnableVertexAttribArray(1); - glVertexAttribPointer( - 1, 2, GL_FLOAT, GL_FALSE, 4*sizeof(GLfloat), (void*)(2*sizeof(GLfloat))); - } - - ~TextureDisplayBuffer() { - glDeleteBuffers(1, &_buffer); - glDeleteVertexArrays(1, &_array); - } - - void draw(const std::vector& textures) const { - glBindVertexArray(_array); - glBindTextures(textures[0], textures.size(), textures.data()); - glDrawArrays(GL_TRIANGLES, 0, 6); - } - - GLuint getBuffer() const { - return _buffer; - } -}; -- cgit v1.2.3