From 721e4a94b676918c0be08046cbbb0e452b6b8212 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:11:56 +0800 Subject: [PATCH] [OpenGL] Update GLUtil --- .../src/main/java/overrungl/opengl/GLUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java index e8f2a5da..c9084818 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLUtil.java @@ -60,8 +60,8 @@ private GLUtil() { Arena setupDebugMessageCallback( T gl, GLFlags flags, - Supplier fallbackARB, - Supplier fallbackAMD + @Nullable Supplier fallbackARB, + @Nullable Supplier fallbackAMD ) { return setupDebugMessageCallback(gl, flags, fallbackARB, fallbackAMD, OverrunGL.apiLogger()); } @@ -85,8 +85,8 @@ Arena setupDebugMessageCallback( Arena setupDebugMessageCallback( T gl, GLFlags flags, - Supplier fallbackARB, - Supplier fallbackAMD, + @Nullable Supplier fallbackARB, + @Nullable Supplier fallbackAMD, Consumer logger ) { if (flags.GL43 || flags.GL_KHR_debug) { @@ -119,7 +119,7 @@ Arena setupDebugMessageCallback( return arena; } - if (flags.GL_ARB_debug_output) { + if (flags.GL_ARB_debug_output && fallbackARB != null) { apiLog("[GL] Using ARB_debug_output for error logging."); var arena = Arena.ofConfined(); fallbackARB.get().glDebugMessageCallbackARB(arena, (source, type, id, severity, message, _) -> { @@ -139,7 +139,7 @@ Arena setupDebugMessageCallback( return arena; } - if (flags.GL_AMD_debug_output) { + if (flags.GL_AMD_debug_output && fallbackAMD != null) { apiLog("[GL] Using AMD_debug_output for error logging."); var arena = Arena.ofConfined(); fallbackAMD.get().glDebugMessageCallbackAMD(arena, (id, category, severity, message, _) -> {