Commits

Chuck Adams  committed 4e83f19

nuked unused bits in HelloShader

  • Participants
  • Parent commits d25c403

Comments (0)

Files changed (1)

File 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;
-
-    }
 }