當前位置: 首頁>>代碼示例>>Java>>正文


Java GLES20.glGetProgramInfoLog方法代碼示例

本文整理匯總了Java中android.opengl.GLES20.glGetProgramInfoLog方法的典型用法代碼示例。如果您正苦於以下問題:Java GLES20.glGetProgramInfoLog方法的具體用法?Java GLES20.glGetProgramInfoLog怎麽用?Java GLES20.glGetProgramInfoLog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.opengl.GLES20的用法示例。


在下文中一共展示了GLES20.glGetProgramInfoLog方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setProgram

import android.opengl.GLES20; //導入方法依賴的package包/類
public void setProgram(int vertexShader, int fragmentShader, Context context)
        throws Exception {
    String vertexSource = loadRawString(vertexShader, context);
    String fragmentSource = loadRawString(fragmentShader, context);

    mShaderVertex = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
    mShaderFragment = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);

    int program = GLES20.glCreateProgram();
    if (program != 0) {
        GLES20.glAttachShader(program, mShaderVertex);
        GLES20.glAttachShader(program, mShaderFragment);
        GLES20.glLinkProgram(program);
        int[] linkStatus = new int[1];
        GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
        if (linkStatus[0] != GLES20.GL_TRUE) {
            String error = GLES20.glGetProgramInfoLog(program);
            deleteProgram();
            throw new Exception(error);
        }
    }

    mProgram = program;
    mShaderHandleMap.clear();
}
 
開發者ID:AgoraIO,項目名稱:Agora-Video-Source-Android,代碼行數:26,代碼來源:Shader.java

示例2: updateProgram

import android.opengl.GLES20; //導入方法依賴的package包/類
static void updateProgram(int program, String vertexSource, String fragmentSource) {
    int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
    if (vertexShader == 0) {
        return;
    }
    int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
    if (pixelShader == 0) {
        return;
    }
    if (program != 0) {
        GLES20.glAttachShader(program, vertexShader);
        checkGlError("glAttachShader");
        GLES20.glAttachShader(program, pixelShader);
        checkGlError("glAttachShader");
        GLES20.glLinkProgram(program);
        int[] linkStatus = new int[1];
        GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
        if (linkStatus[0] != GLES20.GL_TRUE) {
            String info = GLES20.glGetProgramInfoLog(program);
            GLES20.glDeleteProgram(program);
            throw new RuntimeException("Could not link program: " + info);
        }
    }
}
 
開發者ID:gplibs,項目名稱:android-magic-surface-view,代碼行數:25,代碼來源:GLUtil.java

示例3: link

import android.opengl.GLES20; //導入方法依賴的package包/類
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,代碼行數:10,代碼來源:Program.java

示例4: link

import android.opengl.GLES20; //導入方法依賴的package包/類
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,代碼行數:10,代碼來源:Program.java

示例5: createProgram

import android.opengl.GLES20; //導入方法依賴的package包/類
public static int createProgram(String vertexSource,
        String fragmentSource) {
    int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource);
    if (vertexShader == 0) {
        return 0;
    }
    int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource);
    if (pixelShader == 0) {
        return 0;
    }

    int program = GLES20.glCreateProgram();
    if (program != 0) {
        GLES20.glAttachShader(program, vertexShader);
        checkGlError("glAttachShader");
        GLES20.glAttachShader(program, pixelShader);
        checkGlError("glAttachShader");
        GLES20.glLinkProgram(program);
        int[] linkStatus = new int[1];
        GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus,
                0);
        if (linkStatus[0] != GLES20.GL_TRUE) {
            String info = GLES20.glGetProgramInfoLog(program);
            GLES20.glDeleteProgram(program);
            program = 0;
            throw new RuntimeException("Could not link program: " + info);
        }
    }
    return program;
}
 
開發者ID:sdrausty,項目名稱:buildAPKsSamples,代碼行數:31,代碼來源:GLToolbox.java

示例6: GlShader

import android.opengl.GLES20; //導入方法依賴的package包/類
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,代碼行數:28,代碼來源:GlShader.java

示例7: glGetProgramInfoLog

import android.opengl.GLES20; //導入方法依賴的package包/類
public static String glGetProgramInfoLog(final int aProgramHandle)
{
    return GLES20.glGetProgramInfoLog(aProgramHandle);

}
 
開發者ID:jfcameron,項目名稱:G2Dj,代碼行數:6,代碼來源:GL.java


注:本文中的android.opengl.GLES20.glGetProgramInfoLog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。