* RenderManager will reload "shader" boolean on each invocation of render(), since Renderer might not have proper capabilities set before canvas has been attached

jMP
 * Fixed some illegal calls in SceneApplication

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7095 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 4cc44936c4
commit 9b84a79811
  1. 4
      build.xml
  2. 4
      engine/src/core/com/jme3/renderer/RenderManager.java
  3. 7
      sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java

@ -10,7 +10,7 @@
</condition> </condition>
</fail> </fail>
<target name="build" description="Builds the complete SDK" depends="-check-platform"> <target name="build" description="Builds the complete SDK" depends="-check-platform, -update-sdk-platform-config">
<ant dir="engine" target="update-sdk"/> <ant dir="engine" target="update-sdk"/>
<ant dir="sdk" target="build"/> <ant dir="sdk" target="build"/>
</target> </target>
@ -74,4 +74,6 @@
<replace file="sdk/nbproject/private/platform-private.properties" token="\" value="\\"/> <replace file="sdk/nbproject/private/platform-private.properties" token="\" value="\\"/>
</target> </target>
<target name="update-sdk-platform-config" depends="-update-sdk-platform-config"/>
</project> </project>

@ -85,7 +85,7 @@ public class RenderManager {
private Material forcedMaterial = null; private Material forcedMaterial = null;
private String forcedTechnique = null; private String forcedTechnique = null;
private RenderState forcedRenderState = null; private RenderState forcedRenderState = null;
private final boolean shader; private boolean shader;
private int viewX, viewY, viewWidth, viewHeight; private int viewX, viewY, viewWidth, viewHeight;
private float near, far; private float near, far;
private Matrix4f orthoMatrix = new Matrix4f(); private Matrix4f orthoMatrix = new Matrix4f();
@ -734,6 +734,8 @@ public class RenderManager {
return; return;
} }
this.shader = renderer.getCaps().contains(Caps.GLSL100);
for (int i = 0; i < preViewPorts.size(); i++) { for (int i = 0; i < preViewPorts.size(); i++) {
renderViewPort(preViewPorts.get(i), tpf); renderViewPort(preViewPorts.get(i), tpf);
} }

@ -127,8 +127,6 @@ public class SceneApplication extends Application implements LookupProvider, Loo
createCanvas(); createCanvas();
startCanvas(true); startCanvas(true);
getContext().setAutoFlushFrames(true);
getContext().setSystemListener(this);
progressHandle.progress("initialize Base Application", 1); progressHandle.progress("initialize Base Application", 1);
// if (!java.awt.EventQueue.isDispatchThread()) { // if (!java.awt.EventQueue.isDispatchThread()) {
// java.awt.EventQueue.invokeAndWait(new Runnable() { // java.awt.EventQueue.invokeAndWait(new Runnable() {
@ -180,9 +178,6 @@ public class SceneApplication extends Application implements LookupProvider, Loo
previewProcessor = new ScenePreviewProcessor(); previewProcessor = new ScenePreviewProcessor();
previewProcessor.setupPreviewView(); previewProcessor.setupPreviewView();
// enable depth test and back-face culling for performance
renderer.applyRenderState(RenderState.DEFAULT);
getProgressHandle().progress("Prepare Camera", 4); getProgressHandle().progress("Prepare Camera", 4);
camLight = new PointLight(); camLight = new PointLight();
camLight.setColor(ColorRGBA.White); camLight.setColor(ColorRGBA.White);
@ -244,7 +239,9 @@ public class SceneApplication extends Application implements LookupProvider, Loo
guiNode.updateGeometricState(); guiNode.updateGeometricState();
toolsNode.updateGeometricState(); toolsNode.updateGeometricState();
getStateManager().render(renderManager); getStateManager().render(renderManager);
if (context.isRenderable()){
renderManager.render(tpf); renderManager.render(tpf);
}
getStateManager().postRender(); getStateManager().postRender();
} catch (Exception e) { } catch (Exception e) {
handleError(e.getMessage(), e); handleError(e.getMessage(), e);

Loading…
Cancel
Save