Back to project page model-explorer.
The source code is released under:
Apache License
If you think the Android project model-explorer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.etaoin.myopengltest.util.shaders; //from w w w . j a v a 2 s.c om /** * Factory for all the available shaders. */ public class ShaderFactory { public static final int SAMPLE_VERTEX_SHADER = 0; public static final int SAMPLE_FRAGMENT_SHADER = 1; public Shader create(int type) throws InvalidShaderTypeException{ Shader shader; switch (type) { case SAMPLE_VERTEX_SHADER: shader = new SampleVertexShader(); break; case SAMPLE_FRAGMENT_SHADER: shader = new SampleFragmentShader(); break; default: throw new InvalidShaderTypeException(type); } return shader; } public static class InvalidShaderTypeException extends Exception { public InvalidShaderTypeException(int type) { super("Trying to create a shader with an invalid type: " + type); } } }