当前位置: 首页>>代码示例>>Java>>正文


Java GLES20.GL_FALSE属性代码示例

本文整理汇总了Java中android.opengl.GLES20.GL_FALSE属性的典型用法代码示例。如果您正苦于以下问题:Java GLES20.GL_FALSE属性的具体用法?Java GLES20.GL_FALSE怎么用?Java GLES20.GL_FALSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.opengl.GLES20的用法示例。


在下文中一共展示了GLES20.GL_FALSE属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compileShader

private static int compileShader(int type, String shader) {
    int shaderObj = GLES20.glCreateShader(type);

    if (shaderObj == 0) {
        Log.e(TAG, "create shader obj fail: " + type);
        return 0;
    }

    GLES20.glShaderSource(shaderObj, shader);
    GLES20.glCompileShader(shaderObj);

    final int[] compileStatus = new int[1];
    GLES20.glGetShaderiv(shaderObj, GLES20.GL_COMPILE_STATUS, compileStatus, 0);

    if (compileStatus[0] == GLES20.GL_FALSE) {
        Log.e(TAG, "compile shader code fail: " + type + ", "
                   + GLES20.glGetShaderInfoLog(shaderObj));

        GLES20.glDeleteShader(shaderObj);
        return 0;
    }

    return shaderObj;
}
 
开发者ID:Piasy,项目名称:OpenGLESTutorial-Android,代码行数:24,代码来源:ShaderHelper.java

示例2: compileShader

private static int compileShader(int shaderType, String source) {
  final int shader = GLES20.glCreateShader(shaderType);
  if (shader == 0) {
    throw new RuntimeException("glCreateShader() failed. GLES20 error: " + GLES20.glGetError());
  }
  GLES20.glShaderSource(shader, source);
  GLES20.glCompileShader(shader);
  int[] compileStatus = new int[] {GLES20.GL_FALSE};
  GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compileStatus, 0);
  if (compileStatus[0] != GLES20.GL_TRUE) {
    Logging.e(
        TAG, "Could not compile shader " + shaderType + ":" + GLES20.glGetShaderInfoLog(shader));
    throw new RuntimeException(GLES20.glGetShaderInfoLog(shader));
  }
  GlUtil.checkNoGLES2Error("compileShader");
  return shader;
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:17,代码来源:GlShader.java

示例3: link

