Class GLPixelStorageModes


  • public class GLPixelStorageModes
    extends Object
    Utility to safely set and restore the PACK and UNPACK pixel storage mode, regardless of the GLProfile.

    PACK for GPU to CPU transfers, e.g. ReadPixels, etc.

    UNPACK for CPU o GPU transfers, e.g. TexImage2D, etc

    • Constructor Detail

      • GLPixelStorageModes

        public GLPixelStorageModes()
        Create instance w/o saveAll(GL)
      • GLPixelStorageModes

        public GLPixelStorageModes​(GL gl)
        Create instance w/ saveAll(GL)
    • Method Detail

      • setPackAlignment

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

        Saves the PACK pixel storage modes and resets them if not saved yet, see savePack(GL).

      • saveAll

        public final void saveAll​(GL gl)
        Saves PACK and UNPACK pixel storage modes and resets them, i.e. issues savePack(GL) and saveUnpack(GL).

        Operation is skipped, if the modes were already saved.

        Restore via restore(GL)

      • resetAll

        public final void resetAll​(GL gl)
        Resets PACK and UNPACK pixel storage modes to their default value, i.e. issues resetPack(GL) and resetUnpack(GL).
      • resetPack

        public final void resetPack​(GL gl)
        Resets PACK pixel storage modes to their default value.
      • savePack

        public final void savePack​(GL gl)
        Saves PACK pixel storage modes and resets them.

        Operation is skipped, if the modes were already saved.

        Restore via restore(GL)

      • resetUnpack

        public final void resetUnpack​(GL gl)
        Resets UNPACK pixel storage modes to their default value.
      • saveUnpack

        public final void saveUnpack​(GL gl)
        Saves UNPACK pixel storage modes and resets them.

        Operation is skipped, if the modes were already saved.

        Restore via restore(GL)