29package com.jogamp.opengl.util;
31import com.jogamp.opengl.GL;
32import com.jogamp.opengl.GL2;
33import com.jogamp.opengl.GL2ES2;
34import com.jogamp.opengl.GL2ES3;
35import com.jogamp.opengl.GL2GL3;
36import com.jogamp.opengl.GLContext;
37import com.jogamp.opengl.GLException;
50 private final int[] cachePack =
new int[8];
51 private final int[] cacheUnpack =
new int[8];
52 private boolean savedPack =
false;
53 private boolean savedUnpack =
false;
89 public final void setAlignment(
final GL gl,
final int packAlignment,
final int unpackAlignment) {
122 public final void setRowLength(
final GL2ES3 gl,
final int packRowLength,
final int unpackRowLength) {
157 if(!savedPack && !savedUnpack) {
158 throw new GLException(
"Neither PACK nor UNPACK pixel storage modes were saved");
224 private final void restorePack(
final GL gl) {
300 private final void restoreUnpack(
final GL gl) {
Abstraction for an OpenGL rendering context.
static final VersionNumber Version1_2
Version 1.2, i.e.
final VersionNumber getGLVersionNumber()
Returns this context OpenGL version.
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Utility to safely set and restore the PACK and UNPACK pixel storage mode, regardless of the GLProfile...
final void setUnpackAlignment(final GL gl, final int unpackAlignment)
Sets the GL#GL_UNPACK_ALIGNMENT.
final void setPackRowLength(final GL2ES3 gl, final int packRowLength)
Sets the GL2ES3#GL_PACK_ROW_LENGTH.
final void setUnpackRowLength(final GL2ES3 gl, final int unpackRowLength)
Sets the GL2ES2#GL_UNPACK_ROW_LENGTH.
final void saveAll(final GL gl)
Saves PACK and UNPACK pixel storage modes and resets them, i.e.
final void resetAll(final GL gl)
Resets PACK and UNPACK pixel storage modes to their default value, i.e.
final void restore(final GL gl)
Restores PACK and UNPACK pixel storage mode previously saved w/ saveAll(GL) or savePack(GL) and saveU...
final void savePack(final GL gl)
Saves PACK pixel storage modes and resets them.
GLPixelStorageModes(final GL gl)
Create instance w/ saveAll(GL).
final void setPackAlignment(final GL gl, final int packAlignment)
Sets the GL#GL_PACK_ALIGNMENT.
final void setRowLength(final GL2ES3 gl, final int packRowLength, final int unpackRowLength)
Sets the GL2ES3#GL_PACK_ROW_LENGTH and GL2ES2#GL_UNPACK_ROW_LENGTH if GL#isGL2ES3().
GLPixelStorageModes()
Create instance w/o saveAll(GL).
final void resetUnpack(final GL gl)
Resets UNPACK pixel storage modes to their default value.
final void setAlignment(final GL gl, final int packAlignment, final int unpackAlignment)
Sets the GL#GL_PACK_ALIGNMENT and GL#GL_UNPACK_ALIGNMENT.
final void resetPack(final GL gl)
Resets PACK pixel storage modes to their default value.
final void saveUnpack(final GL gl)
Saves UNPACK pixel storage modes and resets them.
static final int GL_UNPACK_ROW_LENGTH
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_EXT_unpack_subimage Alias for: GL_UNPACK_ROW_LE...
static final int GL_UNPACK_SKIP_PIXELS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_EXT_unpack_subimage Alias for: GL_UNPACK_SKIP_P...
static final int GL_UNPACK_SKIP_ROWS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_EXT_unpack_subimage Alias for: GL_UNPACK_SKIP_R...
static final int GL_PACK_SKIP_PIXELS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_SKIP_PIXELS" with expression '0x0D0...
static final int GL_UNPACK_SKIP_IMAGES
GL_ES_VERSION_3_0, GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_UNPACK_SKIP_IMAGES_EXT Define "GL_...
static final int GL_PACK_SKIP_ROWS
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_SKIP_ROWS" with expression '0x0D03'...
static final int GL_UNPACK_IMAGE_HEIGHT
GL_ES_VERSION_3_0, GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_UNPACK_IMAGE_HEIGHT_EXT Define "GL...
static final int GL_PACK_ROW_LENGTH
GL_ES_VERSION_3_0, GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_ROW_LENGTH" with expression '0x0D02...
static final int GL_PACK_IMAGE_HEIGHT
GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_PACK_IMAGE_HEIGHT_EXT Define "GL_PACK_IMAGE_HEIGHT" w...
static final int GL_UNPACK_LSB_FIRST
GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_UNPACK_LSB_FIRST" with expression '0x0CF1',...
static final int GL_UNPACK_SWAP_BYTES
GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_UNPACK_SWAP_BYTES" with expression '0x0CF0',...
static final int GL_PACK_SWAP_BYTES
GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_SWAP_BYTES" with expression '0x0D00',...
static final int GL_PACK_SKIP_IMAGES
GL_VERSION_1_2, GL_EXT_texture3D Alias for: GL_PACK_SKIP_IMAGES_EXT Define "GL_PACK_SKIP_IMAGES" wit...
static final int GL_PACK_LSB_FIRST
GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_PACK_LSB_FIRST" with expression '0x0D01',...
static final int GL_CLIENT_PIXEL_STORE_BIT
GL_VERSION_1_1 Define "GL_CLIENT_PIXEL_STORE_BIT" with expression '0x00000001', CType: int
void glPopClientAttrib()
Entry point to C language function: void {@native glPopClientAttrib}() Part of GL_VERSION_1_1
void glPushClientAttrib(int mask)
Entry point to C language function: void {@native glPushClientAttrib}(GLbitfield mask) Part of GL_...
boolean isGL2GL3()
Indicates whether this GL object conforms to a GL2GL3 compatible profile.
boolean isGL2ES3()
Indicates whether this GL object conforms to a either a GL2GL3 or GL3ES3 compatible profile.
boolean isGL2()
Indicates whether this GL object conforms to the OpenGL ≤ 3.0 profile.
GLContext getContext()
Returns the GLContext associated which this GL object.
GL2 getGL2()
Casts this object to the GL2 interface.
void glPixelStorei(int pname, int param)
Entry point to C language function: void {@native glPixelStorei}(GLenum pname, GLint param) Part o...
void glGetIntegerv(int pname, IntBuffer data)
Entry point to C language function: void {@native glGetIntegerv}(GLenum pname, GLint * data) Part ...
static final int GL_UNPACK_ALIGNMENT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_UNPACK_ALIGNMENT" wit...
static final int GL_FALSE
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_FALSE" with expressio...
static final int GL_PACK_ALIGNMENT
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_PACK_ALIGNMENT" with ...