mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-18 03:25:17 +00:00
Use GLSM instead of relying on the redirector
This commit is contained in:
1 parent
70cfa2ae90
commit
5f61e387fb
84 files changed
+628
-1140
No files matched your search
@@ -22,12 +22,12 @@ public class FullScreenQuadRenderer {
|
||||
public static final FullScreenQuadRenderer INSTANCE = new FullScreenQuadRenderer();
|
||||
|
||||
private FullScreenQuadRenderer() {
|
||||
this.vao = org.lwjgl.opengl.GL30.glGenVertexArrays();
|
||||
this.vao = GLStateManager.glGenVertexArrays();
|
||||
GLStateManager.glBindVertexArray(vao);
|
||||
this.quadBuffer = createQuad();
|
||||
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, quadBuffer);
|
||||
GLStateManager.glBindBuffer(GL15.GL_ARRAY_BUFFER, quadBuffer);
|
||||
DefaultVertexFormat.POSITION_TEXTURE.setupBufferState(0L);
|
||||
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
|
||||
GLStateManager.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
|
||||
GLStateManager.glBindVertexArray(0);
|
||||
}
|
||||
|
||||
@@ -79,14 +79,14 @@ public class FullScreenQuadRenderer {
|
||||
private static final Int2ObjectOpenHashMap<int[]> compositeLocCache = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
public static void uploadCompositeMatrices() {
|
||||
final int program = GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM);
|
||||
final int program = GLStateManager.glGetInteger(GL20.GL_CURRENT_PROGRAM);
|
||||
if (program == 0) return;
|
||||
|
||||
int[] locs = compositeLocCache.get(program);
|
||||
if (locs == null) {
|
||||
locs = new int[] {
|
||||
GL20.glGetUniformLocation(program, "iris_ModelViewMatrix"),
|
||||
GL20.glGetUniformLocation(program, "iris_ProjectionMatrix")
|
||||
GLStateManager.glGetUniformLocation(program, "iris_ModelViewMatrix"),
|
||||
GLStateManager.glGetUniformLocation(program, "iris_ProjectionMatrix")
|
||||
};
|
||||
compositeLocCache.put(program, locs);
|
||||
}
|
||||
@@ -94,13 +94,13 @@ public class FullScreenQuadRenderer {
|
||||
if (locs[0] != -1) {
|
||||
GLStateManager.getModelViewMatrix().get(matBuf);
|
||||
matBuf.rewind();
|
||||
GL20.glUniformMatrix4(locs[0], false, matBuf);
|
||||
GLStateManager.glUniformMatrix4(locs[0], false, matBuf);
|
||||
}
|
||||
|
||||
if (locs[1] != -1) {
|
||||
GLStateManager.getProjectionMatrix().get(matBuf);
|
||||
matBuf.rewind();
|
||||
GL20.glUniformMatrix4(locs[1], false, matBuf);
|
||||
GLStateManager.glUniformMatrix4(locs[1], false, matBuf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user