From 9047ebb970bcbc88a2d563045cacd520b1e10e0b Mon Sep 17 00:00:00 2001 From: tom lee Date: Tue, 21 Dec 2021 14:05:49 +0800 Subject: [PATCH] GLProxy: Now always log OpenGL supported version --- .../com/seibel/lod/core/render/GLProxy.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/seibel/lod/core/render/GLProxy.java b/src/main/java/com/seibel/lod/core/render/GLProxy.java index d3980029e..35ce8c48e 100644 --- a/src/main/java/com/seibel/lod/core/render/GLProxy.java +++ b/src/main/java/com/seibel/lod/core/render/GLProxy.java @@ -97,7 +97,7 @@ public class GLProxy private final GpuUploadMethod preferredUploadMethod; - private String getVersionInfo(GLCapabilities c) { + private String getFailedVersionInfo(GLCapabilities c) { StringBuilder str = new StringBuilder("Your supported OpenGL version:\n"); str.append("1.1: "+c.OpenGL11+"\n"); @@ -124,6 +124,29 @@ public class GLProxy + " (How you turn that on, I have no clue~)"); return str.toString(); } + private String getVersionInfo(GLCapabilities c) { + StringBuilder str = new StringBuilder("Your supported OpenGL version:\n"); + + str.append("1.1: "+c.OpenGL11+"\n"); + str.append("1.2: "+c.OpenGL12+"\n"); + str.append("1.3: "+c.OpenGL13+"\n"); + str.append("1.4: "+c.OpenGL14+"\n"); + str.append("1.5: "+c.OpenGL15+"\n"); + str.append("2.0: "+c.OpenGL20+"\n"); + str.append("2.1: "+c.OpenGL21+"\n"); + str.append("3.0: "+c.OpenGL30+"\n"); + str.append("3.1: "+c.OpenGL31+"\n"); + str.append("3.2: "+c.OpenGL32+" <- REQUIRED\n"); + str.append("3.3: "+c.OpenGL33+"\n"); + str.append("4.0: "+c.OpenGL40+"\n"); + str.append("4.1: "+c.OpenGL41+"\n"); + str.append("4.2: "+c.OpenGL42+"\n"); + str.append("4.3: "+c.OpenGL43+" <- optional improvement\n"); + str.append("4.4: "+c.OpenGL44+" <- optional improvement\n"); + str.append("4.5: "+c.OpenGL45+"\n"); + str.append("4.6: "+c.OpenGL46+"\n"); + return str.toString(); + } /** @@ -155,7 +178,7 @@ public class GLProxy // crash the game if the GPU doesn't support OpenGL 3.2 if (!minecraftGlCapabilities.OpenGL32) { - String supportedVersionInfo = getVersionInfo(minecraftGlCapabilities); + String supportedVersionInfo = getFailedVersionInfo(minecraftGlCapabilities); // Note: as of MC 1.17 this shouldn't happen since MC // requires OpenGL 3.2, but for older MC version this will warn the player. @@ -164,6 +187,7 @@ public class GLProxy "Additional info:\n"+supportedVersionInfo; MC.crashMinecraft(errorMessage, new UnsupportedOperationException("This GPU doesn't support OpenGL 3.2.")); } + ClientApi.LOGGER.info(getVersionInfo(minecraftGlCapabilities)); // context creation setup GLFW.glfwDefaultWindowHints();