28package com.jogamp.opengl.util.texture;
30import com.jogamp.opengl.GL;
31import com.jogamp.opengl.GL2ES2;
32import com.jogamp.opengl.GL2ES3;
33import com.jogamp.opengl.GL2GL3;
34import com.jogamp.opengl.GLException;
57 final int texBindQName;
58 switch(textureTarget) {
69 default: texBindQName = 0;
74 private final int target;
85 private final int[] state =
new int[] { 0, 0, 0, 0, 0, 0 };
87 private static final String toHexString(
final int i) {
return "0x"+Integer.toHexString(i); }
89 private static final int activeTexture(
final GL gl) {
90 final int[] vi = { 0 };
103 this(gl, activeTexture(gl), textureTarget);
115 target = textureTarget;
116 state[0] = textureUnit;
118 if( 0 == texBindQName ) {
119 throw new GLException(
"Unsupported textureTarget "+toHexString(textureTarget));
145 public final int getUnit() {
return state[0]; }
163 return "TextureState[unit "+(state[0] -
GL.
GL_TEXTURE0)+
", target "+toHexString(target)+
164 ": obj "+toHexString(state[1])+
165 ", filter[mag "+toHexString(state[2])+
", min "+toHexString(state[3])+
"], "+
166 ": wrap[s "+toHexString(state[4])+
", t "+toHexString(state[5])+
"]]";
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Preserves a [ texture-unit, texture-target ] state.
final int getObject()
Returns the state's texture-object.
final void restore(final GL gl)
Restores the texture-unit's texture-target state.
TextureState(final GL gl, final int textureTarget)
Creates a texture state for the retrieved active texture-unit and the given texture-target.
final int getMinFilter()
Returns the state's min-filter param.
final int getWrapT()
Returns the state's wrap-t param.
final int getWrapS()
Returns the state's wrap-s param.
final int getTarget()
Returns the texture-target of this state, key value.
static final int getTextureTargetQueryName(final int textureTarget)
Returns the pname to query the textureTarget currently bound to the active texture-unit.
final int getUnit()
Returns the texture-unit of this state, key value.
final int getMagFilter()
Returns the state's mag-filter param.
TextureState(final GL gl, final int textureUnit, final int textureTarget)
Creates a texture state for the given active texture-unit and the given texture-target.
static final int GL_TEXTURE_BINDING_3D
GL_ES_VERSION_3_0, GL_VERSION_1_2, GL_OES_texture_3D Alias for: GL_TEXTURE_BINDING_3D_OES Define "GL...
static final int GL_TEXTURE_3D
GL_ES_VERSION_3_0, GL_EXT_sparse_texture, GL_VERSION_1_2, GL_OES_texture_3D, GL_EXT_texture3D Alias f...
static final int GL_TEXTURE_BINDING_2D_MULTISAMPLE
GL_ES_VERSION_3_1, GL_ARB_texture_multisample, GL_VERSION_3_2 Define "GL_TEXTURE_BINDING_2D_MULTISAMP...
static final int GL_TEXTURE_2D_MULTISAMPLE
GL_NV_internalformat_sample_query, GL_ES_VERSION_3_1, GL_ARB_texture_multisample, GL_VERSION_3_2 Defi...
static final int GL_TEXTURE_2D_MULTISAMPLE_ARRAY
GL_ES_VERSION_3_2, GL_NV_internalformat_sample_query, GL_ARB_texture_multisample, GL_VERSION_3_2,...
static final int GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY
GL_ES_VERSION_3_2, GL_ARB_texture_multisample, GL_VERSION_3_2, GL_OES_texture_storage_multisample_2d_...
static final int GL_TEXTURE_BUFFER
GL_ES_VERSION_3_2, GL_VERSION_3_1, GL_ARB_texture_buffer_object, GL_EXT_texture_buffer,...
static final int GL_TEXTURE_BINDING_BUFFER
GL_ES_VERSION_3_2, GL_VERSION_3_1, GL_ARB_texture_buffer_object, GL_EXT_texture_buffer,...
static final int GL_TEXTURE_BINDING_2D_ARRAY
GL_ES_VERSION_3_0, GL_VERSION_3_0, GL_EXT_texture_array Alias for: GL_TEXTURE_BINDING_2D_ARRAY_EXT D...
static final int GL_TEXTURE_2D_ARRAY
GL_ES_VERSION_3_0, GL_EXT_sparse_texture, GL_VERSION_3_0, GL_EXT_texture_array Alias for: GL_TEXTURE_...
static final int GL_TEXTURE_1D
GL_VERSION_1_1, GL_VERSION_1_0 Define "GL_TEXTURE_1D" with expression '0x0DE0', CType: int
static final int GL_TEXTURE_1D_ARRAY
GL_VERSION_3_0, GL_EXT_texture_array Alias for: GL_TEXTURE_1D_ARRAY_EXT Define "GL_TEXTURE_1D_ARRAY"...
static final int GL_TEXTURE_BINDING_1D
GL_VERSION_1_1 Define "GL_TEXTURE_BINDING_1D" with expression '0x8068', CType: int
static final int GL_TEXTURE_BINDING_1D_ARRAY
GL_VERSION_3_0, GL_EXT_texture_array Alias for: GL_TEXTURE_BINDING_1D_ARRAY_EXT Define "GL_TEXTURE_B...
static final int GL_TEXTURE_BINDING_RECTANGLE
GL_VERSION_3_1, GL_ARB_texture_rectangle, GL_NV_texture_rectangle Alias for: GL_TEXTURE_BINDING_RECTA...
static final int GL_TEXTURE_RECTANGLE
GL_VERSION_3_1, GL_ARB_texture_rectangle, GL_NV_texture_rectangle Alias for: GL_TEXTURE_RECTANGLE_ARB...
static final int GL_TEXTURE_MAG_FILTER
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TEXTURE_MAG_FILTER" w...
void glGetIntegerv(int pname, IntBuffer data)
Entry point to C language function: void {@native glGetIntegerv}(GLenum pname, GLint * data) Part ...
static final int GL_TEXTURE_2D
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TEXTURE_2D" with expr...
static final int GL_TEXTURE_WRAP_S
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TEXTURE_WRAP_S" with ...
void glBindTexture(int target, int texture)
Entry point to C language function: void {@native glBindTexture}(GLenum target, GLuint texture) Pa...
static final int GL_TEXTURE_BINDING_2D
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_ES_1_0 Define "GL_TEXTURE_BINDING_2D" with expression '...
static final int GL_TEXTURE_MIN_FILTER
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TEXTURE_MIN_FILTER" w...
void glGetTexParameteriv(int target, int pname, IntBuffer params)
Entry point to C language function: void {@native glGetTexParameteriv}(GLenum target,...
static final int GL_TEXTURE_BINDING_CUBE_MAP
GL_ES_VERSION_2_0, GL_VERSION_1_3, GL_ARB_texture_cube_map, GL_EXT_texture_cube_map,...
static final int GL_TEXTURE_WRAP_T
GL_ES_VERSION_2_0, GL_VERSION_1_1, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_TEXTURE_WRAP_T" with ...
void glActiveTexture(int texture)
Entry point to C language function: void {@native glActiveTexture}(GLenum texture) Part of GL_ES_V...
void glTexParameteri(int target, int pname, int param)
Entry point to C language function: void {@native glTexParameteri}(GLenum target,...
static final int GL_TEXTURE0
GL_ES_VERSION_2_0, GL_VERSION_1_3, GL_VERSION_ES_1_0, GL_ARB_multitexture Alias for: GL_TEXTURE0_ARB ...
static final int GL_TEXTURE_CUBE_MAP
GL_ES_VERSION_2_0, GL_VERSION_1_3, GL_OES_texture_cube_map, GL_ARB_texture_cube_map,...