public void handleError(String errorMsg, Throwable t) { listener.handleError(errorMsg, t); }
public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Exception thrown in " + thread.toString(), thrown); } });
public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); } });
public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); } });
protected boolean checkGLError(){ try { Util.checkGLError(); } catch (OpenGLException ex){ listener.handleError("An OpenGL error has occured!", ex); } // NOTE: Always return true since this is used in an "assert" statement return true; }
@Override public void invoke(int error, long description) { final String message = GLFWErrorCallback.getDescription(description); listener.handleError(message, new Exception(message)); } });
@Override public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in " + thread.toString(), thrown); if (needClose.get()) { // listener.handleError() has requested the // context to close. Satisfy request. deinitInThread(); } } });
public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Uncaught exception thrown in "+thread.toString(), thrown); if (needClose.get()){ // listener.handleError() has requested the // context to close. Satisfy request. deinitInThread(); } } });
@Override public void invoke(int error, long description) { final String message = GLFWErrorCallback.getDescription(description); listener.handleError(message, new Exception(message)); } });
protected boolean checkGLError(){ try { Util.checkGLError(); } catch (OpenGLException ex){ listener.handleError("An OpenGL error has occured!", ex); } // NOTE: Always return true since this is used in an "assert" statement return true; }
public void create(boolean waitFor){ if (SwingUtilities.isEventDispatchThread()) { initInEDT(); } else { try { if (waitFor) { try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { initInEDT(); } }); } catch (InterruptedException ex) { listener.handleError("Interrupted", ex); } } else { SwingUtilities.invokeLater(new Runnable() { public void run() { initInEDT(); } }); } } catch (InvocationTargetException ex) { throw new AssertionError(); // can never happen } } }
protected void destroyContext(){ try { renderer.cleanup(); Display.releaseContext(); Display.destroy(); } catch (LWJGLException ex) { listener.handleError("Failed to destroy context", ex); } }
listener.handleError("Error while swapping buffers", ex);
listener.handleError("Failed to create display", ex); return false; // if we failed to create display, do not continue
listener.handleError("Failed to create display", ex); return false; // if we failed to create display, do not continue
listener.handleError("Failed to destroy context", ex);
protected DisplayMode getFullscreenDisplayMode(int width, int height, int bpp, int freq){ try { DisplayMode[] modes = Display.getAvailableDisplayModes(); for (DisplayMode mode : modes) { if (mode.getWidth() == width && mode.getHeight() == height && (mode.getBitsPerPixel() == bpp || (bpp == 24 && mode.getBitsPerPixel() == 32)) && (mode.getFrequency() == freq || (freq == 60 && mode.getFrequency() == 59))) { return mode; } } } catch (LWJGLException ex) { listener.handleError("Failed to acquire fullscreen display mode!", ex); } return null; }
protected void runLoop(){ if (!created.get()) { throw new IllegalStateException(); } if (pbuffer.isBufferLost()) { pbuffer.destroy(); try { pbuffer = new Pbuffer(width, height, pixelFormat, null); pbuffer.makeCurrent(); // Context MUST be reset here to avoid invalid objects! renderer.invalidateState(); } catch (LWJGLException ex) { listener.handleError("Failed to restore pbuffer content", ex); } } listener.update(); assert checkGLError(); renderer.postFrame(); // Need to flush GL commands // to see any result on the pbuffer's front buffer. GL11.glFlush(); int frameRate = settings.getFrameRate(); if (frameRate >= 1) { Display.sync(frameRate); } }
printContextInitInfo(); } catch (LWJGLException ex){ listener.handleError("Failed to create display", ex); } finally {
listener.handleError("Failed to destroy context", ex);