import com.badlogic.gdx.Gdx;\r
import com.badlogic.gdx.graphics.GL20;\r
import com.badlogic.gdx.graphics.Mesh;\r
-import com.badlogic.gdx.graphics.SpriteBatch;\r
+import com.badlogic.gdx.math.Matrix3;\r
import com.badlogic.gdx.math.Matrix4;\r
\r
/**\r
* the matrix\r
*/\r
public void setUniformMatrix(String name, Matrix4 matrix) {\r
+ setUniformMatrix(name, matrix, false); \r
+ }\r
+ \r
+ /**\r
+ * Sets the uniform matrix with the given name. Throws an\r
+ * IllegalArgumentException in case it is not called in between a\r
+ * {@link #begin()}/{@link #end()} block.\r
+ * \r
+ * @param name\r
+ * the name of the uniform\r
+ * @param matrix\r
+ * the matrix\r
+ * @param transpose\r
+ * whether the matrix shouls be transposed\r
+ */\r
+ public void setUniformMatrix(String name, Matrix4 matrix, boolean transpose) {\r
GL20 gl = Gdx.graphics.getGL20();\r
checkManaged();\r
int location = fetchUniformLocation(name);\r
this.matrix.put(matrix.val);\r
this.matrix.position(0);\r
- gl.glUniformMatrix4fv(location, 1, false, this.matrix);\r
+ gl.glUniformMatrix4fv(location, 1, transpose, this.matrix); \r
+ }\r
+ \r
+ /**\r
+ * Sets the uniform matrix with the given name. Throws an\r
+ * IllegalArgumentException in case it is not called in between a\r
+ * {@link #begin()}/{@link #end()} block.\r
+ * \r
+ * @param name\r
+ * the name of the uniform\r
+ * @param matrix\r
+ * the matrix\r
+ */\r
+ public void setUniformMatrix(String name, Matrix3 matrix) {\r
+ setUniformMatrix(name, matrix, false);\r
}\r
+ \r
+ /**\r
+ * Sets the uniform matrix with the given name. Throws an\r
+ * IllegalArgumentException in case it is not called in between a\r
+ * {@link #begin()}/{@link #end()} block.\r
+ * \r
+ * @param name\r
+ * the name of the uniform\r
+ * @param matrix\r
+ * the matrix\r
+ * @param transpose\r
+ * whether the uniform matrix should be transposed \r
+ */\r
+ public void setUniformMatrix(String name, Matrix3 matrix, boolean transpose) {\r
+ GL20 gl = Gdx.graphics.getGL20();\r
+ checkManaged();\r
+ int location = fetchUniformLocation(name);\r
+ this.matrix.put(matrix.getValues());\r
+ this.matrix.position(0);\r
+ gl.glUniformMatrix3fv(location, 1, transpose, this.matrix); \r
+ } \r
\r
/**\r
* Sets the vertex attribute with the given name. Throws an\r