diff options
author | Harvey Harrison <[email protected]> | 2012-05-03 15:13:34 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2012-05-03 15:13:34 -0700 |
commit | d1ad9b0279a450d52287e2c34c012aacbbc2566b (patch) | |
tree | eec512e983a3ace372a198344f7eae731db57402 /src/classes/share/javax | |
parent | dfc10a8ff29e43d49b7fe880bb58052d5c7262e2 (diff) |
j3dcore: remove the ability to set the shading language to CG, assume GLSL
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/classes/share/javax')
-rw-r--r-- | src/classes/share/javax/media/j3d/MasterControl.java | 40 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/NoopPipeline.java | 18 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/Pipeline.java | 15 |
3 files changed, 2 insertions, 71 deletions
diff --git a/src/classes/share/javax/media/j3d/MasterControl.java b/src/classes/share/javax/media/j3d/MasterControl.java index c5f128c..3cd1841 100644 --- a/src/classes/share/javax/media/j3d/MasterControl.java +++ b/src/classes/share/javax/media/j3d/MasterControl.java @@ -382,11 +382,6 @@ class MasterControl { // to control this. boolean stencilClear = false; - // The global shading language being used. Using a ShaderProgram - // with a shading language other than the one specified by - // globalShadingLanguage will cause a ShaderError to be generated, - static int globalShadingLanguage = Shader.SHADING_LANGUAGE_GLSL; - // Flags indicating whether the Cg or GLSL libraries are available; we still need // to check for the actual extension support when the Canvas3D with its associated context // is created. Note that these are qualifed by the above globalShadingLanguage, so at @@ -931,39 +926,8 @@ class MasterControl { } // Construct the singleton Pipeline instance - Pipeline.createPipeline(pipelineType); - - // Get the global j3d.shadingLanguage system property - final String slStr = getProperty("j3d.shadingLanguage"); - if (slStr != null) { - boolean found = false; - if (slStr.equals("GLSL")) { - globalShadingLanguage = Shader.SHADING_LANGUAGE_GLSL; - found = true; - } else if (slStr.equals("Cg")) { - globalShadingLanguage = Shader.SHADING_LANGUAGE_CG; - found = true; - } - - if (found) { - System.err.println("Java 3D: Setting global shading language to " + slStr); - } else { - System.err.println("Java 3D: Unrecognized shading language: " + slStr); - } - } - - // Load all required libraries - Pipeline.getPipeline().loadLibraries(globalShadingLanguage); - - // Check whether the Cg library is available - if (globalShadingLanguage == Shader.SHADING_LANGUAGE_CG) { - cgLibraryAvailable = Pipeline.getPipeline().isCgLibraryAvailable(); - } - - // Check whether the GLSL library is available - if (globalShadingLanguage == Shader.SHADING_LANGUAGE_GLSL) { - glslLibraryAvailable = Pipeline.getPipeline().isGLSLLibraryAvailable(); - } + Pipeline.createPipeline(pipelineType); + glslLibraryAvailable = Pipeline.getPipeline().isGLSLLibraryAvailable(); assert !(glslLibraryAvailable && cgLibraryAvailable) : "ERROR: cannot support both GLSL and CG at the same time"; diff --git a/src/classes/share/javax/media/j3d/NoopPipeline.java b/src/classes/share/javax/media/j3d/NoopPipeline.java index 5a7deaa..8c68119 100644 --- a/src/classes/share/javax/media/j3d/NoopPipeline.java +++ b/src/classes/share/javax/media/j3d/NoopPipeline.java @@ -40,10 +40,6 @@ import java.awt.GraphicsEnvironment; * pipeline. */ class NoopPipeline extends Pipeline { - - // Flags indicating whether the Cg or GLSL libraries are available. - private boolean cgLibraryAvailable = false; - /** * Constructor for singleton NoopPipeline instance */ @@ -60,20 +56,6 @@ class NoopPipeline extends Pipeline { } /** - * Load all of the required libraries - */ - void loadLibraries(int globalShadingLanguage) { - } - - /** - * Returns true if the Cg library is loaded and available. Note that this - * does not necessarily mean that Cg is supported by the graphics card. - */ - boolean isCgLibraryAvailable() { - return cgLibraryAvailable; - } - - /** * Returns true if the GLSL library is loaded and available. Note that this * does not necessarily mean that GLSL is supported by the graphics card. */ diff --git a/src/classes/share/javax/media/j3d/Pipeline.java b/src/classes/share/javax/media/j3d/Pipeline.java index 264d616..a6b7ba0 100644 --- a/src/classes/share/javax/media/j3d/Pipeline.java +++ b/src/classes/share/javax/media/j3d/Pipeline.java @@ -157,21 +157,6 @@ public Pipeline run() { // --------------------------------------------------------------------- - // - // Methods to initialize and load required libraries (from MasterControl) - // - - /** - * Load all of the required libraries - */ - abstract void loadLibraries(int globalShadingLanguage); - - /** - * Returns true if the Cg library is loaded and available. Note that this - * does not necessarily mean that Cg is supported by the graphics card. - */ - abstract boolean isCgLibraryAvailable(); - /** * Returns true if the GLSL library is loaded and available. Note that this * does not necessarily mean that GLSL is supported by the graphics card. |