diff options
19 files changed, 36 insertions, 24 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/RenderContext.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/RenderContext.java index ef522a3..eaaeb57 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/RenderContext.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/RenderContext.java @@ -71,7 +71,7 @@ public class RenderContext { protected void setupRecords() { for (final RenderState.StateType type : RenderState.StateType.values()) { - _stateRecords.put(type, RenderState.createState(type).createStateRecord()); + _stateRecords.put(type, RenderState.createState(type).createStateRecord(_capabilities)); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/BlendState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/BlendState.java index 5b2ed39..a8a638b 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/BlendState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/BlendState.java @@ -14,6 +14,7 @@ import java.io.IOException; import com.ardor3d.math.ColorRGBA; import com.ardor3d.math.type.ReadOnlyColorRGBA; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.BlendStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -629,7 +630,7 @@ public class BlendState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new BlendStateRecord(); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ClipState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ClipState.java index 0d809e9..5d9adb8 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ClipState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ClipState.java @@ -12,6 +12,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.ClipStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -119,7 +120,7 @@ public class ClipState extends RenderState { } @Override - public StateRecord createStateRecord() { - return new ClipStateRecord(); + public StateRecord createStateRecord(final ContextCapabilities caps) { + return new ClipStateRecord(caps); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ColorMaskState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ColorMaskState.java index b07fb0c..1ca3504 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ColorMaskState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ColorMaskState.java @@ -12,6 +12,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.ColorMaskStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -123,7 +124,7 @@ public class ColorMaskState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new ColorMaskStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/CullState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/CullState.java index 3ad5cc4..d0147fb 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/CullState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/CullState.java @@ -12,6 +12,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.CullStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -103,7 +104,7 @@ public class CullState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new CullStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FogState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FogState.java index eae1444..610742e 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FogState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FogState.java @@ -14,6 +14,7 @@ import java.io.IOException; import com.ardor3d.math.ColorRGBA; import com.ardor3d.math.type.ReadOnlyColorRGBA; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.FogStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -218,7 +219,7 @@ public class FogState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new FogStateRecord(); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FragmentProgramState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FragmentProgramState.java index 7646547..13b6f6d 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FragmentProgramState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/FragmentProgramState.java @@ -18,6 +18,7 @@ import java.nio.ByteBuffer; import java.util.logging.Level; import java.util.logging.Logger; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.FragmentProgramStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -225,7 +226,7 @@ public class FragmentProgramState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new FragmentProgramStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/GLSLShaderObjectsState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/GLSLShaderObjectsState.java index dcbacf4..ce4c799 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/GLSLShaderObjectsState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/GLSLShaderObjectsState.java @@ -1327,7 +1327,7 @@ public class GLSLShaderObjectsState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new ShaderObjectsStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/LightState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/LightState.java index 6f1648a..a5ce713 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/LightState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/LightState.java @@ -18,6 +18,7 @@ import java.util.Stack; import com.ardor3d.light.Light; import com.ardor3d.math.ColorRGBA; import com.ardor3d.math.type.ReadOnlyColorRGBA; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.LightStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.scenegraph.Mesh; @@ -391,7 +392,7 @@ public class LightState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new LightStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/MaterialState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/MaterialState.java index 15eb46c..5591212 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/MaterialState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/MaterialState.java @@ -14,6 +14,7 @@ import java.io.IOException; import com.ardor3d.math.ColorRGBA; import com.ardor3d.math.type.ReadOnlyColorRGBA; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.MaterialStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -395,7 +396,7 @@ public class MaterialState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new MaterialStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/OffsetState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/OffsetState.java index 8f42100..b6d0699 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/OffsetState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/OffsetState.java @@ -13,6 +13,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; import java.util.EnumSet; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.OffsetStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -141,7 +142,7 @@ public class OffsetState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new OffsetStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java index a09e152..560daf7 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/RenderState.java @@ -17,6 +17,7 @@ import java.util.Stack; import com.ardor3d.math.ObjectPool; import com.ardor3d.math.Poolable; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.scenegraph.Spatial; import com.ardor3d.util.Constants; @@ -207,7 +208,7 @@ public abstract class RenderState implements Savable { return this.getClass(); } - public abstract StateRecord createStateRecord(); + public abstract StateRecord createStateRecord(final ContextCapabilities caps); /** * @return true if we should apply this state even if we think it is the current state of its type in the current diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ShadingState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ShadingState.java index 1ca1b72..c0fa922 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ShadingState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ShadingState.java @@ -12,6 +12,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.ShadingStateRecord; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.util.export.InputCapsule; @@ -85,7 +86,7 @@ public class ShadingState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new ShadingStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/StencilState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/StencilState.java index 56b5745..55b2b9d 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/StencilState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/StencilState.java @@ -12,6 +12,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.renderer.state.record.StencilStateRecord; import com.ardor3d.util.export.InputCapsule; @@ -573,7 +574,7 @@ public class StencilState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new StencilStateRecord(); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/TextureState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/TextureState.java index d895eb7..9b8d4ea 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/TextureState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/TextureState.java @@ -20,6 +20,7 @@ import java.util.logging.Logger; import com.ardor3d.image.Image; import com.ardor3d.image.Texture; import com.ardor3d.image.Texture2D; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.renderer.state.record.TextureStateRecord; import com.ardor3d.scenegraph.Spatial; @@ -309,7 +310,7 @@ public class TextureState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new TextureStateRecord(); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/VertexProgramState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/VertexProgramState.java index ea8564b..44e49b4 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/VertexProgramState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/VertexProgramState.java @@ -18,6 +18,7 @@ import java.nio.ByteBuffer; import java.util.logging.Level; import java.util.logging.Logger; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.renderer.state.record.VertexProgramStateRecord; import com.ardor3d.util.export.InputCapsule; @@ -239,7 +240,7 @@ public class VertexProgramState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new VertexProgramStateRecord(); } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/WireframeState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/WireframeState.java index dbb099c..db92612 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/WireframeState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/WireframeState.java @@ -12,6 +12,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.renderer.state.record.WireframeStateRecord; import com.ardor3d.util.export.InputCapsule; @@ -131,7 +132,7 @@ public class WireframeState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new WireframeStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ZBufferState.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ZBufferState.java index ca79425..b3ee5d8 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ZBufferState.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/ZBufferState.java @@ -12,6 +12,7 @@ package com.ardor3d.renderer.state; import java.io.IOException; +import com.ardor3d.renderer.ContextCapabilities; import com.ardor3d.renderer.state.record.StateRecord; import com.ardor3d.renderer.state.record.ZBufferStateRecord; import com.ardor3d.util.export.InputCapsule; @@ -136,7 +137,7 @@ public class ZBufferState extends RenderState { } @Override - public StateRecord createStateRecord() { + public StateRecord createStateRecord(final ContextCapabilities caps) { return new ZBufferStateRecord(); } } diff --git a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ClipStateRecord.java b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ClipStateRecord.java index eeedf23..2c5a5ad 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ClipStateRecord.java +++ b/ardor3d-core/src/main/java/com/ardor3d/renderer/state/record/ClipStateRecord.java @@ -14,8 +14,6 @@ import java.nio.Buffer; import java.util.Arrays; import com.ardor3d.renderer.ContextCapabilities; -import com.ardor3d.renderer.ContextManager; -import com.ardor3d.renderer.RenderContext; import com.ardor3d.renderer.state.ClipState; import com.ardor3d.util.geom.BufferUtils; @@ -24,10 +22,8 @@ public class ClipStateRecord extends StateRecord { public final boolean[] planeEnabled; public final Buffer buf; - public ClipStateRecord() { + public ClipStateRecord(final ContextCapabilities caps) { planeEnabled = new boolean[ClipState.MAX_CLIP_PLANES]; - final RenderContext context = ContextManager.getCurrentContext(); - final ContextCapabilities caps = context.getCapabilities(); if (caps.areDoubleCoefficientsInClipPlaneEquationSupported()) { buf = BufferUtils.createDoubleBuffer(4); } else { |