feat(graphics): add setUniform methods
@@ -41,6 +41,14 @@ public class Uniforms {
}
}
+ public static void setUniform(int location, Matrix3x2fc value) {
+ try (MemoryStack stack = MemoryStack.stackPush()) {
+ FloatBuffer buffer = stack.mallocFloat(3 * 2);
+ value.get(buffer);
+ glUniformMatrix3fv(location, false, buffer);
+ }
+ }
+
public static void setUniform(int location, Matrix4fc value) {
try (MemoryStack stack = MemoryStack.stackPush()) {
FloatBuffer buffer = stack.mallocFloat(4 * 4);
@@ -49,6 +57,14 @@ public class Uniforms {
}
}
+ public static void setUniform(int location, Matrix4x3fc value) {
+ try (MemoryStack stack = MemoryStack.stackPush()) {
+ FloatBuffer buffer = stack.mallocFloat(4 * 3);
+ value.get(buffer);
+ glUniformMatrix4fv(location, false, buffer);
+ }
+ }
+
public static void setUniform(int location, Matrix4fc[] values) {
try (MemoryStack stack = MemoryStack.stackPush()) {
int length = values != null ? values.length : 0;
