Anonymous avatar Anonymous committed 4e83f19

nuked unused bits in HelloShader

Comments (0)

Files changed (1)

src/main/java/sandbox/misc/HelloShader.java

         glPopMatrix();
         shader.stopUsing();
     }
-
-    private void buildVertexShader(String source) {
-        vertShader = buildShader(glCreateShader(GL_VERTEX_SHADER), source);
-    }
-
-    private void buildFragmentShader(String source) {
-        fragShader = buildShader(glCreateShader(GL_FRAGMENT_SHADER), source);
-    }
-
-    private int buildShader(int shader, String source) {
-        glShaderSource(shader, source);
-        glCompileShader(shader);
-        if (checkCompile(shader)) {
-            return shader;
-        } else {
-            glDeleteShader(shader);
-            return 0;
-        }
-    }
-
-    private boolean checkCompile(int obj) {
-        if (glGetShader(obj, GL_COMPILE_STATUS) == GL_TRUE)
-            return true;
-
-        // Error compiling -- print the log to stderr
-        IntBuffer iVal = BufferUtils.createIntBuffer(1);
-        glGetShader(obj, GL_INFO_LOG_LENGTH, iVal);
-        int length = iVal.get();
-        if (length > 1) {
-            // 1 is for the null byte
-            ByteBuffer infoLog = BufferUtils.createByteBuffer(length);
-            iVal.flip();
-            glGetShaderInfoLog(obj, iVal, infoLog);
-            byte[] infoBytes = new byte[length];
-            infoLog.get(infoBytes);
-            String out = new String(infoBytes);
-            System.err.println(out);
-        }
-        return false;
-    }
-
-    private boolean checkLink(int obj) {
-        return checkProgram(obj, GL_LINK_STATUS);
-    }
-
-    private boolean checkValidate(int obj) {
-        return checkProgram(obj, GL_VALIDATE_STATUS);
-    }
-
-    // a copy and paste job from checkCompile
-    private boolean checkProgram(int obj, int status) {
-        if (glGetProgram(obj, status) == GL_TRUE)
-            return true;
-
-        // Error compiling -- print the log to stderr
-        IntBuffer iVal = BufferUtils.createIntBuffer(1);
-        glGetShader(obj, GL_INFO_LOG_LENGTH, iVal);
-        int length = iVal.get();
-        if (length > 1) {
-            // 1 is for the null byte
-            ByteBuffer infoLog = BufferUtils.createByteBuffer(length);
-            iVal.flip();
-            glGetProgramInfoLog(obj, iVal, infoLog);
-            byte[] infoBytes = new byte[length];
-            infoLog.get(infoBytes);
-            String out = new String(infoBytes);
-            System.err.println(out);
-        }
-        return false;
-
-    }
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.