* Add RenderManager.setUsingShaders() method in case it is used directly (without RenderManager.render()).

* Fix issue where LwjglOffscreenBuffer's thread would freeze after it has been destroyed 

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9753 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent 243bba48ff
commit 5f88d137a8
  1. 12
      engine/src/core/com/jme3/renderer/RenderManager.java
  2. 4
      engine/src/lwjgl/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java

@ -650,19 +650,17 @@ public class RenderManager {
scene.runControlRender(this, vp);
if (scene instanceof Node) {
// recurse for all children
// Recurse for all children
Node n = (Node) scene;
List<Spatial> children = n.getChildren();
//saving cam state for culling
// Saving cam state for culling
int camState = vp.getCamera().getPlaneState();
for (int i = 0; i < children.size(); i++) {
//restoring cam state before proceeding children recusively
// Restoring cam state before proceeding children recusively
vp.getCamera().setPlaneState(camState);
renderScene(children.get(i), vp);
}
} else if (scene instanceof Geometry) {
// add to the render queue
Geometry gm = (Geometry) scene;
if (gm.getMaterial() == null) {
@ -991,6 +989,10 @@ public class RenderManager {
clearQueue(vp);
}
public void setUsingShaders(boolean usingShaders) {
this.shader = usingShaders;
}
/**
* Called by the application to render any ViewPorts
* added to this RenderManager.

@ -118,7 +118,7 @@ public class LwjglOffscreenBuffer extends LwjglContext implements Runnable {
}
listener.update();
assert checkGLError();
checkGLError();
renderer.onFrame();
@ -135,6 +135,8 @@ public class LwjglOffscreenBuffer extends LwjglContext implements Runnable {
renderer.cleanup();
pbuffer.destroy();
logger.info("Offscreen buffer destroyed.");
super.internalDestroy();
}
public void run(){

Loading…
Cancel
Save