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,8 +122,22 @@ public abstract class gl_object {
|
||||||
public void gl_error(int error, String s) {
|
public void gl_error(int error, String s) {
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
StringBuffer sb = errorCodeToString("jGL Error (", error, "): " + s);
|
||||||
|
|
||||||
|
if (throwExceptionOnGLError) {
|
||||||
|
throw new RuntimeException(sb.toString());
|
||||||
|
} else {
|
||||||
|
System.err.println(sb.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ErrorValue == GL.GL_NO_ERROR) {
|
||||||
|
ErrorValue = error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StringBuffer errorCodeToString(String prefix, int error, String suffix) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append("jGL Error (");
|
sb.append(prefix);
|
||||||
|
|
||||||
switch (error) {
|
switch (error) {
|
||||||
case GL.GL_NO_ERROR:
|
case GL.GL_NO_ERROR:
|
||||||
|
@ -152,17 +166,8 @@ public abstract class gl_object {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// System.out.println("): " + s);
|
// System.out.println("): " + s);
|
||||||
sb.append("): " + s);
|
sb.append(suffix);
|
||||||
|
return sb;
|
||||||
if (throwExceptionOnGLError) {
|
|
||||||
throw new RuntimeException(sb.toString());
|
|
||||||
} else {
|
|
||||||
System.err.println(sb.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ErrorValue == GL.GL_NO_ERROR) {
|
|
||||||
ErrorValue = error;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setThrowExceptionOnGLError(boolean status) {
|
public void setThrowExceptionOnGLError(boolean status) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.jzy3d.plot3d.rendering.view.View;
|
||||||
|
|
||||||
public class ITTest_AxisLabelRotateLayout extends ITTest{
|
public class ITTest_AxisLabelRotateLayout extends ITTest{
|
||||||
public static void main(String[] args) {
|
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
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue