本文整理汇总了Java中android.opengl.GLES20.glGetError方法的典型用法代码示例。如果您正苦于以下问题:Java GLES20.glGetError方法的具体用法?Java GLES20.glGetError怎么用?Java GLES20.glGetError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES20
的用法示例。
在下文中一共展示了GLES20.glGetError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFrameBuffer
import android.opengl.GLES20; //导入方法依赖的package包/类
/**
* 创建FrameBuffer
* @param hasRenderBuffer 是否启用RenderBuffer
* @param width 宽度
* @param height 高度
* @param texType 类型,一般为{@link GLES20#GL_TEXTURE_2D}
* @param texFormat 纹理格式,一般为{@link GLES20#GL_RGBA}、{@link GLES20#GL_RGB}等
* @param minParams 纹理的缩小过滤参数
* @param maxParams 纹理的放大过滤参数
* @param wrapS 纹理的S环绕参数
* @param wrapT 纹理的W环绕参数
* @return 创建结果,0表示成功,其他值为GL错误
*/
public int createFrameBuffer(boolean hasRenderBuffer,int width,int height,int texType,int texFormat,
int minParams,int maxParams,int wrapS,int wrapT){
mFrameTemp=new int[4];
GLES20.glGenFramebuffers(1,mFrameTemp,0);
GLES20.glGenTextures(1,mFrameTemp,1);
GLES20.glBindTexture(texType,mFrameTemp[1]);
GLES20.glTexImage2D(texType, 0,texFormat, width, height,
0, texFormat, GLES20.GL_UNSIGNED_BYTE, null);
//设置缩小过滤为使用纹理中坐标最接近的一个像素的颜色作为需要绘制的像素颜色
GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_MIN_FILTER,minParams);
//设置放大过滤为使用纹理中坐标最接近的若干个颜色,通过加权平均算法得到需要绘制的像素颜色
GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_MAG_FILTER,maxParams);
//设置环绕方向S,截取纹理坐标到[1/2n,1-1/2n]。将导致永远不会与border融合
GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_WRAP_S,wrapS);
//设置环绕方向T,截取纹理坐标到[1/2n,1-1/2n]。将导致永远不会与border融合
GLES20.glTexParameteri(texType, GLES20.GL_TEXTURE_WRAP_T,wrapT);
GLES20.glGetIntegerv(GLES20.GL_FRAMEBUFFER_BINDING,mFrameTemp,3);
GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER,mFrameTemp[0]);
GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0,
texType, mFrameTemp[1], 0);
if(hasRenderBuffer){
GLES20.glGenRenderbuffers(1,mFrameTemp,2);
GLES20.glBindRenderbuffer(GLES20.GL_RENDERBUFFER,mFrameTemp[2]);
GLES20.glRenderbufferStorage(GLES20.GL_RENDERBUFFER,GLES20.GL_DEPTH_COMPONENT16,width,height);
GLES20.glFramebufferRenderbuffer(GLES20.GL_FRAMEBUFFER,GLES20.GL_DEPTH_ATTACHMENT,GLES20.GL_RENDERBUFFER,mFrameTemp[2]);
}
return GLES20.glGetError();
}
示例2: 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;
}
示例3: assembleProgram
import android.opengl.GLES20; //导入方法依赖的package包/类
private int assembleProgram(int vertexShader, int fragmentShader, ShaderParameter[] params) {
int program = GLES20.glCreateProgram();
checkError();
if (program == 0) {
throw new RuntimeException("Cannot create GL program: " + GLES20.glGetError());
}
GLES20.glAttachShader(program, vertexShader);
checkError();
GLES20.glAttachShader(program, fragmentShader);
checkError();
GLES20.glLinkProgram(program);
checkError();
int[] mLinkStatus = mTempIntArray;
GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, mLinkStatus, 0);
if (mLinkStatus[0] != GLES20.GL_TRUE) {
Log.e(TAG, "Could not link program: ");
Log.e(TAG, GLES20.glGetProgramInfoLog(program));
GLES20.glDeleteProgram(program);
program = 0;
}
for (ShaderParameter param : params) {
param.loadHandle(program);
}
return program;
}
示例4: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Lg.e( op + ": glGetError: 0x" + Integer.toHexString(error));
throw new RuntimeException("glGetError encountered (see log)");
}
}
示例5: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
/**
* Checks to see if a GLES error has been raised.
*/
public static void checkGlError(String op) {
int error = GLES20.glGetError();
if (error != GLES20.GL_NO_ERROR) {
String msg = op + ": glError 0x" + Integer.toHexString(error);
Log.e(TAG, msg);
throw new RuntimeException(msg);
}
}
示例6: checkError
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void checkError() {
int error = GLES20.glGetError();
if (error != 0) {
Throwable t = new Throwable();
Log.e(TAG, "GL error: " + error, t);
}
}
示例7: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e(TAG, op + ": glError " + error);
throw new RuntimeException(op + ": glError " + error);
}
}
示例8: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void checkGlError(String label) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e(TAG, label + ": glError " + error);
throw new RuntimeException(label + ": glError " + error);
}
}
示例9: checkGLError
import android.opengl.GLES20; //导入方法依赖的package包/类
/**
* Checks if we've had an error inside of OpenGL ES, and if so what that error is.
*
* @param label Label to report in case of error.
* @throws RuntimeException If an OpenGL error is detected.
*/
public static void checkGLError(String tag, String label) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e(tag, label + ": glError " + error);
throw new RuntimeException(label + ": glError " + error);
}
}
示例10: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e(TAG, op + ": glError " + error);
throw new RuntimeException(op + ": glError " + error);
}
}
示例11: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
private void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
Log.e(TAG, op + ": glError " + error);
throw new RuntimeException(op + ": glError " + error);
}
}
示例12: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
static void checkGlError(String op) {
int error;
while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
throw new RuntimeException(op + ": glError " + error);
}
}
示例13: checkNoGLES2Error
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void checkNoGLES2Error(String msg) {
int error = GLES20.glGetError();
if (error != GLES20.GL_NO_ERROR) {
throw new RuntimeException(msg + ": GLES20 error: " + error);
}
}
示例14: HasGLError
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void HasGLError() {
int error = GLES20.glGetError();
if (error != 0) {
Log.d("Paint", GLUtils.getEGLErrorString(error));
}
}
示例15: checkGlError
import android.opengl.GLES20; //导入方法依赖的package包/类
public void checkGlError(String op) {
int error;
if ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
throw new RuntimeException(op + ": glError " + error);
}
}