public void link() {
	GLES20.glLinkProgram(handle);

	int[] status = new int[1];
	GLES20.glGetProgramiv(handle, GLES20.GL_LINK_STATUS, status, 0);
	if (status[0] == GLES20.GL_FALSE) {
		throw new Error(GLES20.glGetProgramInfoLog(handle));
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:Program.java

示例4: compile

public void compile() {
	GLES20.glCompileShader(handle);

	int[] status = new int[1];
	GLES20.glGetShaderiv(handle, GLES20.GL_COMPILE_STATUS, status, 0);
	if (status[0] == GLES20.GL_FALSE) {
		throw new Error(GLES20.glGetShaderInfoLog(handle));
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:Shader.java

示例5: link

public void link() {
	GLES20.glLinkProgram( handle );
	
	int[] status = new int[1];
	GLES20.glGetProgramiv( handle, GLES20.GL_LINK_STATUS, status, 0 );
	if (status[0] == GLES20.GL_FALSE) {
		throw new Error( GLES20.glGetProgramInfoLog( handle ) );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:9,代码来源:Program.java

示例6: compile

public void compile() {
	GLES20.glCompileShader( handle );

	int[] status = new int[1];
	GLES20.glGetShaderiv( handle, GLES20.GL_COMPILE_STATUS, status, 0 );
	if (status[0] == GLES20.GL_FALSE) {
		throw new Error( GLES20.glGetShaderInfoLog( handle ) );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:9,代码来源:Shader.java

示例7: GlShader

public GlShader(String vertexSource, String fragmentSource) {
  final int vertexShader = compileShader(GLES20.GL_VERTEX_SHADER, vertexSource);
  final int fragmentShader = compileShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
  program = GLES20.glCreateProgram();
  if (program == 0) {
    throw new RuntimeException("glCreateProgram() failed. GLES20 error: " + GLES20.glGetError());
  }
  GLES20.glAttachShader(program, vertexShader);
  GLES20.glAttachShader(program, fragmentShader);
  GLES20.glLinkProgram(program);
  int[] linkStatus = new int[] {GLES20.GL_FALSE};
  GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
  if (linkStatus[0] != GLES20.GL_TRUE) {
    Logging.e(TAG, "Could not link program: " + GLES20.glGetProgramInfoLog(program));
    throw new RuntimeException(GLES20.glGetProgramInfoLog(program));
  }
  // According to the documentation of glLinkProgram():
  // "After the link operation, applications are free to modify attached shader objects, compile
  // attached shader objects, detach shader objects, delete shader objects, and attach additional
  // shader objects. None of these operations affects the information log or the program that is
  // part of the program object."
  // But in practice, detaching shaders from the program seems to break some devices. Deleting the
  // shaders are fine however - it will delete them when they are no longer attached to a program.
  GLES20.glDeleteShader(vertexShader);
  GLES20.glDeleteShader(fragmentShader);
  GlUtil.checkNoGLES2Error("Creating GlShader");
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:27,代码来源:GlShader.java

示例8: compileShader

private CompilationResult compileShader(int type, String shaderCode) {
    int shader = GLES20.glCreateShader(type);
    GLES20.glShaderSource(shader, shaderCode);
    GLES20.glCompileShader(shader);

    int[] compileStatus = new int[1];
    GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compileStatus, 0);
    if (compileStatus[0] == GLES20.GL_FALSE) {
        FileLog.e("tmessages", GLES20.glGetShaderInfoLog(shader));
    }

    return new CompilationResult(shader, compileStatus[0]);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:13,代码来源:Shader.java

示例9: linkProgram

private int linkProgram(int program) {
    GLES20.glLinkProgram(program);

    int[] linkStatus = new int[1];
    GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
    if (linkStatus[0] == GLES20.GL_FALSE) {
        FileLog.e("tmessages", GLES20.glGetProgramInfoLog(program));
    }

    return linkStatus[0];
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:11,代码来源:Shader.java

示例10: linkProgram

public static int linkProgram(int vertexShader, int fragmentShader) {
    int program = GLES20.glCreateProgram();

    if (program == 0) {
        Log.e(TAG, "create program fail, " + GLES20.glGetProgramInfoLog(program));

        return 0;
    }

    GLES20.glAttachShader(program, vertexShader);
    GLES20.glAttachShader(program, fragmentShader);

    GLES20.glLinkProgram(program);

    int[] linkStatus = new int[1];
    GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);

    if (linkStatus[0] == GLES20.GL_FALSE) {
        Log.e(TAG, "link program fail, " + GLES20.glGetProgramInfoLog(program));

        return 0;
    }

    return program;
}
 
开发者ID:Piasy,项目名称:OpenGLESTutorial-Android,代码行数:25,代码来源:ShaderHelper.java

示例11: Shader

public Shader(String vertexShader, String fragmentShader, String attributes[], String uniforms[]) {
    this.program = GLES20.glCreateProgram();

    CompilationResult vResult = compileShader(GLES20.GL_VERTEX_SHADER, vertexShader);
    if (vResult.status == GLES20.GL_FALSE) {
        FileLog.e("tmessages", "Vertex shader compilation failed");
        destroyShader(vResult.shader, 0, program);
        return;
    }

    CompilationResult fResult = compileShader(GLES20.GL_FRAGMENT_SHADER, fragmentShader);
    if (fResult.status == GLES20.GL_FALSE) {
        FileLog.e("tmessages", "Fragment shader compilation failed");
        destroyShader(vResult.shader, fResult.shader, program);
        return;
    }

    GLES20.glAttachShader(program, vResult.shader);
    GLES20.glAttachShader(program, fResult.shader);

    for (int i = 0; i < attributes.length; i++) {
        GLES20.glBindAttribLocation(program, i, attributes[i]);
    }

    if (linkProgram(program) == GLES20.GL_FALSE) {
        destroyShader(vResult.shader, fResult.shader, program);
        return;
    }

    for (String uniform : uniforms) {
        uniformsMap.put(uniform, GLES20.glGetUniformLocation(program, uniform));
    }

    if (vResult.shader != 0) {
        GLES20.glDeleteShader(vResult.shader);
    }

    if (fResult.shader != 0) {
        GLES20.glDeleteShader(fResult.shader);
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:41,代码来源:Shader.java


注:本文中的android.opengl.GLES20.GL_FALSE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。