From d1ad9b0279a450d52287e2c34c012aacbbc2566b Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Thu, 3 May 2012 15:13:34 -0700 Subject: j3dcore: remove the ability to set the shading language to CG, assume GLSL Signed-off-by: Harvey Harrison --- .../share/javax/media/j3d/MasterControl.java | 40 ++-------------------- .../share/javax/media/j3d/NoopPipeline.java | 18 ---------- src/classes/share/javax/media/j3d/Pipeline.java | 15 -------- 3 files changed, 2 insertions(+), 71 deletions(-) (limited to 'src/classes/share/javax') 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 */ @@ -59,20 +55,6 @@ class NoopPipeline extends Pipeline { assert pipelineType == Pipeline.Type.NOOP; } - /** - * 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. -- cgit v1.2.3