diff options
Diffstat (limited to 'src/jogl/classes/com')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java | 44 |
1 files changed, 39 insertions, 5 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java index fab80b109..f512a3aae 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java +++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java @@ -31,6 +31,7 @@ package com.jogamp.opengl.util; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GL2ES2; +import javax.media.opengl.GL2ES3; import javax.media.opengl.GL2GL3; import javax.media.opengl.GLException; @@ -50,29 +51,29 @@ public class GLPixelStorageModes { public GLPixelStorageModes(GL gl) { save(gl); } /** - * Sets the {@link GL2ES2.GL_PACK_ALIGNMENT}. + * Sets the {@link GL#GL_PACK_ALIGNMENT}. * <p> * Saves the pixel storage modes if not saved yet. * </p> */ public final void setPackAlignment(GL gl, int packAlignment) { save(gl); - gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT, packAlignment); + gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment); } /** - * Sets the {@link GL2ES2.GL_UNPACK_ALIGNMENT}. + * Sets the {@link GL#GL_UNPACK_ALIGNMENT}. * <p> * Saves the pixel storage modes if not saved yet. * </p> */ public final void setUnpackAlignment(GL gl, int unpackAlignment) { save(gl); - gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT, unpackAlignment); + gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, unpackAlignment); } /** - * Sets the {@link GL2ES2.GL_PACK_ALIGNMENT} and {@link GL2ES2.GL_UNPACK_ALIGNMENT}. + * Sets the {@link GL#GL_PACK_ALIGNMENT} and {@link GL#GL_UNPACK_ALIGNMENT}. * <p> * Saves the pixel storage modes if not saved yet. * </p> @@ -83,6 +84,39 @@ public class GLPixelStorageModes { } /** + * Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH}. + * <p> + * Saves the pixel storage modes if not saved yet. + * </p> + */ + public final void setPackRowLength(GL2ES3 gl, int packRowLength) { + save(gl); + gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength); + } + + /** + * Sets the {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. + * <p> + * Saves the pixel storage modes if not saved yet. + * </p> + */ + public final void setUnpackRowLength(GL2ES2 gl, int unpackRowLength) { + save(gl); + gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, unpackRowLength); + } + + /** + * Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH} and {@link GL2ES2#GL_UNPACK_ROW_LENGTH}. + * <p> + * Saves the pixel storage modes if not saved yet. + * </p> + */ + public final void setRowLength(GL2ES3 gl, int packRowLength, int unpackRowLength) { + setPackRowLength(gl, packRowLength); + setUnpackRowLength(gl, unpackRowLength); + } + + /** * Save the pixel storage mode, if not saved yet. * <p> * Restore via {@link #restore(GL)} |