mirror of https://github.com/rusefi/jzy3d-api.git
Share error code to string of jgl
This commit is contained in:
parent
260480beb9
commit
7de96cc620
|
@ -122,37 +122,7 @@ public abstract class gl_object {
|
|||
public void gl_error(int error, String s) {
|
||||
|
||||
if (debug) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("jGL Error (");
|
||||
|
||||
switch (error) {
|
||||
case GL.GL_NO_ERROR:
|
||||
sb.append("GL_NO_ERROR");
|
||||
break;
|
||||
case GL.GL_INVALID_VALUE:
|
||||
sb.append("GL_INVALID_VALUE");
|
||||
break;
|
||||
case GL.GL_INVALID_ENUM:
|
||||
sb.append("GL_INVALID_ENUM");
|
||||
break;
|
||||
case GL.GL_INVALID_OPERATION:
|
||||
sb.append("GL_INVALID_OPERATION");
|
||||
break;
|
||||
case GL.GL_STACK_OVERFLOW:
|
||||
sb.append("GL_STACK_OVERFLOW");
|
||||
break;
|
||||
case GL.GL_STACK_UNDERFLOW:
|
||||
sb.append("GL_STACK_UNDERFLOW");
|
||||
break;
|
||||
case GL.GL_OUT_OF_MEMORY:
|
||||
sb.append("GL_OUT_OF_MEMORY");
|
||||
break;
|
||||
default:
|
||||
sb.append("unknown");
|
||||
break;
|
||||
}
|
||||
// System.out.println("): " + s);
|
||||
sb.append("): " + s);
|
||||
StringBuffer sb = errorCodeToString("jGL Error (", error, "): " + s);
|
||||
|
||||
if (throwExceptionOnGLError) {
|
||||
throw new RuntimeException(sb.toString());
|
||||
|
@ -164,6 +134,41 @@ public abstract class gl_object {
|
|||
ErrorValue = error;
|
||||
}
|
||||
}
|
||||
|
||||
public static StringBuffer errorCodeToString(String prefix, int error, String suffix) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(prefix);
|
||||
|
||||
switch (error) {
|
||||
case GL.GL_NO_ERROR:
|
||||
sb.append("GL_NO_ERROR");
|
||||
break;
|
||||
case GL.GL_INVALID_VALUE:
|
||||
sb.append("GL_INVALID_VALUE");
|
||||
break;
|
||||
case GL.GL_INVALID_ENUM:
|
||||
sb.append("GL_INVALID_ENUM");
|
||||
break;
|
||||
case GL.GL_INVALID_OPERATION:
|
||||
sb.append("GL_INVALID_OPERATION");
|
||||
break;
|
||||
case GL.GL_STACK_OVERFLOW:
|
||||
sb.append("GL_STACK_OVERFLOW");
|
||||
break;
|
||||
case GL.GL_STACK_UNDERFLOW:
|
||||
sb.append("GL_STACK_UNDERFLOW");
|
||||
break;
|
||||
case GL.GL_OUT_OF_MEMORY:
|
||||
sb.append("GL_OUT_OF_MEMORY");
|
||||
break;
|
||||
default:
|
||||
sb.append("unknown");
|
||||
break;
|
||||
}
|
||||
// System.out.println("): " + s);
|
||||
sb.append(suffix);
|
||||
return sb;
|
||||
}
|
||||
|
||||
public void setThrowExceptionOnGLError(boolean status) {
|
||||
this.throwExceptionOnGLError = status;
|
||||
|
|
|
@ -19,7 +19,7 @@ import org.jzy3d.plot3d.rendering.view.View;
|
|||
|
||||
public class ITTest_AxisLabelRotateLayout extends ITTest{
|
||||
public static void main(String[] args) {
|
||||
open(new ITTest_AxisLabelRotateLayout().whenAxisLabelOrientationNotHorizontal(WT.Native_AWT, HiDPI.OFF));
|
||||
open(new ITTest_AxisLabelRotateLayout().whenAxisLabelOrientationNotHorizontal(WT.Native_AWT, HiDPI.ON));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue