Skip to content

Commit

Permalink
add syncProgram call to glDrawElements + glBegin
Browse files Browse the repository at this point in the history
  • Loading branch information
kurrycat2004 authored and mitchej123 committed Oct 26, 2024
1 parent c0d636d commit f233ba6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/java/com/gtnewhorizons/angelica/glsm/GLStateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,20 @@ public static void glDrawBuffer(int mode) {
GL11.glDrawBuffer(mode);
}

public static void glDrawElements(int mode, IntBuffer indices) {
if(AngelicaConfig.enableIris) {
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
}
GL11.glDrawElements(mode, indices);
}

public static void glBegin(int mode) {
if (AngelicaConfig.enableIris) {
Iris.getPipelineManager().getPipeline().ifPresent(WorldRenderingPipeline::syncProgram);
}
GL11.glBegin(mode);
}

public static void glLogicOp(int opcode) {
GL11.glLogicOp(opcode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public class RedirectorTransformer implements IClassTransformer {
glCapRedirects.put(org.lwjgl.opengl.GL11.GL_SCISSOR_TEST, "ScissorTest");
methodRedirects.put(GL11, RedirectMap.newMap()
.add("glAlphaFunc")
.add("glBegin")
.add("glBindTexture")
.add("glBlendFunc")
.add("glCallList")
Expand All @@ -119,6 +120,7 @@ public class RedirectorTransformer implements IClassTransformer {
.add("glDepthRange")
.add("glDrawArrays")
.add("glDrawBuffer")
.add("glDrawElements")
.add("glEdgeFlag")
.add("glEndList")
.add("glFog")
Expand Down

0 comments on commit f233ba6

Please sign in to comment.