Commits

Michael Ludwig  committed c1e8567

Move OpenGL error checks to a better location, so that the gpu thread doesn't crash.
Correct uniform indices when dealing with matrices.

  • Participants
  • Parent commits 1bbaf91

Comments (0)

Files changed (2)

File ferox-renderer-jogl/src/main/java/com/ferox/renderer/impl/jogl/JoglContext.java

     public void makeCurrent() {
         try {
             context.makeCurrent();
+
             if (vao < 0) {
                 // make a vao for attributes
                 int[] id = new int[1];
 
     @Override
     public void release() {
-        int error;
         try {
-            error = context.getGL().glGetError();
             context.release();
         } catch (GLException e) {
             throw new FrameworkException("Unable to release context", e);
         }
+    }
 
-        if (error != 0) {
-            throw new FrameworkException(
-                    "OpenGL error flagged, checked on context release: " + translateGLErrorString(error));
-        }
+    @Override
+    public String checkGLErrors() {
+        int error = context.getGL().glGetError();
+        return (error == 0 ? null : translateGLErrorString(error));
     }
 
     private static String translateGLErrorString(int error_code) {

File ferox-renderer-lwjgl/src/main/java/com/ferox/renderer/impl/lwjgl/LwjglContext.java

 
     @Override
     public void release() {
-        int error;
         try {
-            error = GL11.glGetError();
             context.releaseContext();
         } catch (LWJGLException e) {
             throw new FrameworkException("Unable to release context", e);
         }
+    }
 
-        if (error != 0) {
-            throw new FrameworkException("OpenGL error flagged, checked on context release: " +
-                                         Util.translateGLErrorString(error));
-        }
+    @Override
+    public String checkGLErrors() {
+        int error = GL11.glGetError();
+        return (error == 0 ? null : Util.translateGLErrorString(error));
     }
 
     @Override