當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。