Skip to content

Commit

Permalink
fix(rendering): avoid glBindFramebufferEXT to fix MacOS crash (#5260)
Browse files Browse the repository at this point in the history
- replace GL_FRAMEBUFFER_EXTwith GL_FRAMEBUFFER
- replace glBindFramebufferEXT with glBindFramebuffer

Co-authored-by: a-ivanov (@a-ivanov)
  • Loading branch information
skaldarnar authored Jul 14, 2024
1 parent 855b2be commit ae00db7
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand All @@ -85,7 +84,7 @@ public String toString() {

@Override
public void process() {
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
}
}

0 comments on commit ae00db7

Please sign in to comment.