* Attempt to fix SDK / AWT panels issue "Framebuffer doesn’t have any renderbuffers attached."
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9991 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
@@ -104,15 +104,20 @@ 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();
|
||||||
}catch (LWJGLException ex){
|
|
||||||
|
// Context MUST be reset here to avoid invalid objects!
|
||||||
|
renderer.invalidateState();
|
||||||
|
} catch (LWJGLException ex) {
|
||||||
listener.handleError("Failed to restore pbuffer content", ex);
|
listener.handleError("Failed to restore pbuffer content", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +128,7 @@ public class LwjglOffscreenBuffer extends LwjglContext implements Runnable {
|
|||||||
renderer.onFrame();
|
renderer.onFrame();
|
||||||
|
|
||||||
int frameRate = settings.getFrameRate();
|
int frameRate = settings.getFrameRate();
|
||||||
if (frameRate >= 1){
|
if (frameRate >= 1) {
|
||||||
Display.sync(frameRate);
|
Display.sync(frameRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user