diff options
author | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2005-06-10 16:19:43 +0000 |
---|---|---|
committer | kcr <kcr@28c7f869-5b4e-e670-f602-82bfaf57f300> | 2005-06-10 16:19:43 +0000 |
commit | a81ae1e6ec65fa32c7060e874b279cf008e2249b (patch) | |
tree | a4c880e25670604400093d7ec2a988ba1d9c34d1 | |
parent | 8372cfdaa97297e8f5249484bf2df72ef282d340 (diff) |
Added -S flag to specify shaders
-rw-r--r-- | src/GLSLShaderTest/ObjLoadGLSL.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/GLSLShaderTest/ObjLoadGLSL.java b/src/GLSLShaderTest/ObjLoadGLSL.java index 92b1cb2..97fc60b 100644 --- a/src/GLSLShaderTest/ObjLoadGLSL.java +++ b/src/GLSLShaderTest/ObjLoadGLSL.java @@ -62,6 +62,7 @@ import java.net.MalformedURLException; public class ObjLoadGLSL extends Applet { + private String shaderName = "simple"; private boolean spin = false; private boolean noTriangulate = false; private boolean noStripify = false; @@ -117,8 +118,8 @@ public class ObjLoadGLSL extends Applet { String vertexProgram = null; String fragmentProgram = null; try { - vertexProgram = StringIO.readFully("./simple.vert"); - fragmentProgram = StringIO.readFully("./simple.frag"); + vertexProgram = StringIO.readFully(shaderName + ".vert"); + fragmentProgram = StringIO.readFully(shaderName + ".frag"); } catch (IOException e) { e.printStackTrace(); @@ -165,8 +166,9 @@ public class ObjLoadGLSL extends Applet { private void usage() { System.out.println( - "Usage: java ObjLoadGLSL [-s] [-n] [-t] [-c degrees] <.obj file>"); + "Usage: java ObjLoadGLSL [-s] [-S shaderName] [-n] [-t] [-c degrees] <.obj file>"); System.out.println(" -s Spin (no user interaction)"); + System.out.println(" -S Set shader name (default is 'simple')"); System.out.println(" -n No triangulation"); System.out.println(" -t No stripification"); System.out.println( @@ -293,6 +295,10 @@ public class ObjLoadGLSL extends Applet { if (i < args.length - 1) { creaseAngle = (new Double(args[++i])).doubleValue(); } else usage(); + } else if (args[i].equals("-S")) { + if (i < args.length - 1) { + shaderName = args[++i]; + } else usage(); } else { usage(); } |