|
|
@ -104,14 +104,19 @@ public class LwjglOffscreenBuffer extends LwjglContext implements Runnable { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void runLoop(){ |
|
|
|
protected void runLoop(){ |
|
|
|
if (!created.get()) |
|
|
|
if (!created.get()) { |
|
|
|
throw new IllegalStateException(); |
|
|
|
throw new IllegalStateException(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (pbuffer.isBufferLost()) { |
|
|
|
if (pbuffer.isBufferLost()) { |
|
|
|
pbuffer.destroy(); |
|
|
|
pbuffer.destroy(); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
pbuffer = new Pbuffer(width, height, pixelFormat, null); |
|
|
|
pbuffer = new Pbuffer(width, height, pixelFormat, null); |
|
|
|
pbuffer.makeCurrent(); |
|
|
|
pbuffer.makeCurrent(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Context MUST be reset here to avoid invalid objects!
|
|
|
|
|
|
|
|
renderer.invalidateState(); |
|
|
|
} catch (LWJGLException ex) { |
|
|
|
} catch (LWJGLException ex) { |
|
|
|
listener.handleError("Failed to restore pbuffer content", ex); |
|
|
|
listener.handleError("Failed to restore pbuffer content", ex); |
|
|
|
} |
|
|
|
} |
|
|
|