本文整理汇总了Java中org.andengine.opengl.shader.exception.ShaderProgramCompileException类的典型用法代码示例。如果您正苦于以下问题:Java ShaderProgramCompileException类的具体用法?Java ShaderProgramCompileException怎么用?Java ShaderProgramCompileException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShaderProgramCompileException类属于org.andengine.opengl.shader.exception包,在下文中一共展示了ShaderProgramCompileException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compileShader
import org.andengine.opengl.shader.exception.ShaderProgramCompileException; //导入依赖的package包/类
private static int compileShader(final String pSource, final int pType) throws ShaderProgramException {
final int shaderID = GLES20.glCreateShader(pType);
if (shaderID == 0) {
throw new ShaderProgramException("Could not create Shader of type: '" + pType + '"');
}
GLES20.glShaderSource(shaderID, pSource);
GLES20.glCompileShader(shaderID);
GLES20.glGetShaderiv(shaderID, GLES20.GL_COMPILE_STATUS, ShaderProgram.HARDWAREID_CONTAINER, 0);
if (ShaderProgram.HARDWAREID_CONTAINER[0] == 0) {
throw new ShaderProgramCompileException(GLES20.glGetShaderInfoLog(shaderID), pSource);
}
return shaderID;
}
示例2: compileShader
import org.andengine.opengl.shader.exception.ShaderProgramCompileException; //导入依赖的package包/类
private static int compileShader(final String pSource, final int pType) throws ShaderProgramException {
final int shaderID = GLES20.glCreateShader(pType);
if(shaderID == 0) {
throw new ShaderProgramException("Could not create Shader of type: '" + pType + '"');
}
GLES20.glShaderSource(shaderID, pSource);
GLES20.glCompileShader(shaderID);
GLES20.glGetShaderiv(shaderID, GLES20.GL_COMPILE_STATUS, ShaderProgram.HARDWAREID_CONTAINER, 0);
if(ShaderProgram.HARDWAREID_CONTAINER[0] == 0) {
throw new ShaderProgramCompileException(GLES20.glGetShaderInfoLog(shaderID), pSource);
}
return shaderID;
}