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


Java GLES20.glGetShaderInfoLog方法代码示例

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


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

示例1: loadShader

import android.opengl.GLES20; //导入方法依赖的package包/类
private int loadShader(int shaderType, String source) throws Exception {
    int shader = GLES20.glCreateShader(shaderType);
    if (shader != 0) {
        GLES20.glShaderSource(shader, source);
        GLES20.glCompileShader(shader);
        int[] compiled = new int[1];
        GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);

        if (compiled[0] == 0) {
            String error = GLES20.glGetShaderInfoLog(shader);
            GLES20.glDeleteShader(shader);
            throw new Exception(error);
        }
    }

    return shader;
}
 
开发者ID:AgoraIO,项目名称:Agora-Video-Source-Android,代码行数:18,代码来源:Shader.java

示例2: loadShader

import android.opengl.GLES20; //导入方法依赖的package包/类
public static int loadShader(int shaderType, String source) {
    int shader = GLES20.glCreateShader(shaderType);
    if (shader != 0) {
        GLES20.glShaderSource(shader, source);
        GLES20.glCompileShader(shader);
        int[] compiled = new int[1];
        GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
        if (compiled[0] == 0) {
            String info = GLES20.glGetShaderInfoLog(shader);
            GLES20.glDeleteShader(shader);
            shader = 0;
            throw new RuntimeException("Could not compile shader " +
            shaderType + ":" + info);
        }
    }
    return shader;
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:18,代码来源:GLToolbox.java

示例3: compileShader

import android.opengl.GLES20; //导入方法依赖的package包/类
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,代码行数:18,代码来源:GlShader.java

示例4: compileShader

import android.opengl.GLES20; //导入方法依赖的package包/类
/**
 * type:
 * create a vertex shader type {@link GLES20.GL_VERTEX_SHADER}
 * or a fragment shader type {@link GLES20.GL_FRAGMENT_SHADER}
 */
@SuppressWarnings("JavadocReference")
public static int compileShader(int type, String shaderCode) {

    // Load in the  shader
    int shader = GLES20.glCreateShader(type);

    if (shader != 0) {
        // Pass in the shader source
        GLES20.glShaderSource(shader, shaderCode);

        // Compile the shader
        GLES20.glCompileShader(shader);

        // Get the compilation status.
        final int[] compileStatus = new int[1];
        GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compileStatus, 0);

        // If the compilation failed, delete the shader.
        if (compileStatus[0] == 0) {
            GLES20.glDeleteShader(shader);
            shader = 0;
        }
    }

    if (shader == 0) {
        GLES20.glGetShaderInfoLog(shader);
        throw new RuntimeException("Error creating vertex shader.");
    }

    return shader;
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:37,代码来源:Utils.java

示例5: compile

import android.opengl.GLES20; //导入方法依赖的package包/类
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,代码行数:10,代码来源:Shader.java

示例6: compile

import android.opengl.GLES20; //导入方法依赖的package包/类
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,代码行数:10,代码来源:Shader.java

示例7: loadShader

import android.opengl.GLES20; //导入方法依赖的package包/类
static int loadShader(int shaderType, String source) {
    int shader = GLES20.glCreateShader(shaderType);
    if (shader != 0) {
        GLES20.glShaderSource(shader, source);
        GLES20.glCompileShader(shader);
        int[] compiled = new int[1];
        GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0);
        if (compiled[0] == 0) {
            String info = GLES20.glGetShaderInfoLog(shader);
            GLES20.glDeleteShader(shader);
            throw new RuntimeException("Could not compile shader " + shaderType + ":" + info);
        }
    }
    return shader;
}
 
开发者ID:gplibs,项目名称:android-magic-surface-view,代码行数:16,代码来源:GLUtil.java

示例8: checkCompile

import android.opengl.GLES20; //导入方法依赖的package包/类
private void checkCompile(int shader) {
    final int[] compileStatus = new int[1];
    GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compileStatus, 0);

    if(compileStatus[0] == 0) {
        GLES20.glDeleteShader(shader);
        throw new RuntimeException("Failed to compile shader: " + GLES20.glGetShaderInfoLog(shader));
    }
}
 
开发者ID:snada,项目名称:BitmapFontLoader,代码行数:10,代码来源:ShaderProgram.java


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