From 34c0f5aa316c124069e52f82c1c99c193f0288e2 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Sat, 13 Feb 2021 13:39:55 +0100 Subject: [PATCH] rendering: fix shader loading --- .../minosoft/gui/rendering/shader/ShaderUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/shader/ShaderUtil.java b/src/main/java/de/bixilon/minosoft/gui/rendering/shader/ShaderUtil.java index 0a7c0a301..b3c29ca46 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/shader/ShaderUtil.java +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/shader/ShaderUtil.java @@ -8,21 +8,22 @@ import org.lwjgl.opengl.GL11; import java.io.IOException; +import static org.lwjgl.opengl.ARBShaderObjects.*; import static org.lwjgl.system.MemoryUtil.NULL; public class ShaderUtil { public static int createShader(String shaderPath, int shaderType) throws ShaderLoadingException, IOException { - int shaderId = ARBShaderObjects.glCreateShaderObjectARB(shaderType); + int shaderId = glCreateShaderObjectARB(shaderType); if (shaderId == NULL) { throw new ShaderLoadingException(); } - ARBShaderObjects.glShaderSourceARB(shaderId, Util.readAssetResource("/rendering/shader/" + shaderPath)); - ARBShaderObjects.glCompileShaderARB(shaderId); + glShaderSourceARB(shaderId, Util.readAssetResource("rendering/shader/" + shaderPath)); + glCompileShaderARB(shaderId); - if (ARBShaderObjects.glGetObjectParameteriARB(shaderId, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) { + if (glGetObjectParameteriARB(shaderId, ARBShaderObjects.GL_OBJECT_COMPILE_STATUS_ARB) == GL11.GL_FALSE) { throw new ShaderLoadingException(OpenGLUtil.getLogInfo(shaderId)); }