From ae00db73bf416e5b177660e3ec972fbf969a7ddd Mon Sep 17 00:00:00 2001 From: Tobias Nett Date: Sun, 14 Jul 2024 14:45:22 +0200 Subject: [PATCH] fix(rendering): avoid glBindFramebufferEXT to fix MacOS crash (#5260) - replace GL_FRAMEBUFFER_EXTwith GL_FRAMEBUFFER - replace glBindFramebufferEXT with glBindFramebuffer Co-authored-by: a-ivanov (@a-ivanov) --- .../engine/rendering/dag/stateChanges/BindFbo.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/engine/src/main/java/org/terasology/engine/rendering/dag/stateChanges/BindFbo.java b/engine/src/main/java/org/terasology/engine/rendering/dag/stateChanges/BindFbo.java index 24470133af1..bd9536acb77 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/dag/stateChanges/BindFbo.java +++ b/engine/src/main/java/org/terasology/engine/rendering/dag/stateChanges/BindFbo.java @@ -7,8 +7,8 @@ import org.terasology.engine.rendering.opengl.FBO; import org.terasology.engine.rendering.dag.StateChange; -import static org.lwjgl.opengl.EXTFramebufferObject.GL_FRAMEBUFFER_EXT; -import static org.lwjgl.opengl.EXTFramebufferObject.glBindFramebufferEXT; +import static org.lwjgl.opengl.GL30.GL_FRAMEBUFFER; +import static org.lwjgl.opengl.GL30.glBindFramebuffer; /** * Binds the given FBO, setting it as the FBO to read from and write to. @@ -58,8 +58,7 @@ public String toString() { // TODO: used for logging purposes at the moment, inv @Override public void process() { - // TODO: change the target argument to GL_DRAW_FRAMEBUFFER when we switch to OpenGL 3.0 and beyond. - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboId); + glBindFramebuffer(GL_FRAMEBUFFER, fboId); } private static final class UnbindFbo implements StateChange { @@ -85,7 +84,7 @@ public String toString() { @Override public void process() { - glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); } } }