ARBDebugOutput.glDebugMessageCallbackARB(new LwjglGLDebugOutputHandler(), 0);
/** * Enables or disables GL debug messages for the specified severity level. Returns false if the severity * level could not be set (e.g. the NOTIFICATION level is not supported by the ARB and AMD extensions). * * See {@link Lwjgl3ApplicationConfiguration#enableGLDebugOutput(boolean, PrintStream)} */ public static boolean setGLDebugMessageControl (GLDebugMessageSeverity severity, boolean enabled) { GLCapabilities caps = GL.getCapabilities(); final int GL_DONT_CARE = 0x1100; // not defined anywhere yet if (caps.OpenGL43) { GL43.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, severity.gl43, (IntBuffer) null, enabled); return true; } if (caps.GL_KHR_debug) { KHRDebug.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, severity.khr, (IntBuffer) null, enabled); return true; } if (caps.GL_ARB_debug_output && severity.arb != -1) { ARBDebugOutput.glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, severity.arb, (IntBuffer) null, enabled); return true; } if (caps.GL_AMD_debug_output && severity.amd != -1) { AMDDebugOutput.glDebugMessageEnableAMD(GL_DONT_CARE, severity.amd, (IntBuffer) null, enabled); return true; } return false; }
/** * Controls the volume of debug output by disabling specific or groups of messages. * * <p>If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.</p> * * <p>This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following * ways:</p> * * <ul> * <li>If {@code source} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose source does not match {@code source} will not be referenced.</li> * <li>If {@code type} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose type does not match {@code type} will not be referenced.</li> * <li>If {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose severity level does not match {@code severity} will not be referenced.</li> * <li>If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If {@code count} is zero, the value if {@code ids} is ignored.</li> * </ul> * * <p>Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a * single call, and individually disabling all messages from that source using their types and IDs.</p> * * @param source the message source. One of:<br><table><tr><td>{@link #GL_DEBUG_SOURCE_API_ARB DEBUG_SOURCE_API_ARB}</td><td>{@link #GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB DEBUG_SOURCE_WINDOW_SYSTEM_ARB}</td></tr><tr><td>{@link #GL_DEBUG_SOURCE_SHADER_COMPILER_ARB DEBUG_SOURCE_SHADER_COMPILER_ARB}</td><td>{@link #GL_DEBUG_SOURCE_THIRD_PARTY_ARB DEBUG_SOURCE_THIRD_PARTY_ARB}</td></tr><tr><td>{@link #GL_DEBUG_SOURCE_APPLICATION_ARB DEBUG_SOURCE_APPLICATION_ARB}</td><td>{@link #GL_DEBUG_SOURCE_OTHER_ARB DEBUG_SOURCE_OTHER_ARB}</td></tr></table> * @param type the message type. One of:<br><table><tr><td>{@link #GL_DEBUG_TYPE_ERROR_ARB DEBUG_TYPE_ERROR_ARB}</td><td>{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB}</td></tr><tr><td>{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB}</td><td>{@link #GL_DEBUG_TYPE_PORTABILITY_ARB DEBUG_TYPE_PORTABILITY_ARB}</td></tr><tr><td>{@link #GL_DEBUG_TYPE_PERFORMANCE_ARB DEBUG_TYPE_PERFORMANCE_ARB}</td><td>{@link #GL_DEBUG_TYPE_OTHER_ARB DEBUG_TYPE_OTHER_ARB}</td></tr></table> * @param severity the message severity level. One of:<br><table><tr><td>{@link #GL_DEBUG_SEVERITY_HIGH_ARB DEBUG_SEVERITY_HIGH_ARB}</td><td>{@link #GL_DEBUG_SEVERITY_MEDIUM_ARB DEBUG_SEVERITY_MEDIUM_ARB}</td><td>{@link #GL_DEBUG_SEVERITY_LOW_ARB DEBUG_SEVERITY_LOW_ARB}</td></tr></table> * @param ids the message IDs to enable or disable * @param enabled whether to enable or disable the references subset of messages */ public static void glDebugMessageControlARB(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") IntBuffer ids, @NativeType("GLboolean") boolean enabled) { nglDebugMessageControlARB(source, type, severity, remainingSafe(ids), memAddressSafe(ids), enabled); }
nglDebugMessageCallbackARB(memAddressSafe(callback), userParam);
GL_ARB_copy_image = ext.contains("GL_ARB_copy_image") && checkExtension("GL_ARB_copy_image", ARBCopyImage.isAvailable(this)); GL_ARB_cull_distance = ext.contains("GL_ARB_cull_distance"); GL_ARB_debug_output = ext.contains("GL_ARB_debug_output") && checkExtension("GL_ARB_debug_output", ARBDebugOutput.isAvailable(this)); GL_ARB_depth_buffer_float = ext.contains("GL_ARB_depth_buffer_float"); GL_ARB_depth_clamp = ext.contains("GL_ARB_depth_clamp");
try { IntBuffer ids = stack.ints(id); nglDebugMessageControlARB(source, type, severity, 1, memAddress(ids), enabled); } finally { stack.setPointer(stackPointer);
ARBDebugOutput.glDebugMessageCallbackARB(new LwjglGLDebugOutputHandler(), 0);
/** * Enables or disables GL debug messages for the specified severity level. Returns false if the severity * level could not be set (e.g. the NOTIFICATION level is not supported by the ARB and AMD extensions). * * See {@link Lwjgl3ApplicationConfiguration#enableGLDebugOutput(boolean, PrintStream)} */ public static boolean setGLDebugMessageControl (GLDebugMessageSeverity severity, boolean enabled) { GLCapabilities caps = GL.getCapabilities(); final int GL_DONT_CARE = 0x1100; // not defined anywhere yet if (caps.OpenGL43) { GL43.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, severity.gl43, (IntBuffer) null, enabled); return true; } if (caps.GL_KHR_debug) { KHRDebug.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, severity.khr, (IntBuffer) null, enabled); return true; } if (caps.GL_ARB_debug_output && severity.arb != -1) { ARBDebugOutput.glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, severity.arb, (IntBuffer) null, enabled); return true; } if (caps.GL_AMD_debug_output && severity.amd != -1) { AMDDebugOutput.glDebugMessageEnableAMD(GL_DONT_CARE, severity.amd, (IntBuffer) null, enabled); return true; } return false; }
ARBDebugOutput.glDebugMessageCallbackARB(new ARBDebugOutputCallback(new LwjglGLDebugOutputHandler()));
/** * Enables or disables GL debug messages for the specified severity level. Returns false if the severity * level could not be set (e.g. the NOTIFICATION level is not supported by the ARB and AMD extensions). * * See {@link Lwjgl3ApplicationConfiguration#enableGLDebugOutput(boolean, PrintStream)} */ public static boolean setGLDebugMessageControl (GLDebugMessageSeverity severity, boolean enabled) { GLCapabilities caps = GL.getCapabilities(); final int GL_DONT_CARE = 0x1100; // not defined anywhere yet if (caps.OpenGL43) { GL43.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, severity.gl43, (IntBuffer) null, enabled); return true; } if (caps.GL_KHR_debug) { KHRDebug.glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, severity.khr, (IntBuffer) null, enabled); return true; } if (caps.GL_ARB_debug_output && severity.arb != -1) { ARBDebugOutput.glDebugMessageControlARB(GL_DONT_CARE, GL_DONT_CARE, severity.arb, (IntBuffer) null, enabled); return true; } if (caps.GL_AMD_debug_output && severity.amd != -1) { AMDDebugOutput.glDebugMessageEnableAMD(GL_DONT_CARE, severity.amd, (IntBuffer) null, enabled); return true; } return false; }
LWJGLDebugOutput(LWJGL15DrawContext dc) { if(dc.glcaps.GL_KHR_debug) { GL11.glEnable(KHRDebug.GL_DEBUG_OUTPUT_SYNCHRONOUS); KHRDebug.glDebugMessageCallback(debugCallback, 0); } else if(dc.glcaps.GL_ARB_debug_output) { GL11.glEnable(ARBDebugOutput.GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB); ARBDebugOutput.glDebugMessageCallbackARB(debugCallbackARB, 0); } }
ARBDebugOutput.glDebugMessageCallbackARB(new LwjglGLDebugOutputHandler(), 0);
ARBDebugOutput.glDebugMessageCallbackARB(new ARBDebugOutputCallback());
printDetail(stream, "Message", GLDebugMessageARBCallback.getMessage(length, message)); }); glDebugMessageCallbackARB(proc, NULL); return proc;