Because of course someone uses DoubleBuffer

This commit is contained in:
Jason Mitchell authored and Jason Mitchell committed 2023-12-26 08:45:26 -08:00
1 parent d4e22b6c0c
commit a3d689e806
1 file changed
+11
@@ -26,6 +26,7 @@ import net.coderbot.iris.texture.TextureInfoCache;
import net.coderbot.iris.texture.TextureTracker;
import net.coderbot.iris.texture.pbr.PBRTextureManager;
import net.minecraft.client.renderer.OpenGlHelper;
import org.joml.Matrix4d;
import org.joml.Matrix4f;
import org.joml.Vector3d;
import org.lwjgl.BufferUtils;
@@ -37,6 +38,7 @@ import org.lwjgl.opengl.GL12;
import org.lwjgl.opengl.GL13;
import java.nio.ByteBuffer;
import java.nio.DoubleBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import java.util.stream.IntStream;
@@ -739,6 +741,15 @@ public class GLStateManager {
matrixState.multiply(matrix);
}
public static final Matrix4d conersionMatrix4d = new Matrix4d();
public static final Matrix4f conersionMatrix4f = new Matrix4f();
public static void glMultMatrix(DoubleBuffer matrix) {
GL11.glMultMatrix(matrix);
conersionMatrix4d.set(matrix);
conersionMatrix4f.set(conersionMatrix4d);
matrixState.multiply(conersionMatrix4f);
}
public static void glRotatef(float angle, float x, float y, float z) {
GL11.glRotatef(angle, x, y, z);
matrixState.rotate((float)Math.toRadians(angle), x, y, z);