package de.lessvoid.coregl;


import java.util.logging.Logger;

import static org.lwjgl.opengl.GL11.*;
import org.lwjgl.util.glu.GLU;

public class CheckGL {
  private static Logger log = Logger.getLogger(CheckGL.class.getName());

  public static void checkGLError(final String message) {
    int error = glGetError();
    while (error != GL_NO_ERROR) {
      String glerrmsg = GLU.gluErrorString(error);
      log.warning("OpenGL Error: (" + error + ") " + glerrmsg + " {" + message + "}");
      error = glGetError();
    }
  }
}

@@ -399,16 +399,225 @@
 error);%0A
+      StringBuffer stacktrace = new StringBuffer();%0A      for (StackTraceElement e : Thread.currentThread().getStackTrace()) %7B%0A        stacktrace.append(e.toString());%0A        stacktrace.append(%22%5Cn%22);%0A      %7D%0A
       lo
@@ -691,17 +691,42 @@
 age + %22%7D
-%22
+ %22 + stacktrace.toString()
 );%0A     

add stacktrace when logging opengl errors