本文整理汇总了Java中com.jogamp.opengl.GL4.glDebugMessageInsert方法的典型用法代码示例。如果您正苦于以下问题:Java GL4.glDebugMessageInsert方法的具体用法?Java GL4.glDebugMessageInsert怎么用?Java GL4.glDebugMessageInsert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL4
的用法示例。
在下文中一共展示了GL4.glDebugMessageInsert方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private void validate(GL4 gl4) {
int[] status = {0};
gl4.glValidateProgramPipeline(pipelineName.get(0));
gl4.glGetProgramPipelineiv(pipelineName.get(0), GL_VALIDATE_STATUS, status, 0);
if (status[0] != GL_TRUE) {
int[] lengthMax = {0};
gl4.glGetProgramPipelineiv(pipelineName.get(0), GL_INFO_LOG_LENGTH, lengthMax, 0);
int[] lengthQuery = {0};
byte[] infoLog = new byte[lengthMax[0] + 1];
gl4.glGetProgramPipelineInfoLog(pipelineName.get(0), infoLog.length,
lengthQuery, 0,
infoLog, 0);
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER, 76,
GL_DEBUG_SEVERITY_LOW,
lengthQuery[0],
new String(infoLog).trim());
}
}
示例2: validate
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private void validate(GL4 gl4) {
int[] status = {0};
gl4.glValidateProgramPipeline(pipelineName.get(0));
gl4.glGetProgramPipelineiv(pipelineName.get(0), GL_VALIDATE_STATUS, status, 0);
if (status[0] != GL_TRUE) {
int[] lengthMax = {0};
gl4.glGetProgramPipelineiv(pipelineName.get(0), GL_INFO_LOG_LENGTH, lengthMax, 0);
IntBuffer lengthQuery = GLBuffers.newDirectIntBuffer(1);
ByteBuffer infoLog = GLBuffers.newDirectByteBuffer(lengthMax[0] + 1);
gl4.glGetProgramPipelineInfoLog(pipelineName.get(0), infoLog.capacity(), lengthQuery, infoLog);
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER, 76,
GL_DEBUG_SEVERITY_LOW,
lengthQuery.get(0), new String(infoLog.array()).trim());
}
}
示例3: validate
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private void validate(GL4 gl4) {
int[] status = {0};
gl4.glValidateProgramPipeline(pipelineName[0]);
gl4.glGetProgramPipelineiv(pipelineName[0], GL_VALIDATE_STATUS, status, 0);
if (status[0] != GL_TRUE) {
int[] lengthMax = {0};
gl4.glGetProgramPipelineiv(pipelineName[0], GL_INFO_LOG_LENGTH, lengthMax, 0);
int[] lengthQuery = {0};
byte[] infoLog = new byte[lengthMax[0] + 1];
gl4.glGetProgramPipelineInfoLog(pipelineName[0], infoLog.length, lengthQuery, 0, infoLog, 0);
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER, 76,
GL_DEBUG_SEVERITY_LOW,
lengthQuery[0], new String(infoLog).trim());
}
}
示例4: validate
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private void validate(GL4 gl4) {
int[] status = {0};
int[] lengthMax = {0};
gl4.glValidateProgramPipeline(pipelineName.get(0));
gl4.glGetProgramPipelineiv(pipelineName.get(0), GL_VALIDATE_STATUS, status, 0);
gl4.glGetProgramPipelineiv(pipelineName.get(0), GL_INFO_LOG_LENGTH, lengthMax, 0);
int[] lengthQuery = {0};
byte[] infoLog = new byte[lengthMax[0] + 1];
gl4.glGetProgramPipelineInfoLog(pipelineName.get(0), infoLog.length, lengthQuery, 0, infoLog, 0);
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER, 76,
GL_DEBUG_SEVERITY_LOW,
lengthQuery[0],
new String(infoLog).trim());
}
示例5: begin
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean begin(GL gl) {
GL4 gl4 = (GL4) gl;
boolean validated = true;
if (validated && gl4.isExtensionAvailable("GL_KHR_debug")) {
validated = initDebug(gl4);
}
if (validated) {
validated = initProgram(gl4);
}
if (validated) {
validated = initBuffer(gl4);
}
if (validated) {
validated = initVertexArray(gl4);
}
if (validated) {
validated = initTexture(gl4);
}
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_MARKER,
1,
GL_DEBUG_SEVERITY_NOTIFICATION,
-1,
"End initialization");
return validated;
}
示例6: logImplementationDependentLimit
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
protected void logImplementationDependentLimit(GL4 gl4, int value, String string) {
IntBuffer result = GLBuffers.newDirectIntBuffer(1);
gl4.glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, GL_DEBUG_SEVERITY_LOW, 0, null, true);
gl4.glGetIntegerv(value, result);
String limit = string + ": " + result.get(0);
if (gl4.isExtensionAvailable("GL_KHR_debug")) {
gl4.glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, 1, GL_DEBUG_SEVERITY_LOW,
limit.length(), limit);
}
gl4.glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, GL_DEBUG_SEVERITY_LOW, 0, null, false);
BufferUtils.destroyDirectBuffer(result);
}
示例7: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
boolean validated = true;
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
gl4.glGenTextures(1, textureName);
gl4.glActiveTexture(GL_TEXTURE0);
gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(0));
gl4.glObjectLabel(GL_TEXTURE, textureName.get(0), -1, "Texture object".getBytes(), 0);
gl4.glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 1,
GL_DEBUG_SEVERITY_NOTIFICATION, -1, "Throwing an error on glTexParameteri");
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_RED);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_BLUE);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_LINEAR); // Generates an error GL_LINEAR instead of GL_ALPHA
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, texture.levels() - 1);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl4.glTexStorage2D(GL_TEXTURE_2D, texture.levels(), GL_RGBA8,
texture.dimensions(0)[0], texture.dimensions(0)[1]);
for (int level = 0; level < texture.levels(); ++level) {
gl4.glTexSubImage2D(
GL_TEXTURE_2D,
level,
0, 0,
texture.dimensions(level)[0],
texture.dimensions(level)[1],
GL_BGR, GL_UNSIGNED_BYTE,
texture.data(level));
}
gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
} catch (IOException ex) {
Logger.getLogger(Gl_430_debug.class.getName()).log(Level.SEVERE, null, ex);
}
return validated;
}
示例8: initDebug
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initDebug(GL4 gl4) {
boolean validated = true;
gl4.glEnable(GL_DEBUG_OUTPUT);
gl4.glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
gl4.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, null, true);
// gl4.glDebugMessageCallback(&test::debugOutput, this);
gl4.glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, -1, "Message test: Begin".getBytes(), 0);
int[] messageId = {4};
gl4.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, null, FALSE);
gl4.glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, GL_DONT_CARE, 0, null, true);
gl4.glDebugMessageControl(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_OTHER, GL_DONT_CARE, 1, messageId, 0, false);
String message1 = "Message 1";
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER, 1,
GL_DEBUG_SEVERITY_MEDIUM,
message1.length(), message1);
String message2 = "Message 2";
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_THIRD_PARTY,
GL_DEBUG_TYPE_OTHER, 2,
GL_DEBUG_SEVERITY_MEDIUM,
message2.length(), message2);
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER, 2,
GL_DEBUG_SEVERITY_MEDIUM,
-1, "Message 3");
gl4.glDebugMessageInsert(
GL_DEBUG_SOURCE_APPLICATION,
GL_DEBUG_TYPE_OTHER, messageId[0],
GL_DEBUG_SEVERITY_MEDIUM,
-1, "Message 4");
gl4.glPopDebugGroup();
return validated;
}
示例9: render
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean render(GL gl) {
GL4 gl4 = (GL4) gl;
gl4.glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 1, -1, "Frame".getBytes(), 0);
{
gl4.glBindBuffer(GL_UNIFORM_BUFFER, bufferName.get(Buffer.TRANSFORM));
ByteBuffer pointer = gl4.glMapBufferRange(
GL_UNIFORM_BUFFER, 0, Mat4.SIZE,
GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
Mat4 projection = glm.perspectiveFov_((float) Math.PI * 0.25f, windowSize.x, windowSize.y, 0.1f, 100.0f);
Mat4 model = new Mat4(1.0f);
projection.mul(viewMat4()).mul(model).toDbb(pointer);
// Make sure the uniform buffer is uploaded
gl4.glUnmapBuffer(GL_UNIFORM_BUFFER);
}
gl4.glViewportIndexedf(0, 0, 0, windowSize.x, windowSize.y);
gl4.glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 1, GL_DEBUG_SEVERITY_NOTIFICATION,
-1, "Throwing an error on glClearBufferfv");
gl4.glClearBufferfv(GL_COLOR, 0, clearColor.put(0, 1.0f).put(1, 0.5f).put(2, 0.0f).put(3, 1.0f));
// Add an error for testing: GL_TEXTURE_2D instead of GL_COLOR
// gl4.glClearBufferfv(GL_TEXTURE_2D, 0, clearColor.put(0, 1.0f).put(1, 0.5f).put(2, 0.0f).put(3, 1.0f));
gl4.glBindProgramPipeline(pipelineName.get(0));
gl4.glActiveTexture(GL_TEXTURE0);
gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(0));
gl4.glBindVertexArray(vertexArrayName.get(0));
gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName.get(Buffer.TRANSFORM));
gl4.glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 1, GL_DEBUG_SEVERITY_NOTIFICATION,
-1, "Throwing an error on glDrawElementsInstancedBaseVertexBaseInstance");
// Add an error for testing: GL_FLOAT instead of GL_UNSIGNED_SHORT
// gl4.glDrawElementsInstancedBaseVertexBaseInstance(GL_TRIANGLES, elementCount, GL_FLOAT, 0, 1, 0, 0);
gl4.glDrawElementsInstancedBaseVertexBaseInstance(GL_TRIANGLES, elementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0);
gl4.glPopDebugGroup();
return true;
}