diff options
author | Sven Gothel <[email protected]> | 2014-02-15 23:28:25 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-02-15 23:28:25 +0100 |
commit | 1e1b408ba1527edc2ee5ceede92816ee87e4c461 (patch) | |
tree | 0de7897b7537e4dc40b7bb762bdc35280840cc23 /src | |
parent | 1638fb3e80a1102670b5d216647ee6fce0031d7f (diff) |
Graph: RendereState: Create own PMVMatrix if passed value is null; Renderer: Add reshapeNotify(..) for NOP PMV reshape notification
Diffstat (limited to 'src')
3 files changed, 11 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java index 6a8fb6a67..9b0f32ef6 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java @@ -42,7 +42,7 @@ public abstract class RenderState { private static final String thisKey = "jogamp.graph.curve.RenderState" ; public static RenderState createRenderState(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory) { - return new RenderStateImpl(st, pointFactory); + return new RenderStateImpl(st, pointFactory, null); } public static RenderState createRenderState(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) { @@ -61,8 +61,8 @@ public abstract class RenderState { protected RenderState(ShaderState st, Vertex.Factory<? extends Vertex> vertexFactory, PMVMatrix pmvMatrix) { this.st = st; this.vertexFactory = vertexFactory; - this.pmvMatrix = pmvMatrix; - this.gcu_PMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, pmvMatrix.glGetPMvMatrixf()); + this.pmvMatrix = null != pmvMatrix ? pmvMatrix : new PMVMatrix(); + this.gcu_PMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, this.pmvMatrix.glGetPMvMatrixf()); st.ownUniform(gcu_PMVMatrix); } diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java index 8783906c2..029286601 100644 --- a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java +++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java @@ -241,6 +241,14 @@ public abstract class Renderer { } } + /** No PMVMatrix operation is performed here. PMVMatrix will be updated if gl is not null. */ + public boolean reshapeNotify(GL2ES2 gl, int width, int height) { + this.vp_width = width; + this.vp_height = height; + updateMatrix(gl); + return true; + } + public boolean reshapePerspective(GL2ES2 gl, float angle, int width, int height, float near, float far) { this.vp_width = width; this.vp_height = height; diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java index fe2dd7363..68f926b0a 100644 --- a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java +++ b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java @@ -61,10 +61,6 @@ public class RenderStateImpl extends RenderState { // st.ownUniform(gcu_Strength); } - public RenderStateImpl(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory) { - this(st, pointFactory, new PMVMatrix()); - } - @Override public final GLUniformData getWeight() { return gcu_Weight; } @Override |