From c45a684d39579cc80324ca1a791482e30ded4fb6 Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Mon, 22 Jan 2018 13:51:08 +0100 Subject: [PATCH] Remove unused code. --- src/glutils.cpp | 39 --------------------------------------- src/glutils.hpp | 8 -------- 2 files changed, 47 deletions(-) diff --git a/src/glutils.cpp b/src/glutils.cpp index 229bc8e..536693f 100644 --- a/src/glutils.cpp +++ b/src/glutils.cpp @@ -9,27 +9,6 @@ using namespace fmri; using namespace std; -/** - * Utility function to send OpenGL info dumps to the log - * - * @param object The GLObject to get info for - * @param glGet__iv The function to query log length with - * @param glGet__InfoLog The function to get the log with - */ -static void show_info_log( - GLuint object, - PFNGLGETSHADERIVPROC glGet__iv, - PFNGLGETSHADERINFOLOGPROC glGet__InfoLog -) -{ - GLint log_length; - glGet__iv(object, GL_INFO_LOG_LENGTH, &log_length); - unique_ptr log(new char[log_length]); - glGet__InfoLog(object, log_length, nullptr, log.get()); - - LOG(INFO) << log.get() << endl; -} - GLuint fmri::loadTexture(DType const *data, int width, int height) { // Load and scale texture @@ -85,24 +64,6 @@ void fmri::changeWindowSize(int w, int h) glMatrixMode(GL_MODELVIEW); } -GLuint fmri::compileShader(GLenum type, char const *source) -{ - GLuint shader = glCreateShader(type); - auto length = static_cast(strlen(source)); - GLint compileOK; - - glShaderSource(shader, 1, &source, &length); - glCompileShader(shader); - - glGetShaderiv(shader, GL_COMPILE_STATUS, &compileOK); - if (!compileOK) { - LOG(WARNING) << "Failed to compile " << source << endl; - show_info_log(shader, glGetShaderiv, glGetShaderInfoLog); - glDeleteShader(shader); - abort(); - } -} - void fmri::renderText(std::string_view text) { constexpr auto font = GLUT_BITMAP_HELVETICA_10; diff --git a/src/glutils.hpp b/src/glutils.hpp index 34462b4..5fd7fa0 100644 --- a/src/glutils.hpp +++ b/src/glutils.hpp @@ -16,14 +16,6 @@ namespace fmri { */ GLuint loadTexture(DType const * data, int width, int height); - /** - * - * @param type - * @param source - * @return - */ - GLuint compileShader(GLenum type, char const * source); - /** * Callback handler to handle resizing windows. *