com.jogamp.opengl.util
Class GLPixelStorageModes

java.lang.Object
  extended by com.jogamp.opengl.util.GLPixelStorageModes

public class GLPixelStorageModes
extends Object

Utility to safely set and restore the pack and unpack pixel storage mode, regardless of the GLProfile.


Constructor Summary
GLPixelStorageModes()
          Create instance w/o save(GL)
GLPixelStorageModes(GL gl)
          Create instance w/ save(GL)
 
Method Summary
 void restore(GL gl)
          Restores the pixel storage mode.
 void save(GL gl)
          Save the pixel storage mode, if not saved yet.
 void setAlignment(GL gl, int packAlignment, int unpackAlignment)
          Sets the GL2ES2.GL_PACK_ALIGNMENT and GL2ES2.GL_UNPACK_ALIGNMENT.
 void setPackAlignment(GL gl, int packAlignment)
          Sets the GL2ES2.GL_PACK_ALIGNMENT.
 void setUnpackAlignment(GL gl, int unpackAlignment)
          Sets the GL2ES2.GL_UNPACK_ALIGNMENT.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLPixelStorageModes

public GLPixelStorageModes()
Create instance w/o save(GL)


GLPixelStorageModes

public GLPixelStorageModes(GL gl)
Create instance w/ save(GL)

Method Detail

setPackAlignment

public final void setPackAlignment(GL gl,
                                   int packAlignment)
Sets the GL2ES2.GL_PACK_ALIGNMENT.

Saves the pixel storage modes if not saved yet.


setUnpackAlignment

public final void setUnpackAlignment(GL gl,
                                     int unpackAlignment)
Sets the GL2ES2.GL_UNPACK_ALIGNMENT.

Saves the pixel storage modes if not saved yet.


setAlignment

public final void setAlignment(GL gl,
                               int packAlignment,
                               int unpackAlignment)
Sets the GL2ES2.GL_PACK_ALIGNMENT and GL2ES2.GL_UNPACK_ALIGNMENT.

Saves the pixel storage modes if not saved yet.


save

public final void save(GL gl)
Save the pixel storage mode, if not saved yet.

Restore via restore(GL)


restore

public final void restore(GL gl)
                   throws GLException
Restores the pixel storage mode.

Throws:
GLException - if not saved via one of the set methods.


Copyright 2010 JogAmp Community.