From 1005813acc087f7f246059789cf380948a0e1686 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 3 Jan 2007 09:13:38 +0000 Subject: [PATCH] AWTGLCanvas: Added exceptionOccurred to allow users to be notified of unhandled LWJGLExceptions in paint() --- src/java/org/lwjgl/opengl/AWTGLCanvas.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/java/org/lwjgl/opengl/AWTGLCanvas.java b/src/java/org/lwjgl/opengl/AWTGLCanvas.java index 0bbf590f..774bdfde 100644 --- a/src/java/org/lwjgl/opengl/AWTGLCanvas.java +++ b/src/java/org/lwjgl/opengl/AWTGLCanvas.java @@ -324,11 +324,21 @@ public class AWTGLCanvas extends Canvas implements Drawable, ComponentListener, peer_info.unlock(); } } catch (LWJGLException e) { - LWJGLUtil.log("Failed to lock surface, skipping paint(): " + e); + exceptionOccurred(e); } } } + /** + * This method will be called if an unhandled LWJGLException occurs in paint(). + * Override this method to be notified of this. + * + * @param exception The exception that occurred. + */ + protected void exceptionOccurred(LWJGLException exception) { + LWJGLUtil.log("Unhandled exception occurred, skipping paint(): " + exception); + } + /** * override update to avoid clearing */