Unwrap GLExceptions to show only the causing exception

This commit is contained in:
codeanticode
2012-08-16 20:19:31 +00:00
parent bc1055792a
commit 3f3e3bccc7
2 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,7 @@
0208 opengl
X Make methods in PGL used by opengl protected, then remove gl from the public GL methods
X Texture wrapping option in PGraphics: textureWrap(mode)
X Unwrap GLException to avoid confusion when common, non-GL errors occur.
0208 video
X Cleanup video API:
@@ -13,7 +14,6 @@ API changes/additions (for beta release)
_ Add DISABLE_PERSPECTIVE_CORRECTED_STROKE hint, remove DISABLE_PERSPECTIVE_CORRECTED_LINES
_ Rename shader constants (FLAT, LIT, TEXTURED, etc), resetShader() w/out args?
_ Back-buffer support in shaders: http://code.google.com/p/processing/issues/detail?id=1169
_ Unwrap GLException to avoid confusion when common, non-GL errors occur.
processing-core todo (after beta):
_ Cleaner Implementation of PImage.loadPixels()
+13 -7
View File
@@ -44,6 +44,7 @@ import javax.media.opengl.GLCapabilitiesImmutable;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.glu.GLU;
@@ -914,14 +915,19 @@ public class PGL {
protected void requestDraw() {
if (initialized) {
//animator.requestDisplay();
if (toolkit == AWT) {
canvasAWT.display();
} else if (toolkit == NEWT) {
animator.requestDisplay();
try {
//animator.requestDisplay();
if (toolkit == AWT) {
canvasAWT.display();
} else if (toolkit == NEWT) {
animator.requestDisplay();
}
} catch (GLException e) {
// Unwrap GLException to only the causing exception and so
// avoid the additional jogl lines.
Throwable tr = e.getCause();
throw (RuntimeException)tr;
}
}
}