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


Java GL2.glGetError方法代码示例

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


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

示例1: checkGLError

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Utility method to check for GL errors. Prints stacked up errors up to a limit.
   @param g the GL context
   @param glu the GLU used to obtain the error strings
   @param msg an error message to log to e.g., show the context
 */
private void checkGLError(GL2 g, String msg) {
	int error = g.glGetError();
	int nerrors = 3;
	while ((error != GL.GL_NO_ERROR) && (nerrors-- != 0)) {
		StackTraceElement[] trace = Thread.currentThread().getStackTrace();
		if (trace.length > 1) {
			String className = trace[2].getClassName();
			String methodName = trace[2].getMethodName();
			int lineNumber = trace[2].getLineNumber();
			log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg + " at " + className + "." + methodName + " (line " + lineNumber + ")");
		} else {
			log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg);
		}
		error = g.glGetError();
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:22,代码来源:ImageDisplay.java

示例2: checkGLError

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/**
 * Utility method to check for GL errors. Prints stacked up errors up to a
 * limit.
 *
 * @param g the GL context
 * @param glu the GLU used to obtain the error strings
 * @param msg an error message to log to e.g., show the context
 */
private void checkGLError(GL2 g, String msg) {
    int error = g.glGetError();
    int nerrors = 3;
    while ((error != GL.GL_NO_ERROR) && (nerrors-- != 0)) {
        StackTraceElement[] trace = Thread.currentThread().getStackTrace();
        if (trace.length > 1) {
            String className = trace[2].getClassName();
            String methodName = trace[2].getMethodName();
            int lineNumber = trace[2].getLineNumber();
            log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg + " at " + className + "." + methodName + " (line " + lineNumber + ")");
        } else {
            log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg);
        }
        error = g.glGetError();
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:25,代码来源:ImageDisplay.java

示例3: checkGLError

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/**
 * Utility method to check for GL errors. Prints stacked up errors up to a
 * limit.
 *
 * @param g the GL context
 * @param glu the GLU used to obtain the error strings
 * @param msg an error message to log to e.g., show the context
 */
public void checkGLError(final GL2 g, final GLU glu, final String msg) {
    int error = g.glGetError();
    int nerrors = 3;
    while ((error != GL.GL_NO_ERROR) && (nerrors-- != 0)) {
        final StackTraceElement[] trace = Thread.currentThread().getStackTrace();
        if (trace.length > 1) {
            final String className = trace[2].getClassName();
            final String methodName = trace[2].getMethodName();
            final int lineNumber = trace[2].getLineNumber();
            log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg + " at "
                    + className + "." + methodName + " (line " + lineNumber + ")");
        } else {
            log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg);
        }
        // Thread.dumpStack();
        error = g.glGetError();
    }
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:27,代码来源:ChipCanvas.java

示例4: checkGLError

import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Utility method to check for GL errors. Prints stacked up errors up to a limit.
   @param g the GL context
   @param glu the GLU used to obtain the error strings
   @param msg an error message to log to e.g., show the context
 */
public void checkGLError(GL2 g, GLU glu, String msg) {
	if (g == null) {
		log.warning("null GL");
		return;
	}
	int error = g.glGetError();
	int nerrors = 3;
	while ((error != GL.GL_NO_ERROR) && (nerrors-- != 0)) {
		StackTraceElement[] trace = Thread.currentThread().getStackTrace();
		if (trace.length > 1) {
			String className = trace[2].getClassName();
			String methodName = trace[2].getMethodName();
			int lineNumber = trace[2].getLineNumber();
			log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg + " at " + className + "." + methodName + " (line " + lineNumber + ")");
		} else {
			log.warning("GL error number " + error + " " + glu.gluErrorString(error) + " : " + msg);
		}
		//             Thread.dumpStack();
		error = g.glGetError();
	}
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:27,代码来源:Series.java


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