AWTGLCanvas: Added exceptionOccurred to allow users to be notified of unhandled LWJGLExceptions in paint()

This commit is contained in:
Elias Naur 2007-01-03 09:13:38 +00:00
parent de0a724da7
commit 1005813acc
1 changed files with 11 additions and 1 deletions

View File

@ -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
*/