|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GL20
The GL20
interface contains Java™ programming
language bindings for OpenGL® ES 2.0 functionality. The bindings
are similar to the bindings described for OpenGL ES 1.1 in JSR 239.
See the GL
interface
documentation to learn how to get an object that implements this interface.
The glGetVertexAttribPointerv(int index, int pname, void** pointer)
OpenGL ES 2.0 method is not implemented.
Field Summary | ||
---|---|---|
static int |
GL_ACTIVE_ATTRIBUTES
OpenGL ES 2.0 constant. |
|
static int |
GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
OpenGL ES 2.0 constant. |
|
static int |
GL_ACTIVE_TEXTURE
OpenGL ES 2.0 constant. |
|
static int |
GL_ACTIVE_UNIFORMS
OpenGL ES 2.0 constant. |
|
static int |
GL_ACTIVE_UNIFORM_MAX_LENGTH
OpenGL ES 2.0 constant. |
|
static int |
GL_ALIASED_LINE_WIDTH_RANGE
OpenGL ES 2.0 constant. |
|
static int |
GL_ALIASED_POINT_SIZE_RANGE
OpenGL ES 2.0 constant. |
|
static int |
GL_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_ALPHA_BITS
OpenGL ES 2.0 constant. |
|
static int |
GL_ALWAYS
OpenGL ES 2.0 constant. |
|
static int |
GL_ARRAY_BUFFER
OpenGL ES 2.0 constant. |
|
static int |
GL_ARRAY_BUFFER_BINDING
OpenGL ES 2.0 constant. |
|
static int |
GL_ATTACHED_SHADERS
OpenGL ES 2.0 constant. |
|
static int |
GL_BACK
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_COLOR
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_DST_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_DST_RGB
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_EQUATION
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_EQUATION_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_EQUATION_RGB
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_SRC_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_BLEND_SRC_RGB
OpenGL ES 2.0 constant. |
|
static int |
GL_BLUE_BITS
OpenGL ES 2.0 constant. |
|
static int |
GL_BOOL
OpenGL ES 2.0 constant. |
|
static int |
GL_BOOL_VEC2
OpenGL ES 2.0 constant. |
|
static int |
GL_BOOL_VEC3
OpenGL ES 2.0 constant. |
|
static int |
GL_BOOL_VEC4
OpenGL ES 2.0 constant. |
|
static int |
GL_BUFFER_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_BUFFER_USAGE
OpenGL ES 2.0 constant. |
|
static int |
GL_BYTE
OpenGL ES 2.0 constant. |
|
static int |
GL_CCW
OpenGL ES 2.0 constant. |
|
static int |
GL_CLAMP_TO_EDGE
OpenGL ES 2.0 constant. |
|
static int |
GL_COLOR_ATTACHMENT0
OpenGL ES 2.0 constant. |
|
static int |
GL_COLOR_BUFFER_BIT
OpenGL ES 2.0 constant. |
|
static int |
GL_COLOR_CLEAR_VALUE
OpenGL ES 2.0 constant. |
|
static int |
GL_COLOR_WRITEMASK
OpenGL ES 2.0 constant. |
|
static int |
GL_COMPILE_STATUS
OpenGL ES 2.0 constant. |
|
static int |
GL_COMPRESSED_TEXTURE_FORMATS
OpenGL ES 2.0 constant. |
|
static int |
GL_CONSTANT_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_CONSTANT_COLOR
OpenGL ES 2.0 constant. |
|
static int |
GL_CULL_FACE
OpenGL ES 2.0 constant. |
|
static int |
GL_CULL_FACE_MODE
OpenGL ES 2.0 constant. |
|
static int |
GL_CURRENT_PROGRAM
OpenGL ES 2.0 constant. |
|
static int |
GL_CURRENT_VERTEX_ATTRIB
OpenGL ES 2.0 constant. |
|
static int |
GL_CW
OpenGL ES 2.0 constant. |
|
static int |
GL_DECR
OpenGL ES 2.0 constant. |
|
static int |
GL_DECR_WRAP
OpenGL ES 2.0 constant. |
|
static int |
GL_DELETE_STATUS
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_ATTACHMENT
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_BITS
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_BUFFER_BIT
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_CLEAR_VALUE
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_COMPONENT
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_COMPONENT16
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_FUNC
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_RANGE
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_TEST
OpenGL ES 2.0 constant. |
|
static int |
GL_DEPTH_WRITEMASK
OpenGL ES 2.0 constant. |
|
static int |
GL_DITHER
OpenGL ES 2.0 constant. |
|
static int |
GL_DONT_CARE
OpenGL ES 2.0 constant. |
|
static int |
GL_DST_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_DST_COLOR
OpenGL ES 2.0 constant. |
|
static int |
GL_DYNAMIC_DRAW
OpenGL ES 2.0 constant. |
|
static int |
GL_ELEMENT_ARRAY_BUFFER
OpenGL ES 2.0 constant. |
|
static int |
GL_ELEMENT_ARRAY_BUFFER_BINDING
OpenGL ES 2.0 constant. |
|
static int |
GL_EQUAL
OpenGL ES 2.0 constant. |
|
static int |
GL_ES_VERSION_2_0
OpenGL ES 2.0 constant. |
|
static int |
GL_EXTENSIONS
OpenGL ES 2.0 constant. |
|
static int |
GL_FALSE
OpenGL ES 2.0 constant. |
|
static int |
GL_FASTEST
OpenGL ES 2.0 constant. |
|
static int |
GL_FIXED
OpenGL ES 2.0 constant. |
|
static int |
GL_FLOAT
OpenGL ES 2.0 constant. |
|
static int |
GL_FLOAT_MAT2
OpenGL ES 2.0 constant. |
|
static int |
GL_FLOAT_MAT3
OpenGL ES 2.0 constant. |
|
static int |
GL_FLOAT_MAT4
OpenGL ES 2.0 constant. |
|
static int |
GL_FLOAT_VEC2
OpenGL ES 2.0 constant. |
|
static int |
GL_FLOAT_VEC3
OpenGL ES 2.0 constant. |
|
static int |
GL_FLOAT_VEC4
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAGMENT_SHADER
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_BINDING
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_COMPLETE
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
OpenGL ES 2.0 constant. |
|
static int |
GL_FRAMEBUFFER_UNSUPPORTED
OpenGL ES 2.0 constant. |
|
static int |
GL_FRONT
OpenGL ES 2.0 constant. |
|
static int |
GL_FRONT_AND_BACK
OpenGL ES 2.0 constant. |
|
static int |
GL_FRONT_FACE
OpenGL ES 2.0 constant. |
|
static int |
GL_FUNC_ADD
OpenGL ES 2.0 constant. |
|
static int |
GL_FUNC_REVERSE_SUBTRACT
OpenGL ES 2.0 constant. |
|
static int |
GL_FUNC_SUBTRACT
OpenGL ES 2.0 constant. |
|
static int |
GL_GENERATE_MIPMAP_HINT
OpenGL ES 2.0 constant. |
|
static int |
GL_GEQUAL
OpenGL ES 2.0 constant. |
|
static int |
GL_GREATER
OpenGL ES 2.0 constant. |
|
static int |
GL_GREEN_BITS
OpenGL ES 2.0 constant. |
|
static int |
GL_HIGH_FLOAT
OpenGL ES 2.0 constant. |
|
static int |
GL_HIGH_INT
OpenGL ES 2.0 constant. |
|
static int |
GL_IMPLEMENTATION_COLOR_READ_FORMAT
OpenGL ES 2.0 constant. |
|
static int |
GL_IMPLEMENTATION_COLOR_READ_TYPE
OpenGL ES 2.0 constant. |
|
static int |
GL_INCR
OpenGL ES 2.0 constant. |
|
static int |
GL_INCR_WRAP
OpenGL ES 2.0 constant. |
|
static int |
GL_INFO_LOG_LENGTH
OpenGL ES 2.0 constant. |
|
static int |
GL_INT
OpenGL ES 2.0 constant. |
|
static int |
GL_INT_VEC2
OpenGL ES 2.0 constant. |
|
static int |
GL_INT_VEC3
OpenGL ES 2.0 constant. |
|
static int |
GL_INT_VEC4
OpenGL ES 2.0 constant. |
|
static int |
GL_INVALID_ENUM
OpenGL ES 2.0 constant. |
|
static int |
GL_INVALID_FRAMEBUFFER_OPERATION
OpenGL ES 2.0 constant. |
|
static int |
GL_INVALID_OPERATION
OpenGL ES 2.0 constant. |
|
static int |
GL_INVALID_VALUE
OpenGL ES 2.0 constant. |
|
static int |
GL_INVERT
OpenGL ES 2.0 constant. |
|
static int |
GL_KEEP
OpenGL ES 2.0 constant. |
|
static int |
GL_LEQUAL
OpenGL ES 2.0 constant. |
|
static int |
GL_LESS
OpenGL ES 2.0 constant. |
|
static int |
GL_LINEAR
OpenGL ES 2.0 constant. |
|
static int |
GL_LINEAR_MIPMAP_LINEAR
OpenGL ES 2.0 constant. |
|
static int |
GL_LINEAR_MIPMAP_NEAREST
OpenGL ES 2.0 constant. |
|
static int |
GL_LINES
OpenGL ES 2.0 constant. |
|
static int |
GL_LINE_LOOP
OpenGL ES 2.0 constant. |
|
static int |
GL_LINE_STRIP
OpenGL ES 2.0 constant. |
|
static int |
GL_LINE_WIDTH
OpenGL ES 2.0 constant. |
|
static int |
GL_LINK_STATUS
OpenGL ES 2.0 constant. |
|
static int |
GL_LOW_FLOAT
OpenGL ES 2.0 constant. |
|
static int |
GL_LOW_INT
OpenGL ES 2.0 constant. |
|
static int |
GL_LUMINANCE
OpenGL ES 2.0 constant. |
|
static int |
GL_LUMINANCE_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_CUBE_MAP_TEXTURE_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_FRAGMENT_UNIFORM_VECTORS
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_RENDERBUFFER_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_TEXTURE_IMAGE_UNITS
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_TEXTURE_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_VARYING_VECTORS
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_VERTEX_ATTRIBS
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_VERTEX_UNIFORM_VECTORS
OpenGL ES 2.0 constant. |
|
static int |
GL_MAX_VIEWPORT_DIMS
OpenGL ES 2.0 constant. |
|
static int |
GL_MEDIUM_FLOAT
OpenGL ES 2.0 constant. |
|
static int |
GL_MEDIUM_INT
OpenGL ES 2.0 constant. |
|
static int |
GL_MIRRORED_REPEAT
OpenGL ES 2.0 constant. |
|
static int |
GL_NEAREST
OpenGL ES 2.0 constant. |
|
static int |
GL_NEAREST_MIPMAP_LINEAR
OpenGL ES 2.0 constant. |
|
static int |
GL_NEAREST_MIPMAP_NEAREST
OpenGL ES 2.0 constant. |
|
static int |
GL_NEVER
OpenGL ES 2.0 constant. |
|
static int |
GL_NICEST
OpenGL ES 2.0 constant. |
|
static int |
GL_NONE
OpenGL ES 2.0 constant. |
|
static int |
GL_NOTEQUAL
OpenGL ES 2.0 constant. |
|
static int |
GL_NO_ERROR
OpenGL ES 2.0 constant. |
|
static int |
GL_NUM_COMPRESSED_TEXTURE_FORMATS
OpenGL ES 2.0 constant. |
|
static int |
GL_NUM_SHADER_BINARY_FORMATS
OpenGL ES 2.0 constant. |
|
static int |
GL_ONE
OpenGL ES 2.0 constant. |
|
static int |
GL_ONE_MINUS_CONSTANT_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_ONE_MINUS_CONSTANT_COLOR
OpenGL ES 2.0 constant. |
|
static int |
GL_ONE_MINUS_DST_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_ONE_MINUS_DST_COLOR
OpenGL ES 2.0 constant. |
|
static int |
GL_ONE_MINUS_SRC_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_ONE_MINUS_SRC_COLOR
OpenGL ES 2.0 constant. |
|
static int |
GL_OUT_OF_MEMORY
OpenGL ES 2.0 constant. |
|
static int |
GL_PACK_ALIGNMENT
OpenGL ES 2.0 constant. |
|
static int |
GL_POINTS
OpenGL ES 2.0 constant. |
|
static int |
GL_POLYGON_OFFSET_FACTOR
OpenGL ES 2.0 constant. |
|
static int |
GL_POLYGON_OFFSET_FILL
OpenGL ES 2.0 constant. |
|
static int |
GL_POLYGON_OFFSET_UNITS
OpenGL ES 2.0 constant. |
|
static int |
GL_RED_BITS
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_ALPHA_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_BINDING
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_BLUE_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_DEPTH_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_GREEN_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_HEIGHT
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_INTERNAL_FORMAT
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_RED_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_STENCIL_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERBUFFER_WIDTH
OpenGL ES 2.0 constant. |
|
static int |
GL_RENDERER
OpenGL ES 2.0 constant. |
|
static int |
GL_REPEAT
OpenGL ES 2.0 constant. |
|
static int |
GL_REPLACE
OpenGL ES 2.0 constant. |
|
static int |
GL_RGB
OpenGL ES 2.0 constant. |
|
static int |
GL_RGB565
OpenGL ES 2.0 constant. |
|
static int |
GL_RGB5_A1
OpenGL ES 2.0 constant. |
|
static int |
GL_RGBA
OpenGL ES 2.0 constant. |
|
static int |
GL_RGBA4
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLER_2D
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLER_CUBE
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLES
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLE_ALPHA_TO_COVERAGE
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLE_BUFFERS
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLE_COVERAGE
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLE_COVERAGE_INVERT
OpenGL ES 2.0 constant. |
|
static int |
GL_SAMPLE_COVERAGE_VALUE
OpenGL ES 2.0 constant. |
|
static int |
GL_SCISSOR_BOX
OpenGL ES 2.0 constant. |
|
static int |
GL_SCISSOR_TEST
OpenGL ES 2.0 constant. |
|
static int |
GL_SHADER_BINARY_FORMATS
OpenGL ES 2.0 constant. |
|
static int |
GL_SHADER_COMPILER
OpenGL ES 2.0 constant. |
|
static int |
GL_SHADER_SOURCE_LENGTH
OpenGL ES 2.0 constant. |
|
static int |
GL_SHADER_TYPE
OpenGL ES 2.0 constant. |
|
static int |
GL_SHADING_LANGUAGE_VERSION
OpenGL ES 2.0 constant. |
|
static int |
GL_SHORT
OpenGL ES 2.0 constant. |
|
static int |
GL_SRC_ALPHA
OpenGL ES 2.0 constant. |
|
static int |
GL_SRC_ALPHA_SATURATE
OpenGL ES 2.0 constant. |
|
static int |
GL_SRC_COLOR
OpenGL ES 2.0 constant. |
|
static int |
GL_STATIC_DRAW
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_ATTACHMENT
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BACK_FAIL
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BACK_FUNC
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BACK_PASS_DEPTH_FAIL
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BACK_PASS_DEPTH_PASS
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BACK_REF
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BACK_VALUE_MASK
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BACK_WRITEMASK
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BITS
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_BUFFER_BIT
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_CLEAR_VALUE
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_FAIL
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_FUNC
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_INDEX
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_INDEX8
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_PASS_DEPTH_FAIL
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_PASS_DEPTH_PASS
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_REF
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_TEST
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_VALUE_MASK
OpenGL ES 2.0 constant. |
|
static int |
GL_STENCIL_WRITEMASK
OpenGL ES 2.0 constant. |
|
static int |
GL_STREAM_DRAW
OpenGL ES 2.0 constant. |
|
static int |
GL_SUBPIXEL_BITS
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE0
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE1
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE10
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE11
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE12
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE13
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE14
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE15
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE16
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE17
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE18
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE19
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE2
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE20
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE21
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE22
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE23
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE24
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE25
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE26
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE27
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE28
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE29
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE3
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE30
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE31
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE4
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE5
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE6
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE7
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE8
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE9
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_2D
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_BINDING_2D
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_BINDING_CUBE_MAP
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_CUBE_MAP
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_CUBE_MAP_NEGATIVE_X
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_CUBE_MAP_POSITIVE_X
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_MAG_FILTER
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_MIN_FILTER
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_WRAP_S
OpenGL ES 2.0 constant. |
|
static int |
GL_TEXTURE_WRAP_T
OpenGL ES 2.0 constant. |
|
static int |
GL_TRIANGLES
OpenGL ES 2.0 constant. |
|
static int |
GL_TRIANGLE_FAN
OpenGL ES 2.0 constant. |
|
static int |
GL_TRIANGLE_STRIP
OpenGL ES 2.0 constant. |
|
static int |
GL_TRUE
OpenGL ES 2.0 constant. |
|
static int |
GL_UNPACK_ALIGNMENT
OpenGL ES 2.0 constant. |
|
static int |
GL_UNSIGNED_BYTE
OpenGL ES 2.0 constant. |
|
static int |
GL_UNSIGNED_INT
OpenGL ES 2.0 constant. |
|
static int |
GL_UNSIGNED_SHORT
OpenGL ES 2.0 constant. |
|
static int |
GL_UNSIGNED_SHORT_4_4_4_4
OpenGL ES 2.0 constant. |
|
static int |
GL_UNSIGNED_SHORT_5_5_5_1
OpenGL ES 2.0 constant. |
|
static int |
GL_UNSIGNED_SHORT_5_6_5
OpenGL ES 2.0 constant. |
|
static int |
GL_VALIDATE_STATUS
OpenGL ES 2.0 constant. |
|
static int |
GL_VENDOR
OpenGL ES 2.0 constant. |
|
static int |
GL_VERSION
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_ATTRIB_ARRAY_ENABLED
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_ATTRIB_ARRAY_POINTER
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_ATTRIB_ARRAY_SIZE
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_ATTRIB_ARRAY_STRIDE
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_ATTRIB_ARRAY_TYPE
OpenGL ES 2.0 constant. |
|
static int |
GL_VERTEX_SHADER
OpenGL ES 2.0 constant. |
|
static int |
GL_VIEWPORT
OpenGL ES 2.0 constant. |
|
static int |
GL_ZERO
OpenGL ES 2.0 constant. |
Method Summary | ||
---|---|---|
void |
glActiveTexture(int texture)
Select active texture unit. |
|
void |
glAttachShader(int program,
int shader)
Attach a shader object to a program object. |
|
void |
glBindAttribLocation(int program,
int index,
String name)
Associate a generic vertex attribute index with a named attribute variable. |
|
void |
glBindBuffer(int target,
int buffer)
Bind a named buffer object. |
|
void |
glBindFramebuffer(int target,
int framebuffer)
Bind a named framebuffer object. |
|
void |
glBindRenderbuffer(int target,
int renderbuffer)
Bind a named renderbuffer object. |
|
void |
glBindTexture(int target,
int texture)
Bind a named texture to a texturing target. |
|
void |
glBlendColor(float red,
float green,
float blue,
float alpha)
Set the blend color. |
|
void |
glBlendEquation(int mode)
Specify the equation used for both the RGB blend equation and the Alpha blend equation. |
|
void |
glBlendEquationSeparate(int modeRGB,
int modeAlpha)
Set the RGB blend equation and the alpha blend equation separately. |
|
void |
glBlendFunc(int sfactor,
int dfactor)
Specify pixel arithmetic. |
|
void |
glBlendFuncSeparate(int srcRGB,
int dstRGB,
int srcAlpha,
int dstAlpha)
Specify pixel arithmetic for RGB and alpha components separately. |
|
void |
glBufferData(int target,
int size,
Buffer data,
int usage)
Create and initialize a buffer object's data store. |
|
void |
glBufferSubData(int target,
int offset,
int size,
Buffer data)
Update a subset of a buffer object's data store. |
|
int |
glCheckFramebufferStatus(int target)
Return the framebuffer completeness status of a framebuffer object. |
|
void |
glClear(int mask)
Clear buffers to preset values. |
|
void |
glClearColor(float red,
float green,
float blue,
float alpha)
Specify clear values for the color buffers. |
|
void |
glClearDepthf(float depth)
Specify the clear value for the depth buffer. |
|
void |
glClearStencil(int s)
Specify the clear value for the stencil buffer. |
|
void |
glColorMask(boolean red,
boolean green,
boolean blue,
boolean alpha)
Enable and disable writing of frame buffer color components. |
|
void |
glCompileShader(int shader)
Compile a shader object. |
|
void |
glCompressedTexImage2D(int target,
int level,
int internalformat,
int width,
int height,
int border,
int imageSize,
Buffer data)
Specify a two-dimensional texture image in a compressed format. |
|
void |
glCompressedTexSubImage2D(int target,
int level,
int xoffset,
int yoffset,
int width,
int height,
int format,
int imageSize,
Buffer data)
Specify a two-dimensional texture subimage in a compressed format. |
|
void |
glCopyTexImage2D(int target,
int level,
int internalformat,
int x,
int y,
int width,
int height,
int border)
Copy pixels into a 2D texture image. |
|
void |
glCopyTexSubImage2D(int target,
int level,
int xoffset,
int yoffset,
int x,
int y,
int width,
int height)
Copy a two-dimensional texture subimage. |
|
int |
glCreateProgram()
Create a program object. |
|
int |
glCreateShader(int type)
Create a shader object. |
|
void |
glCullFace(int mode)
Specify whether front- or back-facing facets can be culled. |
|
void |
glDeleteBuffers(int n,
int[] buffers,
int offset)
Delete named buffer objects. |
|
void |
glDeleteBuffers(int n,
IntBuffer buffers)
Integer Buffer version of glDeleteBuffers . |
|
void |
glDeleteFramebuffers(int n,
int[] framebuffers,
int offset)
Delete named framebuffer objects. |
|
void |
glDeleteFramebuffers(int n,
IntBuffer framebuffers)
Integer Buffer version of glDeleteFramebuffers . |
|
void |
glDeleteProgram(int program)
Delete a program object. |
|
void |
glDeleteRenderbuffers(int n,
int[] renderbuffers,
int offset)
Delete named renderbuffer objects Description glDeleteRenderbuffers deletes n renderbuffer objects
named by the elements of the array renderbuffers . |
|
void |
glDeleteRenderbuffers(int n,
IntBuffer renderbuffers)
Integer Buffer version of glDeleteRenderbuffers . |
|
void |
glDeleteShader(int shader)
Delete a shader object. |
|
void |
glDeleteTextures(int n,
int[] textures,
int offset)
Delete named textures. |
|
void |
glDeleteTextures(int n,
IntBuffer textures)
Integer Buffer version of glDeleteTextures . |
|
void |
glDepthFunc(int func)
Specify the value used for depth buffer comparisons. |
|
void |
glDepthMask(boolean flag)
Enable or disable writing into the depth buffer. |
|
void |
glDepthRangef(float zNear,
float zFar)
Specify mapping of depth values from normalized device coordinates to window coordinates. |
|
void |
glDetachShader(int program,
int shader)
Detach a shader object from a program object. |
|
void |
glDisable(int cap)
Disable server-side GL capabilities. |
|
void |
glDisableVertexAttribArray(int index)
Disable a generic vertex attribute array. |
|
void |
glDrawArrays(int mode,
int first,
int count)
Render primitives from array data. |
|
void |
glDrawElements(int mode,
int count,
int type,
int offset)
VBO version of glDrawElements . |
|
void |
glDrawElements(int mode,
int count,
int type,
Buffer indices)
Render primitives from array data. |
|
void |
glEnable(int cap)
Enable server-side GL capabilities. |
|
void |
glEnableVertexAttribArray(int index)
Enables a generic vertex attribute array. |
|
void |
glFinish()
Block until all GL execution is complete. |
|
void |
glFlush()
Force execution of GL commands in finite time. |
|
void |
glFramebufferRenderbuffer(int target,
int attachment,
int renderbuffertarget,
int renderbuffer)
Attach a renderbuffer object to a framebuffer object. |
|
void |
glFramebufferTexture2D(int target,
int attachment,
int textarget,
int texture,
int level)
Attach a texture image to a framebuffer object. |
|
void |
glFrontFace(int mode)
Define front- and back-facing polygons. |
|
void |
glGenBuffers(int n,
int[] buffers,
int offset)
Generate buffer object names. |
|
void |
glGenBuffers(int n,
IntBuffer buffers)
Integer Buffer version of glGenBuffers . |
|
void |
glGenFramebuffers(int n,
int[] framebuffers,
int offset)
Generate framebuffer object names Description glGenFramebuffers returns n framebuffer object names in framebuffers . |
|
void |
glGenFramebuffers(int n,
IntBuffer framebuffers)
Integer Buffer version of glGenBuffers . |
|
void |
glGenRenderbuffers(int n,
int[] renderbuffers,
int offset)
Generate renderbuffer object names. |
|
void |
glGenRenderbuffers(int n,
IntBuffer renderbuffers)
Integer Buffer version of glGenRenderbuffers . |
|
void |
glGenTextures(int n,
int[] textures,
int offset)
Generate texture names. |
|
void |
glGenTextures(int n,
IntBuffer textures)
Integer Buffer version of glGenTextures . |
|
void |
glGenerateMipmap(int target)
Generate a complete set of mipmaps for a texture object. |
|
void |
glGetActiveAttrib(int program,
int index,
int bufSize,
int[] length,
int lengthOffset,
int[] size,
int sizeOffset,
int[] type,
int typeOffset,
byte[] name,
int nameOffset)
Return information about an active attribute variable. |
|
String |
glGetActiveAttrib(int program,
int index,
int[] size,
int sizeOffset,
int[] type,
int typeOffset)
Return information about an active attribute variable. |
|
void |
glGetActiveUniform(int program,
int index,
int bufSize,
int[] length,
int lengthOffset,
int[] size,
int sizeOffset,
int[] type,
int typeOffset,
byte[] name,
int nameOffset)
Return information about an active uniform variable. |
|
String |
glGetActiveUniform(int program,
int index,
int[] size,
int sizeOffset,
int[] type,
int typeOffset)
Return information about an active uniform variable. |
|
void |
glGetAttachedShaders(int program,
int maxcount,
int[] count,
int countOffset,
int[] shaders,
int shadersOffset)
Return the handles of the shader objects attached to a program object Description glGetAttachedShaders returns the names of the shader
objects attached to program . |
|
void |
glGetAttachedShaders(int program,
int maxcount,
IntBuffer count,
IntBuffer shaders)
Integer Buffer version of
glGetAttachedShaders . |
|
int |
glGetAttribLocation(int program,
String name)
Return the location of an attribute variable. |
|
void |
glGetBooleanv(int pname,
boolean[] params,
int offset)
Boolean version of glGetIntegerv . |
|
void |
glGetBooleanv(int pname,
IntBuffer params)
Boolean version of glGetIntegerv . |
|
void |
glGetBufferParameteriv(int target,
int pname,
int[] params,
int offset)
Return parameters of a buffer object. |
|
void |
glGetBufferParameteriv(int target,
int pname,
IntBuffer params)
Integer Buffer version of
glGetBufferParameteriv . |
|
int |
glGetError()
Return error information. |
|
void |
glGetFloatv(int pname,
float[] params,
int offset)
Floating-point version of glGetIntegerv . |
|
void |
glGetFloatv(int pname,
FloatBuffer params)
Floating-point version of glGetIntegerv . |
|
void |
glGetFramebufferAttachmentParameteriv(int target,
int attachment,
int pname,
int[] params,
int offset)
Return attachment parameters of a framebuffer object. |
|
void |
glGetFramebufferAttachmentParameteriv(int target,
int attachment,
int pname,
IntBuffer params)
Integer Buffer version of
glGetFramebufferAttachmentParameteriv . |
|
void |
glGetIntegerv(int pname,
int[] params,
int offset)
Return the value or values of a selected parameter. |
|
void |
glGetIntegerv(int pname,
IntBuffer params)
Integer Buffer version of glGetIntegerv . |
|
String |
glGetProgramInfoLog(int program)
Return the information log for a program object. |
|
void |
glGetProgramInfoLog(int program,
int maxsize,
int[] length,
byte[] infolog)
Return the information log for a program object. |
|
void |
glGetProgramiv(int program,
int pname,
int[] params,
int offset)
Return a parameter from a program object. |
|
void |
glGetProgramiv(int program,
int pname,
IntBuffer params)
Integer Buffer version of glGetProgramiv . |
|
void |
glGetRenderbufferParameteriv(int target,
int pname,
int[] params,
int offset)
Return parameters of a renderbuffer object. |
|
void |
glGetRenderbufferParameteriv(int target,
int pname,
IntBuffer params)
Integer Buffer version of
glGetRenderbufferParameteriv . |
|
String |
glGetShaderInfoLog(int shader)
Return the information log for a shader object. |
|
void |
glGetShaderInfoLog(int shader,
int maxsize,
int[] length,
byte[] infolog)
Return the information log for a shader object. |
|
void |
glGetShaderPrecisionFormat(int shadertype,
int precisiontype,
int[] range,
int rangeOffset,
int[] precision,
int precisionOffset)
Return the range and precision for different shader numeric formats. |
|
String |
glGetShaderSource(int shader)
Return the source code string from a shader object. |
|
void |
glGetShaderSource(int shader,
int bufSize,
int[] length,
byte[] source)
Return the source code string from a shader object. |
|
void |
glGetShaderiv(int shader,
int pname,
int[] params,
int offset)
Return a parameter from a shader object Description glGetShaderiv returns in params the value of a parameter
for a specific shader object. |
|
void |
glGetShaderiv(int shader,
int pname,
IntBuffer params)
Integer Buffer version of glGetShaderiv . |
|
String |
glGetString(int name)
Return a string describing the current GL connection. |
|
void |
glGetTexParameterfv(int target,
int pname,
float[] params,
int offset)
Floating-point version of glGetTexParameteriv . |
|
void |
glGetTexParameterfv(int target,
int pname,
FloatBuffer params)
Floating-point version of glGetTexParameteriv . |
|
void |
glGetTexParameteriv(int target,
int pname,
int[] params,
int offset)
Return texture parameter values. |
|
void |
glGetTexParameteriv(int target,
int pname,
IntBuffer params)
Integer Buffer version of glGetTexParameteriv . |
|
int |
glGetUniformLocation(int program,
String name)
Return the location of a uniform variable. |
|
void |
glGetUniformfv(int program,
int location,
int count,
float[] params,
int offset)
Floating-point version of glGetUniformiv . |
|
void |
glGetUniformfv(int program,
int location,
int count,
FloatBuffer params)
Floating-point version of glGetUniformiv . |
|
void |
glGetUniformiv(int program,
int location,
int count,
int[] params,
int offset)
Return the value of a uniform variable. |
|
void |
glGetUniformiv(int program,
int location,
int count,
IntBuffer params)
Int Buffer version of glGetUniformiv . |
|
void |
glGetVertexAttribfv(int index,
int pname,
float[] params,
int offset)
Floating-point version of glGetVertexAttribiv . |
|
void |
glGetVertexAttribfv(int index,
int pname,
FloatBuffer params)
Floating-point version of glGetVertexAttribiv . |
|
void |
glGetVertexAttribiv(int index,
int pname,
int[] params,
int offset)
Return a generic vertex attribute parameter. |
|
void |
glGetVertexAttribiv(int index,
int pname,
IntBuffer params)
Integer Buffer version of glGetVertexAttribiv . |
|
void |
glHint(int target,
int mode)
Specify implementation-specific hints. |
|
boolean |
glIsBuffer(int buffer)
Determine if a name corresponds to a buffer object. |
|
boolean |
glIsEnabled(int cap)
Test whether a capability is enabled glIsEnabled returns true if cap is an enabled capability and
returns false otherwise. |
|
boolean |
glIsFramebuffer(int framebuffer)
Determine if a name corresponds to a framebuffer object. |
|
boolean |
glIsProgram(int program)
Determine if a name corresponds to a program object. |
|
boolean |
glIsRenderbuffer(int renderbuffer)
Determine if a name corresponds to a renderbuffer object. |
|
boolean |
glIsShader(int shader)
Determine if a name corresponds to a shader object. |
|
boolean |
glIsTexture(int texture)
Determine if a name corresponds to a texture. |
|
void |
glLineWidth(float width)
Specify the width of rasterized lines Description glLineWidth specifies the rasterized width of lines. |
|
void |
glLinkProgram(int program)
Link a program object. |
|
void |
glPixelStorei(int pname,
int param)
Set pixel storage modes. |
|
void |
glPolygonOffset(float factor,
float units)
Set the scale and units used to calculate depth values. |
|
void |
glReadPixels(int x,
int y,
int width,
int height,
int format,
int type,
Buffer pixels)
Read a block of pixels from the frame buffer. |
|
void |
glReleaseShaderCompiler()
Release resources allocated by the shader compiler. |
|
void |
glRenderbufferStorage(int target,
int internalformat,
int width,
int height)
Create and initialize a renderbuffer object's data store. |
|
void |
glSampleCoverage(float value,
boolean invert)
Specify multisample coverage parameters Description Multisampling samples a pixel multiple times at various implementation-dependent subpixel locations to generate antialiasing effects. |
|
void |
glScissor(int x,
int y,
int width,
int height)
Define the scissor box. |
|
void |
glShaderBinary(int n,
int[] shaders,
int shadersOffset,
int binaryformat,
Buffer binary,
int length)
Load a precompiled shader binary. |
|
void |
glShaderBinary(int n,
IntBuffer shaders,
int binaryformat,
Buffer binary,
int length)
Integer Buffer version of glShaderBinary . |
|
void |
glShaderSource(int shader,
int count,
String[] strings,
int[] lengths)
Replace the source code in a shader object. |
|
void |
glShaderSource(int shader,
String source)
Replace the source code in a shader object. |
|
void |
glStencilFunc(int func,
int ref,
int mask)
Set front and back function and reference value for stencil testing. |
|
void |
glStencilFuncSeparate(int face,
int func,
int ref,
int mask)
Set front and/or back function and reference value for stencil testing. |
|
void |
glStencilMask(int mask)
Control the front and back writing of individual bits in the stencil planes. |
|
void |
glStencilMaskSeparate(int face,
int mask)
Control the front and/or back writing of individual bits in the stencil planes. |
|
void |
glStencilOp(int fail,
int zfail,
int zpass)
Set front and back stencil test actions. |
|
void |
glStencilOpSeparate(int face,
int fail,
int zfail,
int zpass)
Set front and/or back stencil test actions. |
|
void |
glTexImage2D(int target,
int level,
int internalformat,
int width,
int height,
int border,
int format,
int type,
Buffer data)
Specify a two-dimensional texture image. |
|
void |
glTexParameterf(int target,
int pname,
float param)
Set texture parameters. |
|
void |
glTexParameterfv(int target,
int pname,
float[] params,
int offset)
Floating-point array version of glTexParameterf . |
|
void |
glTexParameterfv(int target,
int pname,
FloatBuffer params)
Floating-point Buffer version of glTexParameterfv . |
|
void |
glTexParameteri(int target,
int pname,
int param)
Integer version of glTexParameterf . |
|
void |
glTexParameteriv(int target,
int pname,
int[] params,
int offset)
Integer array version of glTexParameteri . |
|
void |
glTexParameteriv(int target,
int pname,
IntBuffer params)
Integer Buffer version of glTexParameteriv . |
|
void |
glTexSubImage2D(int target,
int level,
int xoffset,
int yoffset,
int width,
int height,
int format,
int type,
Buffer data)
Specify a two-dimensional texture subimage. |
|
void |
glUniform1f(int location,
float x)
Specify the value of a uniform variable for the current program object. |
|
void |
glUniform1fv(int location,
int count,
float[] v,
int offset)
Floating-point 1 value array version of glUniform1f . |
|
void |
glUniform1fv(int location,
int count,
FloatBuffer v)
Floating-point 1 value Buffer version of glUniform1f . |
|
void |
glUniform1i(int location,
int x)
Integer 1 value version of glUniform1f . |
|
void |
glUniform1iv(int location,
int count,
int[] v,
int offset)
Ingteger 1 value array version of glUniform1f . |
|
void |
glUniform1iv(int location,
int count,
IntBuffer v)
Integer 1 value Buffer version of glUniform1f . |
|
void |
glUniform2f(int location,
float x,
float y)
Floating-point 2 value version of glUniform1f . |
|
void |
glUniform2fv(int location,
int count,
float[] v,
int offset)
Floating-point 2 value array version of glUniform1f . |
|
void |
glUniform2fv(int location,
int count,
FloatBuffer v)
Floating-point 2 value Buffer version of glUniform1f . |
|
void |
glUniform2i(int location,
int x,
int y)
Integer 2 value version of glUniform1f . |
|
void |
glUniform2iv(int location,
int count,
int[] v,
int offset)
Ingteger 2 value array version of glUniform1f . |
|
void |
glUniform2iv(int location,
int count,
IntBuffer v)
Integer 2 value Buffer version of glUniform1f . |
|
void |
glUniform3f(int location,
float x,
float y,
float z)
Floating-point 3 value version of glUniform1f . |
|
void |
glUniform3fv(int location,
int count,
float[] v,
int offset)
Floating-point 3 value array version of glUniform1f . |
|
void |
glUniform3fv(int location,
int count,
FloatBuffer v)
Floating-point 3 value Buffer version of glUniform1f . |
|
void |
glUniform3i(int location,
int x,
int y,
int z)
Integer 3 value version of glUniform1f . |
|
void |
glUniform3iv(int location,
int count,
int[] v,
int offset)
Ingteger 3 value array version of glUniform1f . |
|
void |
glUniform3iv(int location,
int count,
IntBuffer v)
Integer 3 value Buffer version of glUniform1f . |
|
void |
glUniform4f(int location,
float x,
float y,
float z,
float w)
Floating-point 4 value version of glUniform1f . |
|
void |
glUniform4fv(int location,
int count,
float[] v,
int offset)
Floating-point 4 value array version of glUniform1f . |
|
void |
glUniform4fv(int location,
int count,
FloatBuffer v)
Floating-point 4 value Buffer version of glUniform1f . |
|
void |
glUniform4i(int location,
int x,
int y,
int z,
int w)
Integer 4 value version of glUniform1f . |
|
void |
glUniform4iv(int location,
int count,
int[] v,
int offset)
Integer 4 value array version of glUniform1f . |
|
void |
glUniform4iv(int location,
int count,
IntBuffer v)
Integer 4 value Buffer version of glUniform1f . |
|
void |
glUniformMatrix2fv(int location,
int count,
boolean transpose,
float[] value,
int offset)
Floating-point 2x2 matrix array version of glUniform1f . |
|
void |
glUniformMatrix2fv(int location,
int count,
boolean transpose,
FloatBuffer value)
Floating-point 2x2 matrix Buffer version of glUniform1f . |
|
void |
glUniformMatrix3fv(int location,
int count,
boolean transpose,
float[] value,
int offset)
Floating-point 3x3 matrix array version of glUniform1f . |
|
void |
glUniformMatrix3fv(int location,
int count,
boolean transpose,
FloatBuffer value)
Floating-point 3x3 matrix Buffer version of glUniform1f . |
|
void |
glUniformMatrix4fv(int location,
int count,
boolean transpose,
float[] value,
int offset)
Floating-point 4x4 matrix array version of glUniform1f . |
|
void |
glUniformMatrix4fv(int location,
int count,
boolean transpose,
FloatBuffer value)
Floating-point 4x4 matrix Buffer version of glUniform1f . |
|
void |
glUseProgram(int program)
Install a program object as part of current rendering state. |
|
void |
glValidateProgram(int program)
Validate a program object. |
|
void |
glVertexAttrib1f(int index,
float x)
Specify the value of a generic vertex attribute. |
|
void |
glVertexAttrib1fv(int index,
float[] values,
int offset)
Floating-point 1 value array version of glVertexAttrib1f . |
|
void |
glVertexAttrib1fv(int index,
FloatBuffer values)
Floating-point 1 value Buffer version of glVertexAttrib1f . |
|
void |
glVertexAttrib2f(int index,
float x,
float y)
Floating-point 2 value version of glVertexAttrib1f . |
|
void |
glVertexAttrib2fv(int index,
float[] values,
int offset)
Floating-point 2 value array version of glVertexAttrib1f . |
|
void |
glVertexAttrib2fv(int index,
FloatBuffer values)
Floating-point 2 value Buffer version of glVertexAttrib1f . |
|
void |
glVertexAttrib3f(int index,
float x,
float y,
float z)
Floating-point 3 value version of glVertexAttrib1f . |
|
void |
glVertexAttrib3fv(int index,
float[] values,
int offset)
Floating-point 3 value array version of glVertexAttrib1f . |
|
void |
glVertexAttrib3fv(int index,
FloatBuffer values)
Floating-point 3 value Buffer version of glVertexAttrib1f . |
|
void |
glVertexAttrib4f(int index,
float x,
float y,
float z,
float w)
Floating-point 4 value version of glVertexAttrib1f . |
|
void |
glVertexAttrib4fv(int index,
float[] values,
int offset)
Floating-point 4 value array version of glVertexAttrib1f . |
|
void |
glVertexAttrib4fv(int index,
FloatBuffer values)
Floating-point 4 value Buffer version of glVertexAttrib1f . |
|
void |
glVertexAttribPointer(int index,
int size,
int type,
boolean normalized,
int stride,
int offset)
VBO version of glVertexAttribPointer . |
|
void |
glVertexAttribPointer(int index,
int size,
int type,
boolean normalized,
int stride,
Buffer data)
Define an array of generic vertex attribute data. |
|
void |
glViewport(int x,
int y,
int width,
int height)
Set the viewport. |
Field Detail |
---|
static final int GL_ES_VERSION_2_0
static final int GL_DEPTH_BUFFER_BIT
static final int GL_STENCIL_BUFFER_BIT
static final int GL_COLOR_BUFFER_BIT
static final int GL_FALSE
static final int GL_TRUE
static final int GL_POINTS
static final int GL_LINES
static final int GL_LINE_LOOP
static final int GL_LINE_STRIP
static final int GL_TRIANGLES
static final int GL_TRIANGLE_STRIP
static final int GL_TRIANGLE_FAN
static final int GL_ZERO
static final int GL_ONE
static final int GL_SRC_COLOR
static final int GL_ONE_MINUS_SRC_COLOR
static final int GL_SRC_ALPHA
static final int GL_ONE_MINUS_SRC_ALPHA
static final int GL_DST_ALPHA
static final int GL_ONE_MINUS_DST_ALPHA
static final int GL_DST_COLOR
static final int GL_ONE_MINUS_DST_COLOR
static final int GL_SRC_ALPHA_SATURATE
static final int GL_FUNC_ADD
static final int GL_BLEND_EQUATION
static final int GL_BLEND_EQUATION_RGB
static final int GL_BLEND_EQUATION_ALPHA
static final int GL_FUNC_SUBTRACT
static final int GL_FUNC_REVERSE_SUBTRACT
static final int GL_BLEND_DST_RGB
static final int GL_BLEND_SRC_RGB
static final int GL_BLEND_DST_ALPHA
static final int GL_BLEND_SRC_ALPHA
static final int GL_CONSTANT_COLOR
static final int GL_ONE_MINUS_CONSTANT_COLOR
static final int GL_CONSTANT_ALPHA
static final int GL_ONE_MINUS_CONSTANT_ALPHA
static final int GL_BLEND_COLOR
static final int GL_ARRAY_BUFFER
static final int GL_ELEMENT_ARRAY_BUFFER
static final int GL_ARRAY_BUFFER_BINDING
static final int GL_ELEMENT_ARRAY_BUFFER_BINDING
static final int GL_STREAM_DRAW
static final int GL_STATIC_DRAW
static final int GL_DYNAMIC_DRAW
static final int GL_BUFFER_SIZE
static final int GL_BUFFER_USAGE
static final int GL_CURRENT_VERTEX_ATTRIB
static final int GL_FRONT
static final int GL_BACK
static final int GL_FRONT_AND_BACK
static final int GL_TEXTURE_2D
static final int GL_CULL_FACE
static final int GL_BLEND
static final int GL_DITHER
static final int GL_STENCIL_TEST
static final int GL_DEPTH_TEST
static final int GL_SCISSOR_TEST
static final int GL_POLYGON_OFFSET_FILL
static final int GL_SAMPLE_ALPHA_TO_COVERAGE
static final int GL_SAMPLE_COVERAGE
static final int GL_NO_ERROR
static final int GL_INVALID_ENUM
static final int GL_INVALID_VALUE
static final int GL_INVALID_OPERATION
static final int GL_OUT_OF_MEMORY
static final int GL_CW
static final int GL_CCW
static final int GL_LINE_WIDTH
static final int GL_ALIASED_POINT_SIZE_RANGE
static final int GL_ALIASED_LINE_WIDTH_RANGE
static final int GL_CULL_FACE_MODE
static final int GL_FRONT_FACE
static final int GL_DEPTH_RANGE
static final int GL_DEPTH_WRITEMASK
static final int GL_DEPTH_CLEAR_VALUE
static final int GL_DEPTH_FUNC
static final int GL_STENCIL_CLEAR_VALUE
static final int GL_STENCIL_FUNC
static final int GL_STENCIL_FAIL
static final int GL_STENCIL_PASS_DEPTH_FAIL
static final int GL_STENCIL_PASS_DEPTH_PASS
static final int GL_STENCIL_REF
static final int GL_STENCIL_VALUE_MASK
static final int GL_STENCIL_WRITEMASK
static final int GL_STENCIL_BACK_FUNC
static final int GL_STENCIL_BACK_FAIL
static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL
static final int GL_STENCIL_BACK_PASS_DEPTH_PASS
static final int GL_STENCIL_BACK_REF
static final int GL_STENCIL_BACK_VALUE_MASK
static final int GL_STENCIL_BACK_WRITEMASK
static final int GL_VIEWPORT
static final int GL_SCISSOR_BOX
static final int GL_COLOR_CLEAR_VALUE
static final int GL_COLOR_WRITEMASK
static final int GL_UNPACK_ALIGNMENT
static final int GL_PACK_ALIGNMENT
static final int GL_MAX_TEXTURE_SIZE
static final int GL_MAX_VIEWPORT_DIMS
static final int GL_SUBPIXEL_BITS
static final int GL_RED_BITS
static final int GL_GREEN_BITS
static final int GL_BLUE_BITS
static final int GL_ALPHA_BITS
static final int GL_DEPTH_BITS
static final int GL_STENCIL_BITS
static final int GL_POLYGON_OFFSET_UNITS
static final int GL_POLYGON_OFFSET_FACTOR
static final int GL_TEXTURE_BINDING_2D
static final int GL_SAMPLE_BUFFERS
static final int GL_SAMPLES
static final int GL_SAMPLE_COVERAGE_VALUE
static final int GL_SAMPLE_COVERAGE_INVERT
static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS
static final int GL_COMPRESSED_TEXTURE_FORMATS
static final int GL_DONT_CARE
static final int GL_FASTEST
static final int GL_NICEST
static final int GL_GENERATE_MIPMAP_HINT
static final int GL_BYTE
static final int GL_UNSIGNED_BYTE
static final int GL_SHORT
static final int GL_UNSIGNED_SHORT
static final int GL_INT
static final int GL_UNSIGNED_INT
static final int GL_FLOAT
static final int GL_FIXED
static final int GL_DEPTH_COMPONENT
static final int GL_ALPHA
static final int GL_RGB
static final int GL_RGBA
static final int GL_LUMINANCE
static final int GL_LUMINANCE_ALPHA
static final int GL_UNSIGNED_SHORT_4_4_4_4
static final int GL_UNSIGNED_SHORT_5_5_5_1
static final int GL_UNSIGNED_SHORT_5_6_5
static final int GL_FRAGMENT_SHADER
static final int GL_VERTEX_SHADER
static final int GL_MAX_VERTEX_ATTRIBS
static final int GL_MAX_VERTEX_UNIFORM_VECTORS
static final int GL_MAX_VARYING_VECTORS
static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
static final int GL_MAX_TEXTURE_IMAGE_UNITS
static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS
static final int GL_SHADER_TYPE
static final int GL_DELETE_STATUS
static final int GL_LINK_STATUS
static final int GL_VALIDATE_STATUS
static final int GL_ATTACHED_SHADERS
static final int GL_ACTIVE_UNIFORMS
static final int GL_ACTIVE_UNIFORM_MAX_LENGTH
static final int GL_ACTIVE_ATTRIBUTES
static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
static final int GL_SHADING_LANGUAGE_VERSION
static final int GL_CURRENT_PROGRAM
static final int GL_NEVER
static final int GL_LESS
static final int GL_EQUAL
static final int GL_LEQUAL
static final int GL_GREATER
static final int GL_NOTEQUAL
static final int GL_GEQUAL
static final int GL_ALWAYS
static final int GL_KEEP
static final int GL_REPLACE
static final int GL_INCR
static final int GL_DECR
static final int GL_INVERT
static final int GL_INCR_WRAP
static final int GL_DECR_WRAP
static final int GL_VENDOR
static final int GL_RENDERER
static final int GL_VERSION
static final int GL_EXTENSIONS
static final int GL_NEAREST
static final int GL_LINEAR
static final int GL_NEAREST_MIPMAP_NEAREST
static final int GL_LINEAR_MIPMAP_NEAREST
static final int GL_NEAREST_MIPMAP_LINEAR
static final int GL_LINEAR_MIPMAP_LINEAR
static final int GL_TEXTURE_MAG_FILTER
static final int GL_TEXTURE_MIN_FILTER
static final int GL_TEXTURE_WRAP_S
static final int GL_TEXTURE_WRAP_T
static final int GL_TEXTURE
static final int GL_TEXTURE_CUBE_MAP
static final int GL_TEXTURE_BINDING_CUBE_MAP
static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X
static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X
static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y
static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z
static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE
static final int GL_TEXTURE0
static final int GL_TEXTURE1
static final int GL_TEXTURE2
static final int GL_TEXTURE3
static final int GL_TEXTURE4
static final int GL_TEXTURE5
static final int GL_TEXTURE6
static final int GL_TEXTURE7
static final int GL_TEXTURE8
static final int GL_TEXTURE9
static final int GL_TEXTURE10
static final int GL_TEXTURE11
static final int GL_TEXTURE12
static final int GL_TEXTURE13
static final int GL_TEXTURE14
static final int GL_TEXTURE15
static final int GL_TEXTURE16
static final int GL_TEXTURE17
static final int GL_TEXTURE18
static final int GL_TEXTURE19
static final int GL_TEXTURE20
static final int GL_TEXTURE21
static final int GL_TEXTURE22
static final int GL_TEXTURE23
static final int GL_TEXTURE24
static final int GL_TEXTURE25
static final int GL_TEXTURE26
static final int GL_TEXTURE27
static final int GL_TEXTURE28
static final int GL_TEXTURE29
static final int GL_TEXTURE30
static final int GL_TEXTURE31
static final int GL_ACTIVE_TEXTURE
static final int GL_REPEAT
static final int GL_CLAMP_TO_EDGE
static final int GL_MIRRORED_REPEAT
static final int GL_FLOAT_VEC2
static final int GL_FLOAT_VEC3
static final int GL_FLOAT_VEC4
static final int GL_INT_VEC2
static final int GL_INT_VEC3
static final int GL_INT_VEC4
static final int GL_BOOL
static final int GL_BOOL_VEC2
static final int GL_BOOL_VEC3
static final int GL_BOOL_VEC4
static final int GL_FLOAT_MAT2
static final int GL_FLOAT_MAT3
static final int GL_FLOAT_MAT4
static final int GL_SAMPLER_2D
static final int GL_SAMPLER_CUBE
static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED
static final int GL_VERTEX_ATTRIB_ARRAY_SIZE
static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE
static final int GL_VERTEX_ATTRIB_ARRAY_TYPE
static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
static final int GL_VERTEX_ATTRIB_ARRAY_POINTER
static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
static final int GL_IMPLEMENTATION_COLOR_READ_TYPE
static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT
static final int GL_COMPILE_STATUS
static final int GL_INFO_LOG_LENGTH
static final int GL_SHADER_SOURCE_LENGTH
static final int GL_SHADER_COMPILER
static final int GL_SHADER_BINARY_FORMATS
static final int GL_NUM_SHADER_BINARY_FORMATS
static final int GL_LOW_FLOAT
static final int GL_MEDIUM_FLOAT
static final int GL_HIGH_FLOAT
static final int GL_LOW_INT
static final int GL_MEDIUM_INT
static final int GL_HIGH_INT
static final int GL_FRAMEBUFFER
static final int GL_RENDERBUFFER
static final int GL_RGBA4
static final int GL_RGB5_A1
static final int GL_RGB565
static final int GL_DEPTH_COMPONENT16
static final int GL_STENCIL_INDEX
static final int GL_STENCIL_INDEX8
static final int GL_RENDERBUFFER_WIDTH
static final int GL_RENDERBUFFER_HEIGHT
static final int GL_RENDERBUFFER_INTERNAL_FORMAT
static final int GL_RENDERBUFFER_RED_SIZE
static final int GL_RENDERBUFFER_GREEN_SIZE
static final int GL_RENDERBUFFER_BLUE_SIZE
static final int GL_RENDERBUFFER_ALPHA_SIZE
static final int GL_RENDERBUFFER_DEPTH_SIZE
static final int GL_RENDERBUFFER_STENCIL_SIZE
static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
static final int GL_COLOR_ATTACHMENT0
static final int GL_DEPTH_ATTACHMENT
static final int GL_STENCIL_ATTACHMENT
static final int GL_NONE
static final int GL_FRAMEBUFFER_COMPLETE
static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
static final int GL_FRAMEBUFFER_UNSUPPORTED
static final int GL_FRAMEBUFFER_BINDING
static final int GL_RENDERBUFFER_BINDING
static final int GL_MAX_RENDERBUFFER_SIZE
static final int GL_INVALID_FRAMEBUFFER_OPERATION
Method Detail |
---|
void glActiveTexture(int texture)
glActiveTexture
selects which texture unit subsequent
texture state calls will affect. The number of texture units an
implementation supports is implementation dependent,
but must be at least 2.
GL_INVALID_ENUM
is generated if texture
is not one
of GL_TEXTURE
i, where i ranges from 0 to
(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
- 1).
glGetIntegerv
/glGetIntegerv
with argument GL_ACTIVE_TEXTURE
or GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
.
texture
- Specifies which texture unit to make active.
The number of texture units is implementation dependent,
but must be at least two. texture
must be one of GL_TEXTURE
i,
where i ranges from 0 to (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
- 1).
The initial value is GL_TEXTURE0
.GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, int[], int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
void glAttachShader(int program, int shader)
In order to create an executable, there must be a way to specify the list of
things that will be linked together. Program objects provide this mechanism.
Shaders that are to be linked together in a program object must first be attached
to that program object. glAttachShader
attaches the shader object specified by
shader
to the program object specified by program
.
This indicates that shader
will be included in link operations
that will be performed on program
.
All operations that can be performed on a shader object are valid whether or not
the shader object is attached to a program object. It is permissible to attach a
shader object to a program object before source code has been loaded into the
shader object or before the shader object has been compiled. It is permissible to
attach multiple shader objects of the same type because each may contain a portion
of the complete shader. It is also permissible to attach a shader object to more
than one program object. If a shader object is deleted while it is attached to a
program object, it will be flagged for deletion, and deletion will not occur until
glDetachShader
is called to detach it from all program objects to which it is attached.
GL_INVALID_VALUE
is generated if either program
or
shader
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if shader
is not a shader object.
GL_INVALID_OPERATION
is generated if shader
is already attached to
program
.
glGetAttachedShaders
/
glGetAttachedShaders
with the handle of a valid program object.
program
- Specifies the program object to which a shader object will be attached.shader
- Specifies the shader object that is to be attached.GL20.glCompileShader(int)
,
GL20.glDetachShader(int, int)
,
GL20.glLinkProgram(int)
,
GL20.glShaderSource(int, int, String[], int[])
,
GL20.glShaderBinary(int, IntBuffer, int, Buffer, int)
,
GL20.glShaderBinary(int, int[], int, int, Buffer, int)
void glBindAttribLocation(int program, int index, String name)
glBindAttribLocation
is used to associate a user-defined
attribute variable in the program object specified by program
with a
generic vertex attribute index. The name of the user-defined attribute
variable is passed as a string in name
. The generic vertex
attribute index to be bound to this variable is specified by index
.
When program
is made part of current state, values provided via the
generic vertex attribute index
will modify the value of the user-defined
attribute variable specified by name
.
If name
refers to a matrix attribute variable,
index
refers to the first column
of the matrix. Other matrix columns are then automatically bound to locations
index+1
for a matrix of type mat2; index+1
and index+2
for a matrix of type mat3; and index+1
,
index+2
, and index+3
for a matrix of type mat4.
This command makes it possible for vertex shaders to use descriptive names
for attribute variables rather than generic variables that are numbered
from 0 to GL_MAX_VERTEX_ATTRIBS
-1. The values sent to each generic attribute
index are part of current state, just like standard vertex attributes such as
color, normal, and vertex position. If a different program object is made current
by calling glUseProgram
, the generic vertex attributes are tracked in such a way
that the same values will be observed by attributes in the new program object
that are also bound to index
.
Attribute variable name-to-generic attribute index bindings for a program object
can be explicitly assigned at any time by calling glBindAttribLocation
. Attribute
bindings do not go into effect until glLinkProgram
is called. After a program object
has been linked successfully, the index values for generic attributes remain
fixed (and their values can be queried) until the next link command occurs.
Applications are not allowed to bind any of the standard OpenGL vertex attributes using this command, as they are bound automatically when needed. Any attribute binding that occurs after the program object has been linked will not take effect until the next time the program object is linked.
glBindAttribLocation
can be called before any vertex shader objects are bound to the
specified program object. It is also permissible to bind a generic attribute index to
an attribute variable name that is never used in a vertex shader.
If name
was bound previously, that information is lost. Thus you cannot bind one
user-defined attribute variable to multiple indices, but you can bind multiple
user-defined attribute variables to the same index.
Applications are allowed to bind more than one user-defined attribute variable to the same generic vertex attribute index. This is called aliasing, and it is allowed only if just one of the aliased attributes is active in the executable program, or if no path through the shader consumes more than one attribute of a set of attributes aliased to the same location. The compiler and linker are allowed to assume that no aliasing is done and are free to employ optimizations that work only in the absence of aliasing. OpenGL implementations are not required to do error checking to detect aliasing. Because there is no way to bind standard attributes, it is not possible to alias generic attributes with conventional ones (except for generic attribute 0).
Active attributes that are not explicitly bound will be bound by the linker
when glLinkProgram
is called. The locations assigned can be
queried by calling glGetAttribLocation
.
GL_INVALID_VALUE
is generated if index
is greater than or equal
to GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_OPERATION
is generated if name
starts with the reserved prefix "gl_".
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_ATTRIBS
glGetActiveAttrib
with argument program
glGetAttribLocation
with arguments
program
and name
program
- Specifies the handle of the program object in which the association is to be made.index
- Specifies the index of the generic vertex attribute to be bound.name
- Specifies a string containing the name of the vertex
shader attribute variable to which index
is to be bound.GL20.glDisableVertexAttribArray(int)
,
GL20.glEnableVertexAttribArray(int)
,
GL20.glUseProgram(int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glBindBuffer(int target, int buffer)
glBindBuffer
lets you create or use a named buffer object.
Calling glBindBuffer
with target
set to
GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
and buffer
set to the name of the new buffer object binds the buffer object name
to the target. When a buffer object is bound to a target, the previous binding
for that target is automatically broken.
Buffer object names are unsigned integers. The value zero is reserved,
but there is no default buffer object for each buffer object target.
Instead, buffer
set to zero effectively unbinds any buffer object
previously bound, and restores client memory usage for that buffer
object target. Buffer object names and the corresponding buffer object contents
are local to the shared object space of the current GL rendering context.
You may use glGenBuffers
/
glGenBuffers
to generate a set of new buffer object names.
The state of a buffer object immediately after it is first bound is a zero-sized
memory buffer with GL_STATIC_DRAW
usage.
While a non-zero buffer object name is bound, GL operations on the target
to which it is bound affect the bound buffer object, and queries of the target to which
it is bound return state from the bound buffer object. While buffer object name zero is bound,
as in the initial state, attempts to modify or query state on the target to which it is
bound generates an GL_INVALID_OPERATION
error.
When vertex array pointer state is changed by a call to
glVertexAttribPointer
/
glVertexAttribPointer
,
the current buffer object binding (GL_ARRAY_BUFFER_BINDING
) is copied into the
corresponding client state for the vertex attrib array being changed, one of the
indexed GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
s. While a non-zero buffer object is
bound to the GL_ARRAY_BUFFER
target, the vertex array pointer parameter that is
traditionally interpreted as a pointer to client-side memory is instead interpreted
as an offset within the buffer object measured in basic machine units.
While a non-zero buffer object is bound to the GL_ELEMENT_ARRAY_BUFFER
target,
the indices parameter of glDrawElements
/
glDrawElements
that is traditionally interpreted as a
pointer to client-side memory is instead interpreted as an offset within the buffer
object measured in basic machine units.
A buffer object binding created with glBindBuffer
remains active until a
different buffer object name is bound to the same target, or until the
bound buffer object is deleted with glDeleteBuffers
/
glDeleteBuffers
.
Once created, a named buffer object may be re-bound to any target as often as needed. However, the GL implementation may make choices about how to optimize the storage of a buffer object based on its initial binding target.
GL_INVALID_ENUM
is generated if target
is not one of the allowable values.
glGetIntegerv
/glGetIntegerv
with argument GL_ARRAY_BUFFER_BINDING
glGetIntegerv
/glGetIntegerv
with argument GL_ELEMENT_ARRAY_BUFFER_BINDING
target
- Specifies the target to which the buffer object is bound.
The symbolic constant must be GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.buffer
- Specifies the name of a buffer object.GL20.glDeleteBuffers(int, IntBuffer)
,
GL20.glDeleteBuffers(int, int[], int)
,
GL20.glGenBuffers(int, IntBuffer)
,
GL20.glGenBuffers(int, int[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
,
GL20.glIsBuffer(int)
void glBindFramebuffer(int target, int framebuffer)
glBindFramebuffer
lets you create or use a named framebuffer object.
Calling glBindFramebuffer
with target
set to
GL_FRAMEBUFFER
and framebuffer
set to the name of the new framebuffer object binds the framebuffer object name.
When a framebuffer object is bound, the previous binding is automatically broken.
Framebuffer object names are unsigned integers. The value zero is reserved to represent the default framebuffer provided by the windowing system. Framebuffer object names and the corresponding framebuffer object contents are local to the shared object space of the current GL rendering context.
You may use glGenFramebuffers
/
glGenFramebuffers
to generate
a set of new framebuffer object names.
The state of a framebuffer object immediately after it is first bound is
three attachment points (GL_COLOR_ATTACHMENT0
, GL_DEPTH_ATTACHMENT
,
and GL_STENCIL_ATTACHMENT
) each with GL_NONE
as the object type.
While a non-zero framebuffer object name is bound, GL operations on
target GL_FRAMEBUFFER
affect the bound framebuffer object, and queries
of target GL_FRAMEBUFFER
or of framebuffer details such as GL_DEPTH_BITS
return state from the bound framebuffer object. While framebuffer object
name zero is bound, as in the initial state, attempts to modify or query
state on target GL_FRAMEBUFFER
generates an GL_INVALID_OPERATION
error.
While a non-zero framebuffer object name is bound, all rendering to the
framebuffer (with glDrawArrays
and
glDrawElements
/
glDrawElements
) and reading from the
framebuffer (with glReadPixels
,
glCopyTexImage2D
, or
glCopyTexSubImage2D
)
use the images attached to the application-created framebuffer object rather
than the default window-system-provided framebuffer.
Application created framebuffer objects (i.e. those with a non-zero name)
differ from the default window-system-provided framebuffer in a few important ways.
First, they have modifiable attachment points for a color buffer, a depth buffer,
and a stencil buffer to which framebuffer attachable images may be attached and detached.
Second, the size and format of the attached images are controlled entirely within the GL
and are not affected by window-system events, such as pixel format selection, window resizes,
and display mode changes. Third, when rendering to or reading from an application created
framebuffer object, the pixel ownership test always succeeds (i.e. they own all their pixels).
Fourth, there are no visible color buffer bitplanes, only a single "off-screen" color image attachment,
so there is no sense of front and back buffers or swapping. Finally, there is no
multisample buffer, so the value of the implementation-dependent state
variables GL_SAMPLES
and GL_SAMPLE_BUFFERS
are both zero for application
created framebuffer objects.
A framebuffer object binding created with glBindFramebuffer
remains active
until a different framebuffer object name is bound, or until the bound
framebuffer object is deleted with glDeleteFramebuffers
/
glDeleteFramebuffers
.
Queries of implementation-dependent pixel depths and related state are derived from the currently
bound framebuffer object. These include GL_RED_BITS
, GL_GREEN_BITS
,
GL_BLUE_BITS
, GL_ALPHA_BITS
, GL_DEPTH_BITS
,
GL_STENCIL_BITS
, GL_IMPLEMENTATION_COLOR_READ_TYPE
,
GL_IMPLEMENTATION_COLOR_READ_FORMAT
, GL_SAMPLES
, and GL_SAMPLE_BUFFERS
.
GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
glGetIntegerv
/glGetIntegerv
with argument GL_FRAMEBUFFER_BINDING
target
- Specifies the target to which the framebuffer object is bound.
The symbolic constant must be GL_FRAMEBUFFER
.framebuffer
- Specifies the name of a framebuffer object.GL20.glDeleteFramebuffers(int, IntBuffer)
,
GL20.glDeleteFramebuffers(int, int[], int)
,
GL20.glFramebufferRenderbuffer(int, int, int, int)
,
GL20.glFramebufferTexture2D(int, int, int, int, int)
,
GL20.glGenFramebuffers(int, IntBuffer)
,
GL20.glGenFramebuffers(int, int[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, IntBuffer)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, int[], int)
,
GL20.glIsFramebuffer(int)
void glBindRenderbuffer(int target, int renderbuffer)
glBindRenderbuffer
lets you create or use a named renderbuffer object.
Calling glBindRenderbuffer
with target
set to
GL_RENDERBUFFER
and renderbuffer
set to the name of the new renderbuffer object
binds the renderbuffer object name. When a renderbuffer object is
bound, the previous binding is automatically broken.
Renderbuffer object names are unsigned integers.
The value zero is reserved, but there is no default renderbuffer object.
Instead, renderbuffer
set to zero effectively unbinds any renderbuffer
object previously bound. Renderbuffer object names and the corresponding
renderbuffer object contents are local to the shared object space of the
current GL rendering context.
You may use glGenRenderbuffers
/
glGenRenderbuffers
to generate a set of new renderbuffer object names.
The state of a renderbuffer object immediately after it is first
bound is a zero-sized memory buffer with format GL_RGBA4
and
zero-sized red, green, blue, alpha, depth, and stencil pixel depths.
While a non-zero renderbuffer object name is bound, GL operations on
target GL_RENDERBUFFER
affect the bound renderbuffer object, and queries
of target GL_RENDERBUFFER
return state from the bound renderbuffer object.
While renderbuffer object name zero is bound, as in the initial state,
attempts to modify or query state on target GL_RENDERBUFFER
generates
an GL_INVALID_OPERATION
error.
A renderbuffer object binding created with glBindRenderbuffer
remains
active until a different renderbuffer object name is bound, or until
the bound renderbuffer object is deleted with glDeleteRenderbuffers
/
glDeleteRenderbuffers
.
GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
glGetIntegerv
/glGetIntegerv
with argument GL_RENDERBUFFER_BINDING
target
- Specifies the target to which the renderbuffer object is bound.
The symbolic constant must be GL_RENDERBUFFER
.renderbuffer
- Specifies the name of a renderbuffer object.GL20.glDeleteRenderbuffers(int, IntBuffer)
,
GL20.glDeleteRenderbuffers(int, int[], int)
,
GL20.glFramebufferRenderbuffer(int, int, int, int)
,
GL20.glGenRenderbuffers(int, IntBuffer)
,
GL20.glGenRenderbuffers(int, int[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
,
GL20.glGetRenderbufferParameteriv(int, int, IntBuffer)
,
GL20.glGetRenderbufferParameteriv(int, int, int[], int)
,
GL20.glIsRenderbuffer(int)
,
GL20.glRenderbufferStorage(int, int, int, int)
void glBindTexture(int target, int texture)
glBindTexture
lets you create or use a named texture.
Calling glBindTexture
with target
set to
GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
and texture
set to the name
of the new texture binds the texture name to the target.
When a texture is bound to a target, the previous binding
for that target is automatically broken.
Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names and the corresponding texture contents are local to the shared object space of the current GL rendering context.
You may use glGenTextures
/
glGenTextures
to generate a set of new texture names.
When a texture is first bound, it assumes the specified target:
A texture first bound to GL_TEXTURE_2D
becomes a two-dimensional
texture and a texture first bound to GL_TEXTURE_CUBE_MAP
becomes
a cube-mapped texture. The state of a two-dimensional texture
immediately after it is first bound is equivalent to the state of
the default GL_TEXTURE_2D
at GL initialization, and similarly for
cube-mapped textures.
While a texture is bound, GL operations on the target to which it is bound affect the bound texture, and queries of the target to which it is bound return state from the bound texture. If texture mapping is active on the target to which a texture is bound, the bound texture is used. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name zero refers to the default textures that were bound to them at initialization.
A texture binding created with glBindTexture
remains active
until a different texture is bound to the same target, or
until the bound texture is deleted with glDeleteTextures
/
glDeleteTextures
.
Once created, a named texture may be re-bound to its same
original target as often as needed. It is usually much
faster to use glBindTexture
to bind an existing named
texture to one of the texture targets than it is to
reload the texture image using
glTexImage2D
.
GL_INVALID_ENUM
is generated if target
is not one
of the allowable values.
GL_INVALID_OPERATION
is generated if texture
was
previously created with a target that doesn't match that of target
.
glGetIntegerv
/glGetIntegerv
with argument GL_TEXTURE_BINDING_2D
target
- Specifies the target of the active texture unit to which the texture is bound.
Must be either GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.texture
- Specifies the name of a texture.GL20.glDeleteTextures(int, IntBuffer)
,
GL20.glDeleteTextures(int, int[], int)
,
GL20.glGenTextures(int, IntBuffer)
,
GL20.glGenTextures(int, int[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
,
GL20.glGetTexParameterfv(int, int, FloatBuffer)
,
GL20.glGetTexParameterfv(int, int, float[], int)
,
GL20.glGetTexParameteriv(int, int, IntBuffer)
,
GL20.glGetTexParameteriv(int, int, int[], int)
,
GL20.glIsTexture(int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glBlendColor(float red, float green, float blue, float alpha)
The GL_BLEND_COLOR
may be used to calculate the source and destination
blending factors. The color components are clamped to the range [0, 1]
before being stored. See glBlendFunc
for a complete description of
the blending operations. Initially the GL_BLEND_COLOR
is set
to (0, 0, 0, 0).
glGetIntegerv
/
glGetIntegerv
with an argument of GL_BLEND_COLOR
red
- Specifies the red component of GL_BLEND_COLOR
.green
- Specifies the green component of GL_BLEND_COLOR
.blue
- Specifies the blue component of GL_BLEND_COLOR
.alpha
- Specifies the alpha component of GL_BLEND_COLOR
.GL20.glBlendEquation(int)
,
GL20.glBlendFunc(int, int)
,
GL20.glGetString(int)
void glBlendEquation(int mode)
These equations use the source and destination blend factors
specified by either glBlendFunc
or
glBlendFuncSeparate
.
See glBlendFunc
or
glBlendFuncSeparate
for a description of the various blend factors.
In the equations that follow, source and destination color
components are referred to as (Rs, Gs, Bs, As)
and (Rd, Gd, Bd, Ad)
,
respectively. The result color is referred to as (Rr, Gr, Br, Ar)
.
The source and destination blend factors are
denoted (sR, sG, sB, sA)
and (dR, dG, dB, dA)
, respectively.
For these equations all color components are understood
to have values in the range [0, 1]
.
Mode | RGB Components | Alpha Component |
GL_FUNC_ADD |
Rr = Rs*sR + Rd*dR Gr = Gs*sG + Gd*dG Br = Bs*sB + Bd*dB |
Ar = As*sA + Ad*dA |
GL_FUNC_SUBTRACT |
Rr = Rs*sR - Rd*dR Gr = Gs*sG - Gd*dG Br = Bs*sB - Bd*dB |
Ar = As*sA - Ad*dA |
GL_FUNC_REVERSE_SUBTRACT |
Rr = Rd*dR - Rs*sR Gr = Gd*dG - Gs*sG Br = Bd*dB - Bs*sB |
Ar = Ad*dA - As*sA |
The results of these equations are clamped to the range [0, 1]
.
The GL_FUNC_ADD
equation is useful for antialiasing and transparency, among other things.
Initially, both the RGB blend equation and the alpha blend equation are set to GL_FUNC_ADD
.
GL_INVALID_ENUM
is generated if mode
is not one of
GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or GL_FUNC_REVERSE_SUBTRACT
.
glGetIntegerv
/glGetIntegerv
with an argument of GL_BLEND_EQUATION_RGB
glGetIntegerv
/glGetIntegerv
with an argument of GL_BLEND_EQUATION_ALPHA
mode
- Specifies how source and destination colors are combined.
It must be GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or GL_FUNC_REVERSE_SUBTRACT
.GL20.glGetString(int)
,
GL20.glBlendColor(float, float, float, float)
,
GL20.glBlendEquationSeparate(int, int)
,
GL20.glBlendFunc(int, int)
,
GL20.glBlendFuncSeparate(int, int, int, int)
void glBlendEquationSeparate(int modeRGB, int modeAlpha)
The blend equations use the source and destination blend factors specified
by either glBlendFunc
or
glBlendFuncSeparate
.
See glBlendFunc
or
glBlendFuncSeparate
for a description of the various blend factors.
In the equations that follow, source and destination color components
are referred to as (Rs, Gs, Bs, As)
and (Rd, Gd, Bd, Ad)
, respectively.
The result color is referred to as (Rr, Gr, Br, Ar)
. The source and destination
blend factors are denoted (sR, sG, sB, sA)
and (dR, dG, dB, dA)
, respectively.
For these equations all color components are understood to have values in the range [0, 1]
.
Mode | RGB Components | Alpha Component |
GL_FUNC_ADD |
Rr = Rs*sR + Rd*dR Gr = Gs*sG + Gd*dG Br = Bs*sB + Bd*dB |
Ar = As*sA + Ad*dA |
GL_FUNC_SUBTRACT |
Rr = Rs*sR - Rd*dR Gr = Gs*sG - Gd*dG Br = Bs*sB - Bd*dB |
Ar = As*sA - Ad*dA |
GL_FUNC_REVERSE_SUBTRACT |
Rr = Rd*dR - Rs*sR Gr = Gd*dG - Gs*sG Br = Bd*dB - Bs*sB |
Ar = Ad*dA - As*sA |
The results of these equations are clamped to the range [0, 1]
.
The GL_FUNC_ADD
equation is useful for antialiasing and transparency, among other things.
Initially, both the RGB blend equation and the alpha blend equation are set to GL_FUNC_ADD
.
GL_INVALID_ENUM
is generated if either modeRGB
or
modeAlpha
is not one of GL_FUNC_ADD
, GL_FUNC_SUBTRACT
,
or GL_FUNC_REVERSE_SUBTRACT
.
glGetIntegerv
/glGetIntegerv
with an argument of GL_BLEND_EQUATION_RGB
glGetIntegerv
/glGetIntegerv
with an argument of GL_BLEND_EQUATION_ALPHA
modeRGB
- Specifies the RGB blend equation, how the red, green, and blue components of
the source and destination colors are combined. It must be GL_FUNC_ADD
,
GL_FUNC_SUBTRACT
, or GL_FUNC_REVERSE_SUBTRACT
.modeAlpha
- Specifies the alpha blend equation, how the alpha component of
the source and destination colors are combined. It must be GL_FUNC_ADD
,
GL_FUNC_SUBTRACT
, or GL_FUNC_REVERSE_SUBTRACT
.GL20.glGetString(int)
,
GL20.glBlendColor(float, float, float, float)
,
GL20.glBlendEquation(int)
,
GL20.glBlendFunc(int, int)
,
GL20.glBlendFuncSeparate(int, int, int, int)
void glBlendFunc(int sfactor, int dfactor)
glEnable
and
glDisable
with argument GL_BLEND
to
enable and disable blending.
glBlendFunc
defines the operation of blending when it is enabled.
sfactor
specifies which method is used to scale the
source color components. dfactor
specifies
which method is used to scale the destination color components.
The possible methods are described in the following table. Each method defines
four scale factors, one each for red, green, blue, and alpha. In the
table and in subsequent equations, source and destination color components
are referred to as (Rs, Gs, Bs, As)
and (Rd, Gd, Bd, Ad)
.
The color specified by glBlendColor
is referred to as (Rc, Gc, Bc, Ac)
.
They are understood to have integer values between 0 and (kR, kG, kB, kA)
,
where
kc = 2^mc - 1
and (mR, mG, mB, mA)
is the number of
red, green, blue, and alpha bitplanes.
Source and destination scale factors are referred to as (sR, sG, sB, sA)
and (dR, dG, dB, dA)
.
The scale factors described in the table, denoted (fR, fG, fB, fA)
, represent either
source or destination factors. All scale factors have range [0, 1]
.
Parameter | (fR, fG, fB, fA) |
GL_ZERO | (0, 0, 0, 0) |
GL_ONE | (1, 1, 1, 1) |
GL_SRC_COLOR | (Rs/kR, Gs/kG, Bs/kB, As/kA) |
GL_ONE_MINUS_SRC_COLOR | (1, 1, 1, 1) - (Rs/kR, Gs/kG, Bs/kB, As/kA) |
GL_DST_COLOR | (Rd/kR, Gd/kG, Bd/kB, Ad/kA) |
GL_ONE_MINUS_DST_COLOR | (1, 1, 1, 1) - (Rd/kR, Gd/kG, Bd/kB, Ad/kA) |
GL_SRC_ALPHA | (As/kA, As/kA, As/kA, As/kA) |
GL_ONE_MINUS_SRC_ALPHA | (1, 1, 1, 1) - (As/kA, As/kA, As/kA, As/kA) |
GL_DST_ALPHA | (Ad/kA, Ad/kA, Ad/kA, Ad/kA) |
GL_ONE_MINUS_DST_ALPHA | (1, 1, 1, 1) - (Ad/kA, Ad/kA, Ad/kA, Ad/kA) |
GL_CONSTANT_COLOR | (Rc, Gc, Bc, Ac) |
GL_ONE_MINUS_CONSTANT_COLOR | (1, 1, 1, 1) - (Rc, Gc, Bc, Ac) |
GL_CONSTANT_ALPHA | (Ac, Ac, Ac, Ac) |
GL_ONE_MINUS_CONSTANT_ALPHA | (1, 1, 1, 1) - (Ac, Ac, Ac, Ac) |
GL_SRC_ALPHA_SATURATE | (i, i, i, 1) |
In the table,
i = min(As, kA - Ad) / kA
.
To determine the blended RGBA values of a pixel, the system uses one of the
equations set by glBlendEquation
or
glBlendEquationSeparate
.
Blending arithmetic is not exactly specified, because blending operates with imprecise integer color values. However, a blend factor that should be equal to 1 is guaranteed not to modify its multiplicand, and a blend factor equal to 0 reduces its multiplicand to 0.
Incoming (source) alpha is correctly thought of as a material opacity, ranging
from 1.0 (KA)
, representing complete opacity, to 0.0 (0)
, representing
complete transparency.
Transparency is best implemented using blend function (GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
)
with primitives sorted from farthest to nearest. Note that this transparency calculation does
not require the presence of alpha bitplanes in the frame buffer.
GL_INVALID_ENUM
is generated if either sfactor
or
dfactor
is not an accepted value.
glGetIntegerv
/glGetIntegerv
with argument GL_BLEND_SRC_RGB
or GL_BLEND_SRC_ALPHA
glGetIntegerv
/glGetIntegerv
with argument GL_BLEND_DST_RGB
or GL_BLEND_DST_ALPHA
glIsEnabled
with argument GL_BLEND
sfactor
- Specifies how the red, green, blue, and alpha source blending factors are computed.
The following symbolic constants are accepted: GL_ZERO
, GL_ONE
,
GL_SRC_COLOR
, GL_ONE_MINUS_SRC_COLOR
,
GL_DST_COLOR
, GL_ONE_MINUS_DST_COLOR
,
GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
,
GL_DST_ALPHA
, GL_ONE_MINUS_DST_ALPHA
,
GL_CONSTANT_COLOR
, GL_ONE_MINUS_CONSTANT_COLOR
,
GL_CONSTANT_ALPHA
, GL_ONE_MINUS_CONSTANT_ALPHA
, and GL_SRC_ALPHA_SATURATE
.
The initial value is GL_ONE
.dfactor
- Specifies how the red, green, blue, and alpha destination blending factors are computed.
The following symbolic constants are accepted: GL_ZERO
, GL_ONE
,
GL_SRC_COLOR
, GL_ONE_MINUS_SRC_COLOR
,
GL_DST_COLOR
, GL_ONE_MINUS_DST_COLOR
,
GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
,
GL_DST_ALPHA
, GL_ONE_MINUS_DST_ALPHA
,
GL_CONSTANT_COLOR
, GL_ONE_MINUS_CONSTANT_COLOR
,
GL_CONSTANT_ALPHA
, and GL_ONE_MINUS_CONSTANT_ALPHA
.
The initial value is GL_ZERO
.GL20.glBlendColor(float, float, float, float)
,
GL20.glBlendEquation(int)
,
GL20.glBlendEquationSeparate(int, int)
,
GL20.glBlendFuncSeparate(int, int, int, int)
,
GL20.glClear(int)
,
GL20.glEnable(int)
,
GL20.glStencilFunc(int, int, int)
void glBlendFuncSeparate(int srcRGB, int dstRGB, int srcAlpha, int dstAlpha)
glEnable
and
glDisable
with argument GL_BLEND
to enable and disable blending.
glBlendFuncSeparate
defines the operation of blending when it is enabled.
srcRGB
specifies which method is used to scale the source RGB-color components.
dstRGB
specifies which method is used to scale the destination RGB-color components.
Likewise, srcAlpha
specifies which method is used to scale the source alpha color component,
and dstAlpha
specifies which method is used to scale the destination alpha component.
The possible methods are described in the following table. Each method defines
four scale factors, one each for red, green, blue, and alpha.
In the table and in subsequent equations, source and destination color components
are referred to as (Rs, Gs, Bs, As)
and (Rd, Gd, Bd, Ad)
.
The color specified by glBlendColor
is referred to as (Rc, Gc, Bc, Ac)
.
They are understood to have integer values between 0 and (kR, kG, kB, kA)
,
where
kc = 2^mc - 1
and (mR, mG, mB, mA)
is the number of
red, green, blue, and alpha bitplanes.
Source and destination scale factors are referred to as (sR, sG, sB, sA)
and (dR, dG, dB, dA)
. All scale factors have range [0, 1]
.
Parameter | RGB Factor | Alpha Factor |
GL_ZERO |
(0, 0, 0) |
0 |
GL_ONE |
(1, 1, 1) |
1 |
GL_SRC_COLOR |
(Rs/kR, Gs/kG, Bs/kB) |
As/kA |
GL_ONE_MINUS_SRC_COLOR |
(1, 1, 1) - (Rs/kR, Gs/kG, Bs/kB) |
1 - As/kA |
GL_DST_COLOR |
(Rd/kR, Gd/kG, Bd/kB) |
Ad/kA |
GL_ONE_MINUS_DST_COLOR |
(1, 1, 1) - (Rd/kR, Gd/kG, Bd/kB) |
1 - Ad/kA |
GL_SRC_ALPHA |
(As/kA, As/kA, As/kA) |
As/kA |
GL_ONE_MINUS_SRC_ALPHA |
(1, 1, 1) - (As/kA, As/kA, As/kA) |
1 - As/kA |
GL_DST_ALPHA |
(Ad/kA, Ad/kA, Ad/kA) |
Ad/kA |
GL_ONE_MINUS_DST_ALPHA |
(1, 1, 1) - (Ad/kA, Ad/kA, Ad/kA) |
1 - Ad/kA |
GL_CONSTANT_COLOR |
(Rc, Gc, Bc) |
Ac |
GL_ONE_MINUS_CONSTANT_COLOR |
(1, 1, 1) - (Rc, Gc, Bc) |
1 - Ac |
GL_CONSTANT_ALPHA |
(Ac, Ac, Ac) |
Ac |
GL_ONE_MINUS_CONSTANT_ALPHA |
(1, 1, 1) - (Ac, Ac, Ac) |
1 - Ac |
GL_SRC_ALPHA_SATURATE |
(i, i, i) |
1 |
In the table,
i = min(As, kA - Ad) / kA
.
To determine the blended RGBA values of a pixel, the system uses one of the
equations set by glBlendEquation
or
glBlendEquationSeparate
.
Despite the apparent precision of the above equations, blending arithmetic is not exactly specified, because blending operates with imprecise integer color values. However, a blend factor that should be equal to 1 is guaranteed not to modify its multiplicand, and a blend factor equal to 0 reduces its multiplicand to 0.
Incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 (KA)
,
representing complete opacity, to 0.0 (0)
, representing complete transparency.
GL_INVALID_ENUM
is generated if srcRGB
, dstRGB
,
srcAlpha
, or dstAlpha
is not an accepted value.
glGetIntegerv
/glGetIntegerv
with argument GL_BLEND_SRC_RGB
glGetIntegerv
/glGetIntegerv
with argument GL_BLEND_SRC_ALPHA
glGetIntegerv
/glGetIntegerv
with argument GL_BLEND_DST_RGB
glGetIntegerv
/glGetIntegerv
with argument GL_BLEND_DST_ALPHA
glIsEnabled
with argument GL_BLEND
srcRGB
- Specifies how the red, green, and blue source blending factors are computed.
The following symbolic constants are accepted: GL_ZERO
, GL_ONE
,
GL_SRC_COLOR
, GL_ONE_MINUS_SRC_COLOR
,
GL_DST_COLOR
, GL_ONE_MINUS_DST_COLOR
,
GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
,
GL_DST_ALPHA
, GL_ONE_MINUS_DST_ALPHA
,
GL_CONSTANT_COLOR
, GL_ONE_MINUS_CONSTANT_COLOR
,
GL_CONSTANT_ALPHA
, GL_ONE_MINUS_CONSTANT_ALPHA
, and GL_SRC_ALPHA_SATURATE
.
The initial value is GL_ONE
.dstRGB
- Specifies how the red, green, and blue destination blending factors are computed.
The following symbolic constants are accepted: GL_ZERO
, GL_ONE
,
GL_SRC_COLOR
, GL_ONE_MINUS_SRC_COLOR
,
GL_DST_COLOR
, GL_ONE_MINUS_DST_COLOR
,
GL_SRC_ALPHA
, GL_ONE_MINUS_SRC_ALPHA
,
GL_DST_ALPHA
, GL_ONE_MINUS_DST_ALPHA
,
GL_CONSTANT_COLOR
, GL_ONE_MINUS_CONSTANT_COLOR
,
GL_CONSTANT_ALPHA
, and GL_ONE_MINUS_CONSTANT_ALPHA
.
The initial value is GL_ZERO
.srcAlpha
- Specifies how the alpha source blending factor is computed.
The same symbolic constants are accepted as for srcRGB
. The initial value is GL_ONE
.dstAlpha
- Specifies how the alpha destination blending factor is computed.
The same symbolic constants are accepted as for dstRGB
. The initial value is GL_ZERO
.GL20.glBlendColor(float, float, float, float)
,
GL20.glBlendEquation(int)
,
GL20.glBlendEquationSeparate(int, int)
,
GL20.glBlendFunc(int, int)
,
GL20.glClear(int)
,
GL20.glEnable(int)
,
GL20.glStencilFunc(int, int, int)
void glBufferData(int target, int size, Buffer data, int usage)
glBufferData
creates a new data store for the buffer object
currently bound to target
.
Any pre-existing data store is deleted. The new data store is created with the specified
size
in bytes and usage. If data
is not
null
, the data store is initialized with data from this buffer.
usage
is a hint to the GL implementation as to how a buffer object's data store
will be accessed. This enables the GL implementation to make more intelligent decisions
that may significantly impact buffer object performance. It does not, however,
constrain the actual usage of the data store. usage
can be broken
down into two parts: first, the frequency of access (modification and usage),
and second, the nature of that access. The frequency of access may be one of these:
STREAM
The data store contents will be modified once and used at most a few times.
STATIC
The data store contents will be modified once and used many times.
DYNAMIC
The data store contents will be modified repeatedly and used many times.
The nature of access must be:
DRAW
The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
If data
is null
, a data store of the specified size is still created,
but its contents remain uninitialized and thus undefined.
Clients must align data elements consistent with the requirements of the client platform, with an additional base-level requirement that an offset within a buffer to a datum comprising N be a multiple of N.
GL_INVALID_ENUM
is generated if target
is not
GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.
GL_INVALID_ENUM
is generated if usage
is not
GL_STREAM_DRAW
, GL_STATIC_DRAW
, or GL_DYNAMIC_DRAW
.
GL_INVALID_VALUE
is generated if size
is negative.
GL_INVALID_OPERATION
is generated if the reserved buffer object
name 0 is bound to target
.
GL_OUT_OF_MEMORY
is generated if the GL is unable to create a data store
with the specified size
.
glGetBufferParameteriv
/
glGetBufferParameteriv
with argument GL_BUFFER_SIZE
or GL_BUFFER_USAGE
target
- Specifies the target buffer object. The symbolic constant
must be GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.size
- Specifies the size in bytes of the buffer object's new data store.data
- Specifies the data that will be copied into the data store
for initialization, or null
if no data is to be copied.usage
- Specifies the expected usage pattern of the data store.
The symbolic constant must be GL_STREAM_DRAW
,
GL_STATIC_DRAW
, or GL_DYNAMIC_DRAW
.
IllegalArgumentException
- If data.remaining()
is less than
size
.GL20.glBindBuffer(int, int)
,
GL20.glBufferSubData(int, int, int, Buffer)
void glBufferSubData(int target, int offset, int size, Buffer data)
glBufferSubData
redefines some or all of the data store for the buffer
object currently bound to target
. Data starting at byte offset offset
and extending for size
bytes is copied to the data store from the data buffer
data
. An error is thrown if offset
and
size
together define
a range beyond the bounds of the buffer object's data store.
When replacing the entire data store, consider using glBufferSubData
rather
than completely recreating the data store with glBufferData
. This avoids the
cost of reallocating the data store.
Consider using multiple buffer objects to avoid stalling the rendering pipeline
during data store updates. If any rendering in the pipeline makes reference
to data in the buffer object being updated by glBufferSubData
, especially
from the specific region being updated, that rendering must drain from the
pipeline before the data store can be updated.
Clients must align data elements consistent with the requirements of the client platform, with an additional base-level requirement that an offset within a buffer to a datum comprising N be a multiple of N.
GL_INVALID_ENUM
if target
is not GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.
GL_INVALID_VALUE
is generated if offset
or
size
is negative, or if together
they define a region of memory that extends beyond the buffer object's allocated data store.
GL_INVALID_OPERATION
is generated if the reserved buffer object name 0 is
bound to target
.
target
- Specifies the target buffer object. The symbolic constant must be
GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.offset
- Specifies the offset into the buffer object's data store where
data replacement will begin, measured in bytes.size
- Specifies the size in bytes of the data store region being replaced.data
- Specifies the new data that will be copied into the data store.
IllegalArgumentException
- If data
is null
.
IllegalArgumentException
- If data.remaining()
is less than size
.GL20.glBindBuffer(int, int)
,
GL20.glBufferData(int, int, Buffer, int)
int glCheckFramebufferStatus(int target)
glCheckFramebufferStatus
returns a symbolic constant that
identifies whether or not the currently bound framebuffer is framebuffer complete,
and if not, which of the rules of framebuffer completeness is violated.
If the framebuffer is complete, then GL_FRAMEBUFFER_COMPLETE
is returned.
If the framebuffer is not complete, the return values are as follows:
GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
Not all framebuffer attachment points are framebuffer attachment complete. This means that at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached.
Color-renderable formats include GL_RGBA4
, GL_RGB5_A1
, and GL_RGB565
.
GL_DEPTH_COMPONENT16
is the only depth-renderable format. GL_STENCIL_INDEX8
is the only stencil-renderable format.
GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
Not all attached images have the same width and height.
GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
No images are attached to the framebuffer.
GL_FRAMEBUFFER_UNSUPPORTED
The combination of internal formats of the attached images violates an implementation-dependent set of restrictions.
If the currently bound framebuffer is not framebuffer complete,
then it is an error to attempt to use the framebuffer for writing or reading.
This means that rendering commands (glDrawArrays
and glDrawElements
/
glDrawElements
) as well as
commands that read the framebuffer (glReadPixels
,
glCopyTexImage2D
, and
glCopyTexSubImage2D
)
will generate the error GL_INVALID_FRAMEBUFFER_OPERATION
if called while the framebuffer
is not framebuffer complete.
It is strongly advised, thought not required, that an application call
glCheckFramebufferStatus
to see if the framebuffer is complete prior to rendering.
This is because some implementations may not support rendering to particular combinations of
internal formats. In this case, GL_FRAMEBUFFER_UNSUPPORTED
is returned.
The default window-system-provided framebuffer is always framebuffer complete,
and thus GL_FRAMEBUFFER_COMPLETE
is returned when GL_FRAMEBUFFER_BINDING
is 0.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
target
- Specifies the target framebuffer object.
The symbolic constant must be GL_FRAMEBUFFER
.
GL20.glBindRenderbuffer(int, int)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glCopyTexSubImage2D(int, int, int, int, int, int, int, int)
,
GL20.glDrawArrays(int, int, int)
,
GL20.glDrawElements(int, int, int, Buffer)
,
GL20.glDrawElements(int, int, int, int)
,
GL20.glReadPixels(int, int, int, int, int, int, Buffer)
,
GL20.glRenderbufferStorage(int, int, int, int)
void glClear(int mask)
glClear
sets the bitplane area of the window to values
previously selected by glClearColor
,
glClearDepthf
, and glClearStencil
.
The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect
the operation of glClear
. The scissor box bounds the cleared region. Blend function,
stenciling, fragment shading, and depth-buffering are ignored by glClear
.
glClear
takes a single argument that is the bitwise OR of
several values indicating which buffer is to be cleared.
The values are as follows:
GL_COLOR_BUFFER_BIT
Indicates the buffers currently enabled for color writing.
GL_DEPTH_BUFFER_BIT
Indicates the depth buffer.
GL_STENCIL_BUFFER_BIT
Indicates the stencil buffer.
The value to which each buffer is cleared depends on the setting of the clear value for that buffer.
If a buffer is not present, then a glClear
directed at that buffer has no effect.
GL_INVALID_VALUE
is generated if any bit other than the
three defined bits is set in mask
.
glGetIntegerv
/glGetIntegerv
with argument GL_DEPTH_CLEAR_VALUE
glGetIntegerv
/glGetIntegerv
with argument GL_COLOR_CLEAR_VALUE
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_CLEAR_VALUE
mask
- Bitwise OR of masks that indicate the buffers to be cleared.
The three masks are GL_COLOR_BUFFER_BIT
, GL_DEPTH_BUFFER_BIT
,
and GL_STENCIL_BUFFER_BIT
.GL20.glClearColor(float, float, float, float)
,
GL20.glClearDepthf(float)
,
GL20.glClearStencil(int)
,
GL20.glColorMask(boolean, boolean, boolean, boolean)
,
GL20.glDepthMask(boolean)
,
GL20.glScissor(int, int, int, int)
,
GL20.glStencilMask(int)
void glClearColor(float red, float green, float blue, float alpha)
glClearColor
specifies the red, green, blue, and
alpha values used by glClear
to clear the color buffers.
Values specified by glClearColor
are clamped to the range [0, 1]
.
glGetIntegerv
/glGetIntegerv
with argument GL_COLOR_CLEAR_VALUE
red
- Specifies the red value used when the color buffers are cleared.
The initial value is 0.green
- Specifies the green value used when the color buffers are cleared.
The initial value is 0.blue
- Specifies the blue value used when the color buffers are cleared.
The initial value is 0.alpha
- Specifies the alpha value used when the color buffers are cleared.
The initial value is 0.GL20.glClear(int)
void glClearDepthf(float depth)
glClearDepthf
specifies the depth value used by glClear
to clear the depth buffer. Values specified by glClearDepthf
are
clamped to the range [0, 1]
.
glGetIntegerv
/glGetIntegerv
with argument GL_DEPTH_CLEAR_VALUE
depth
- Specifies the depth value used when the depth buffer is cleared.
The initial value is 1.GL20.glClear(int)
void glClearStencil(int s)
glClearStencil
specifies the index used by glClear
to clear the stencil buffer. s
is masked with 2^m - 1
,
where m
is the number of bits in the stencil buffer.
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_CLEAR_VALUE
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_BITS
s
- Specifies the index used when the stencil buffer is cleared.
The initial value is 0.GL20.glClear(int)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilFuncSeparate(int, int, int, int)
,
GL20.glStencilMask(int)
,
GL20.glStencilMaskSeparate(int, int)
,
GL20.glStencilOp(int, int, int)
,
GL20.glStencilOpSeparate(int, int, int, int)
void glColorMask(boolean red, boolean green, boolean blue, boolean alpha)
glColorMask
specifies whether the individual color
components in the frame buffer can or cannot be written.
If red
is GL_FALSE
, for example, no change is made to the red component
of any pixel in any of the color buffers, regardless of the drawing
operation attempted.
Changes to individual bits of components cannot be controlled. Rather, changes are either enabled or disabled for entire color components.
glGetIntegerv
/glGetIntegerv
with argument GL_COLOR_WRITEMASK
red
- Specifies whether red can or cannot be written into the frame buffer.
The initial value is GL_TRUE
, indicating that the color component can be written.green
- Specifies whether green can or cannot be written into the frame buffer.
The initial value is GL_TRUE
, indicating that the color component can be written.blue
- Specifies whether blue can or cannot be written into the frame buffer.
The initial value is GL_TRUE
, indicating that the color component can be written.alpha
- Specifies whether alpha can or cannot be written into the frame buffer.
The initial value is GL_TRUE
, indicating that the color component can be written.GL20.glClear(int)
,
GL20.glDepthMask(boolean)
,
GL20.glStencilMask(int)
void glCompileShader(int shader)
glCompileShader
compiles the source code strings that have been stored in the shader
object specified by shader
.
The compilation status will be stored as part of the shader object's state.
This value will be set to GL_TRUE
if the shader was compiled without errors
and is ready for use, and GL_FALSE
otherwise. It can be queried by calling
glGetShaderiv
/
glGetShaderiv
with arguments shader
and GL_COMPILE_STATUS
.
Compilation of a shader can fail for a number of reasons as
specified by the OpenGL ES Shading Language Specification.
Whether or not the compilation was successful, information
about the compilation can be obtained from the shader object's
information log by calling glGetShaderInfoLog
.
Shader compiler support is optional, and thus must be queried before
use by calling glGetIntegerv
/
glGetIntegerv
with argument GL_SHADER_COMPILER
.
glShaderSource
, glCompileShader
,
glGetShaderPrecisionFormat
,
and glReleaseShaderCompiler
will each generate GL_INVALID_OPERATION
on implementations that do not
support a shader compiler. Such implementations instead offer the
glShaderBinary
/
glShaderBinary
alternative for supplying a pre-compiled shader binary.
GL_INVALID_OPERATION
is generated if a shader compiler is not supported.
GL_INVALID_VALUE
is generated if shader
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if shader
is not a shader object.
glGetIntegerv
/glGetIntegerv
with argument GL_SHADER_COMPILER
glGetShaderInfoLog
with argument shader
glGetShaderiv
/glGetShaderiv
with arguments shader
and GL_COMPILE_STATUS
shader
- Specifies the shader object to be compiled.GL20.glCreateShader(int)
,
GL20.glLinkProgram(int)
,
GL20.glReleaseShaderCompiler()
,
GL20.glShaderSource(int, int, String[], int[])
,
GL20.glGetShaderPrecisionFormat(int, int, int[], int, int[], int)
void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, Buffer data)
glCompressedTexImage2D
defines a two-dimensional texture image or
cube-map texture image using compressed image data from client memory.
The texture image is decoded according to the extension specification
defining the specified internalformat
. OpenGL ES defines no specific
compressed texture formats, but does provide a mechanism to obtain
symbolic constants for such formats provided by extensions. The number of
compressed texture formats supported can be obtained by querying the value
of GL_NUM_COMPRESSED_TEXTURE_FORMATS
. The list of specific compressed
texture formats supported can be obtained by querying the value of
GL_COMPRESSED_TEXTURE_FORMATS
.
A GL implementation may choose to store the texture array at any internal resolution it chooses.
glCompressedTexImage2D
specifies a two-dimensional or cube-map texture for the current
texture unit, specified with glActiveTexture
.
GL_INVALID_ENUM
is generated if target
is not
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
GL_INVALID_ENUM
is generated if internalformat
is not a supported format
returned in GL_COMPRESSED_TEXTURE_FORMATS
.
GL_INVALID_VALUE
is generated if level
is less than 0.
GL_INVALID_VALUE
may be generated if level
is greater than log_2(max)
,
where max
is the returned value of GL_MAX_TEXTURE_SIZE
when target
is
GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if width
or height
is less than 0 or greater than GL_MAX_TEXTURE_SIZE
when target
is
GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if border
is not 0.
GL_INVALID_VALUE
is generated if imageSize
is not consistent with the
format, dimensions, and contents of the specified compressed image data.
GL_INVALID_OPERATION
is generated if parameter combinations are not supported
by the specific compressed internal format as specified in the specific texture compression
extension.
Undefined results, including abnormal program termination,
are generated if data
is not encoded in a manner consistent
with the extension specification defining the internal compression format.
glGetIntegerv
/glGetIntegerv
with arguments GL_NUM_COMPRESSED_TEXTURE_FORMATS
and GL_COMPRESSED_TEXTURE_FORMATS
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_TEXTURE_SIZE
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
target
- Specifies the target texture of the active texture unit. Must be
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.level
- Specifies the level-of-detail number. Level 0 is the base image level.
Level n is the nth mipmap reduction image.internalformat
- Specifies the format of the compressed image data stored at address data
.width
- Specifies the width of the texture image. All implementations
support 2D texture images that are at least 64 texels wide and cube-mapped texture
images that are at least 16 texels wide.height
- Specifies the height of the texture image. All implementations
support 2D texture images that are at least 64 texels high and cube-mapped texture
images that are at least 16 texels high.border
- Specifies the width of the border. Must be 0.imageSize
- Specifies the number of unsigned bytes of image data starting at the address
specified by data
.data
- Specifies the compressed image data as a buffer.
IllegalArgumentException
- If data
is null
.
IllegalArgumentException
- If data.remaining()
is less than
imageSize
.GL20.glActiveTexture(int)
,
GL20.glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glCopyTexSubImage2D(int, int, int, int, int, int, int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data)
glCompressedTexSubImage2D
redefines a contiguous subregion of an existing
two-dimensional texture image. The texels referenced by data
replace the portion
of the existing texture array with x indices xoffset
and xoffset
+ width - 1
, and the y indices yoffset
and yoffset
+ height - 1
, inclusive. This region may not
include any texels outside the range of the texture array as it was originally specified.
It is not an error to specify a subtexture with width of 0, but such a specification
has no effect.
format
must be the same extension-specified compressed-texture format
previously specified by glCompressedTexImage2D
.
glCompressedTexSubImage2D
specifies a two-dimensional or cube-map texture
for the current texture unit, specified with glActiveTexture
.
GL_INVALID_ENUM
is generated if target
is not
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X
, GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
, GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
GL_INVALID_ENUM
is generated if format
is not a
supported format returned in GL_COMPRESSED_TEXTURE_FORMATS
.
GL_INVALID_VALUE
is generated if level
is less than 0.
GL_INVALID_VALUE
may be generated if level
is
greater than log_2(max)
,
where max
is the returned value of GL_MAX_TEXTURE_SIZE
when
target
is GL_TEXTURE_2D
or
GL_MAX_CUBE_MAP_TEXTURE_SIZE
when target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if
xoffset < 0
, xoffset + width > w
,
yoffset < 0
, or yoffset + height > h
,
where w
is the width and h
is the height of the texture image being modified.
GL_INVALID_VALUE
is generated if width
or height
is less than 0.
GL_INVALID_VALUE
is generated if imageSize
is not consistent with the
format, dimensions, and contents of the specified compressed image data.
GL_INVALID_OPERATION
is generated if the texture array has not been
defined by a previous glCompressedTexImage2D
operation whose internalformat
matches
the format
of glCompressedTexSubImage2D
.
GL_INVALID_OPERATION
is generated if parameter combinations are not
supported by the specific compressed internal format as specified in the specific
texture compression extension.
Undefined results, including abnormal program termination, are generated if data
is
not encoded in a manner consistent with the extension specification defining the
internal compression format.
glGetIntegerv
/glGetIntegerv
with arguments GL_NUM_COMPRESSED_TEXTURE_FORMATS
and GL_COMPRESSED_TEXTURE_FORMATS
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_TEXTURE_SIZE
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
target
- Specifies the target texture of the active texture unit. Must be
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.level
- Specifies the level-of-detail number. Level 0 is the base image level.
Level n is the n
th mipmap reduction image.xoffset
- Specifies a texel offset in the x direction within the texture array.yoffset
- Specifies a texel offset in the y direction within the texture array.width
- Specifies the width of the texture subimage.height
- Specifies the height of the texture subimage.format
- Specifies the format of the compressed image data stored in the buffer data
.imageSize
- Specifies the number of unsigned bytes of image data in the buffer data
.data
- Specifies the compressed image data as a buffer.
IllegalArgumentException
- If data
is null
.
IllegalArgumentException
- If data.remaining()
is less than
imageSize
.GL20.glActiveTexture(int)
,
GL20.glCompressedTexImage2D(int, int, int, int, int, int, int, Buffer)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glCopyTexSubImage2D(int, int, int, int, int, int, int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glCopyTexImage2D(int target, int level, int internalformat, int x, int y, int width, int height, int border)
glCopyTexImage2D
defines a two-dimensional texture image or
cube-map texture image with pixels from the current framebuffer
(rather than from client memory, as is the case for
glTexImage2D
).
The screen-aligned pixel rectangle with lower left corner at (x, y
)
and with a width of width
and a height of height
defines the texture
array at the mipmap level specified by level
. internalformat
specifies
the internal format of the texture array.
The pixels in the rectangle are processed exactly as
if glReadPixels
had been called with format
set to GL_RGBA
,
but the process stops just after conversion of RGBA values.
Subsequent processing is identical to that described for
glTexImage2D
,
beginning with the clamping of the R, G, B, and A values to the range [0, 1]
and then conversion to the texture's internal format for storage in the
texel array.
The components required for internalformat
must be a subset of those
present in the framebuffer's format. For example, a GL_RGBA
framebuffer
can be used to supply components for any internalformat
. However,
a GL_RGB
framebuffer can only be used to supply components for
GL_RGB
or GL_LUMINANCE
base internal format textures, not
GL_ALPHA
, GL_LUMINANCE_ALPHA
, or GL_RGBA
textures.
Pixel ordering is such that lower x and y screen coordinates correspond to lower s and t texture coordinates.
If any of the pixels within the specified rectangle are outside the framebuffer associated with the current rendering context, then the values obtained for those pixels are undefined.
A GL implementation may choose to store the texture array at any internal resolution it chooses.
An image with height or width of 0 indicates a null
texture.
glCopyTexImage2D
specifies a two-dimensional or cube-map texture for
the current texture unit, specified with glActiveTexture
.
GL_INVALID_ENUM
is generated if target
is not
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
GL_INVALID_ENUM
is generated if internalformat
is not an accepted format.
GL_INVALID_VALUE
is generated if target
is one of the six cube map 2D
image targets and the width and height parameters are not equal.
GL_INVALID_VALUE
is generated if level
is less than 0.
GL_INVALID_VALUE
may be generated if level
is greater than log_2(max)
,
where max
is the returned value of GL_MAX_TEXTURE_SIZE
when target
is
GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if width
or height
is less than 0 or greater than
GL_MAX_TEXTURE_SIZE
when target
is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when
target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if border
is not 0.
GL_INVALID_OPERATION
is generated if the currently bound framebuffer's format
does not contain a superset of the components required by the base format of internalformat
.
GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer
is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus
is not GL_FRAMEBUFFER_COMPLETE
).
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_TEXTURE_SIZE
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
target
- Specifies the target texture. Must be
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.level
- Specifies the level-of-detail number. Level 0 is the base image level.
Level n is the nth mipmap reduction image.internalformat
- Specifies the internal format of the texture.
Must be one of the following symbolic constants:
GL_ALPHA
, GL_LUMINANCE
, GL_LUMINANCE_ALPHA
, GL_RGB
, or GL_RGBA
.x
- Specifies the x window coordinate of the lower left corner
of the rectangular region of pixels to be copied.y
- Specifies the y window coordinate of the lower left corner
of the rectangular region of pixels to be copied.width
- Specifies the width of the texture image.
All implementations support 2D texture images that are at
least 64 texels wide and cube-mapped texture images that
are at least 16 texels wide.height
- Specifies the height of the texture image.
All implementations support 2D texture images that are at
least 64 texels high and cube-mapped texture images that
are at least 16 texels high.border
- Specifies the width of the border. Must be 0.GL20.glActiveTexture(int)
,
GL20.glCheckFramebufferStatus(int)
,
GL20.glCompressedTexImage2D(int, int, int, int, int, int, int, Buffer)
,
GL20.glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glCopyTexSubImage2D(int, int, int, int, int, int, int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
,
GL20.glTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
void glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height)
glCopyTexSubImage2D
replaces a rectangular portion of a
two-dimensional texture image or cube-map texture image
with pixels from the current framebuffer (rather than from
client memory, as is the case for
glTexSubImage2D
).
The screen-aligned pixel rectangle with lower left corner
at (x, y
) and with width width
and height height
replaces the
portion of the texture array with x indices xoffset
through xoffset + width - 1
, inclusive, and y indices yoffset
through yoffset + height - 1
, inclusive, at the mipmap level
specified by level
.
The pixels in the rectangle are processed exactly as
if glReadPixels
had been called with format set to GL_RGBA
,
but the process stops just after conversion of RGBA values.
Subsequent processing is identical to that described
for glTexSubImage2D
,
beginning with the clamping of the R, G, B, and A values to the range [0, 1]
and then conversion
to the texture's internal format for storage in the texel array.
The destination rectangle in the texture array may not include any texels outside the texture array as it was originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification has no effect.
If any of the pixels within the specified rectangle are outside the framebuffer associated with the current rendering context, then the values obtained for those pixels are undefined.
No change is made to the internalformat, width, or height parameters of the specified texture array or to texel values outside the specified subregion.
glCopyTexSubImage2D
specifies the two-dimensional or cube-map
texture for the current texture unit, specified with glActiveTexture
.
GL_INVALID_ENUM
is generated if target
is not
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
GL_INVALID_VALUE
is generated if level
is less than 0.
GL_INVALID_VALUE
may be generated if level > log_2(max)
,
where max
is the returned value of GL_MAX_TEXTURE_SIZE
.
GL_INVALID_VALUE
is generated if
xoffset < 0
, xoffset + width > w
, yoffset < 0
,
or yoffset + height > h
, where w
is the width and h
is the height of the texture image being modified.
GL_INVALID_VALUE
is generated if width
or height
is less than 0.
GL_INVALID_OPERATION
is generated if the texture array has not been
defined by a previous glTexImage2D
or glCopyTexImage2D
operation.
GL_INVALID_OPERATION
is generated if the currently bound
framebuffer's format does not contain a superset of the components
required by the texture's base internal format.
GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound
framebuffer is not framebuffer complete (i.e. the return value from
glCheckFramebufferStatus
is not GL_FRAMEBUFFER_COMPLETE
).
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_TEXTURE_SIZE
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
target
- Specifies the target texture. Must be
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X
, GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
, GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.level
- Specifies the level-of-detail number.
Level 0 is the base image level. Level n is the nth mipmap reduction image.xoffset
- Specifies a texel offset in the x direction within the texture array.yoffset
- Specifies a texel offset in the y direction within the texture array.x
- Specifies the x window coordinate of the lower left corner of the rectangular region of pixels to be copied.y
- Specifies the y window coordinate of the lower left corner of the rectangular region of pixels to be copied.width
- Specifies the width of the texture subimage.height
- Specifies the height of the texture subimage.GL20.glActiveTexture(int)
,
GL20.glCheckFramebufferStatus(int)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
,
GL20.glTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
int glCreateProgram()
glCreateProgram
creates an empty program object and returns a
non-zero value by which it can be referenced. A program object is an object
to which shader objects can be attached. This provides a mechanism to specify
the shader objects that will be linked to create a program.
It also provides a means for checking the compatibility of the shaders
that will be used to create a program (for instance, checking the compatibility
between a vertex shader and a fragment shader). When no longer needed as
part of a program object, shader objects can be detached.
One or more executables are created in a program object by successfully
attaching shader objects to it with glAttachShader
, successfully compiling
the shader objects with glCompileShader
, and successfully linking the program
object with glLinkProgram
. These executables are made part of current state
when glUseProgram
is called. Program objects can be deleted by
calling glDeleteProgram
. The memory associated with the program object
will be deleted when it is no longer part of current rendering state for any context.
Like texture objects, the name space for program objects may be shared across a set of contexts, as long as the server sides of the contexts share the same address space. If the name space is shared across contexts, any attached objects and the data associated with those attached objects are shared as well.
Applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads.
This function returns 0 if an error occurs creating the program object.
glGetIntegerv
/glGetIntegerv
with
the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
with a valid program object and the index of an active attribute variable
glGetActiveUniform
with a valid program object and the index of an active uniform variable
glGetAttachedShaders
/
glGetAttachedShaders
with a valid program object
glGetAttribLocation
with a valid program object and the name of an attribute variable
glGetProgramiv
/
glGetProgramiv
with a valid program object and the parameter to be queried
glGetProgramInfoLog
with a valid program object
glGetUniform
/
glGetUniform
/
glGetUniform
/
glGetUniform
with a valid program object and the location of a uniform variable
glGetUniformLocation
with a valid program object and the name of a uniform variable
GL20.glAttachShader(int, int)
,
GL20.glBindAttribLocation(int, int, String)
,
GL20.glCreateShader(int)
,
GL20.glDeleteProgram(int)
,
GL20.glDetachShader(int, int)
,
GL20.glLinkProgram(int)
,
GL20.glUniform1f(int, float)
,
GL20.glUniform1fv(int, int, FloatBuffer)
,
GL20.glUniform1fv(int, int, float[], int)
,
GL20.glUniform1i(int, int)
,
GL20.glUniform1iv(int, int, IntBuffer)
,
GL20.glUniform1iv(int, int, int[], int)
,
GL20.glUniform2f(int, float, float)
,
GL20.glUniform2fv(int, int, FloatBuffer)
,
GL20.glUniform2fv(int, int, float[], int)
,
GL20.glUniform2i(int, int, int)
,
GL20.glUniform2iv(int, int, IntBuffer)
,
GL20.glUniform2iv(int, int, int[], int)
,
GL20.glUniform3f(int, float, float, float)
,
GL20.glUniform3fv(int, int, FloatBuffer)
,
GL20.glUniform3fv(int, int, float[], int)
,
GL20.glUniform3i(int, int, int, int)
,
GL20.glUniform3iv(int, int, IntBuffer)
,
GL20.glUniform3iv(int, int, int[], int)
,
GL20.glUniform4f(int, float, float, float, float)
,
GL20.glUniform4fv(int, int, FloatBuffer)
,
GL20.glUniform4fv(int, int, float[], int)
,
GL20.glUniform4i(int, int, int, int, int)
,
GL20.glUniform4iv(int, int, IntBuffer)
,
GL20.glUniform4iv(int, int, int[], int)
,
GL20.glUniformMatrix2fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix2fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix3fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix3fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix4fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix4fv(int, int, boolean, float[], int)
,
GL20.glUseProgram(int)
,
GL20.glValidateProgram(int)
int glCreateShader(int type)
glCreateShader
creates an empty shader object and returns a non-zero
value by which it can be referenced. A shader object is used to maintain the source
code strings that define a shader. shaderType
indicates the type of shader to be created.
Two types of shaders are supported. A shader of type GL_VERTEX_SHADER
is a shader that is
intended to run on the programmable vertex processor. A shader of type GL_FRAGMENT_SHADER
is a shader that is intended to run on the programmable fragment processor.
When created, a shader object's GL_SHADER_TYPE
parameter is set to either
GL_VERTEX_SHADER
or GL_FRAGMENT_SHADER
, depending on the value of
shaderType
.
Like texture objects, the name space for shader objects may be shared across a set of contexts, as long as the server sides of the contexts share the same address space. If the name space is shared across contexts, any attached objects and the data associated with those attached objects are shared as well.
Applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads.
This function returns 0 if an error occurs creating the shader object.
GL_INVALID_ENUM
is generated if shaderType
is not an accepted value.
glGetShaderiv
/glGetShaderiv
with a valid shader object and the parameter to be queried
glGetShaderInfoLog
with a valid shader object
glGetShaderSource
with a valid shader object
type
- Specifies the type of shader to be created. Must be either GL_VERTEX_SHADER
or GL_FRAGMENT_SHADER
.
GL20.glAttachShader(int, int)
,
GL20.glCompileShader(int)
,
GL20.glDeleteShader(int)
,
GL20.glDetachShader(int, int)
,
GL20.glShaderSource(int, int, String[], int[])
,
GL20.glShaderBinary(int, IntBuffer, int, Buffer, int)
,
GL20.glShaderBinary(int, int[], int, int, Buffer, int)
void glCullFace(int mode)
glCullFace
specifies whether front- or back-facing facets are culled
(as specified by mode
) when facet culling is enabled. Facet culling
is initially disabled. To enable and disable facet culling, call the
glEnable
and glDisable
commands with the argument GL_CULL_FACE
.
Facets include triangles, quadrilaterals, polygons, and rectangles.
glFrontFace
specifies which of the clockwise and counterclockwise
facets are front-facing and back-facing. See glFrontFace
.
If mode
is GL_FRONT_AND_BACK
, no facets are drawn,
but other primitives such as points and lines are drawn.
GL_INVALID_ENUM
is generated if mode
is not an accepted value.
glIsEnabled
with argument GL_CULL_FACE
glGetIntegerv
/glGetIntegerv
with argument GL_CULL_FACE_MODE
mode
- Specifies whether front- or back-facing facets are candidates for culling.
Symbolic constants GL_FRONT
, GL_BACK
, and GL_FRONT_AND_BACK
are accepted.
The initial value is GL_BACK
.GL20.glEnable(int)
,
GL20.glFrontFace(int)
void glDeleteBuffers(int n, int[] buffers, int offset)
glDeleteBuffers
deletes n
buffer objects named by the
elements of the array buffers
. After a buffer object is deleted,
it has no contents, and its name is free for reuse (for example by
glGenBuffers
/glGenBuffers
).
If a buffer object that is currently bound is deleted, the binding reverts to 0
(the absence of any buffer object, which reverts to client memory usage).
glDeleteBuffers
silently ignores 0's and names that do not correspond
to existing buffer objects.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of buffer objects to be deleted.buffers
- Specifies an array of buffer objects to be deleted.offset
- The starting offset within the buffers
array.
IllegalArgumentException
- If buffers
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If buffers.length - offset
is less than
n
.GL20.glBindBuffer(int, int)
,
GL20.glDeleteBuffers(int, int[], int)
,
GL20.glGenBuffers(int, IntBuffer)
,
GL20.glGenBuffers(int, int[], int)
,
GL20.glIsBuffer(int)
void glDeleteBuffers(int n, IntBuffer buffers)
Buffer
version of glDeleteBuffers
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of buffer objects to be deleted.buffers
- Specifies the buffer objects to be deleted.
IllegalArgumentException
- If buffers
is null
.
IllegalArgumentException
- If buffers.remaining()
is less than n
.GL20.glDeleteBuffers(int, IntBuffer)
void glDeleteFramebuffers(int n, int[] framebuffers, int offset)
glDeleteFramebuffers
deletes n
framebuffer objects named by the
elements of the array framebuffers
. After a framebuffer object is deleted,
it has no attachments, and its name is free for reuse (for example by
glGenFramebuffers
/
glGenFramebuffers
).
If a framebuffer object that is currently bound is deleted, the binding
reverts to 0 (the window-system-provided framebuffer).
glDeleteFramebuffers
silently ignores 0's and names
that do not correspond to existing framebuffer objects.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of framebuffer objects to be deleted.framebuffers
- Specifies an array of framebuffer objects to be deleted.offset
- The starting offset within the framebuffers
array.
IllegalArgumentException
- If framebuffers
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If framebuffers.length - offset
is less than
n
.GL20.glBindFramebuffer(int, int)
,
GL20.glDeleteFramebuffers(int, IntBuffer)
,
GL20.glGenFramebuffers(int, IntBuffer)
,
GL20.glGenFramebuffers(int, int[], int)
,
GL20.glIsFramebuffer(int)
void glDeleteFramebuffers(int n, IntBuffer framebuffers)
Buffer
version of glDeleteFramebuffers
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of framebuffer objects to be deleted.framebuffers
- Specifies the framebuffer objects to be deleted.
IllegalArgumentException
- If framebuffers
is null
.
IllegalArgumentException
- If framebuffers.remaining()
is less than
n
.GL20.glDeleteFramebuffers(int, int[], int)
void glDeleteProgram(int program)
glDeleteProgram
frees the memory and invalidates the name
associated with the program object specified by program
. This command
effectively undoes the effects of a call to glCreateProgram
.
If a program object is in use as part of current rendering state,
it will be flagged for deletion, but it will not be deleted until
it is no longer part of current state for any rendering context.
If a program object to be deleted has shader objects attached to it,
those shader objects will be automatically detached but not deleted
unless they have already been flagged for deletion by a previous
call to glDeleteShader
. A value of 0 for
program
will be silently ignored.
To determine whether a program object has been flagged for deletion,
call glGetProgramiv
/
glGetProgramiv
with arguments program
and GL_DELETE_STATUS
.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
glGetIntegerv
/glGetIntegerv
with argument GL_CURRENT_PROGRAM
glGetProgramiv
/
glGetProgramiv
with arguments program
and GL_DELETE_STATUS
program
- Specifies the program object to be deleted.GL20.glCreateShader(int)
,
GL20.glDetachShader(int, int)
,
GL20.glUseProgram(int)
void glDeleteRenderbuffers(int n, int[] renderbuffers, int offset)
glDeleteRenderbuffers
deletes n
renderbuffer objects
named by the elements of the array renderbuffers
. After a renderbuffer
object is deleted, it has no contents, and its name is free for
reuse (for example by glGenRenderBuffers
/
glGenRenderbuffers
).
If a renderbuffer object that is currently bound is deleted, the binding reverts to 0 (the absence of any renderbuffer object). Additionally, special care must be taken when deleting a renderbuffer object if the image of the renderbuffer is attached to a framebuffer object. In this case, if the deleted renderbuffer object is attached to the currently bound framebuffer object, it is automatically detached. However, attachments to any other framebuffer objects are the responsibility of the application.
glDeleteRenderbuffers
silently ignores 0's and names that do not
correspond to existing renderbuffer objects.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of renderbuffer objects to be deleted.renderbuffers
- Specifies an array of renderbuffer objects to be deleted.offset
- The starting offset within the renderbuffers
array.
IllegalArgumentException
- If renderbuffers
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If renderbuffers.length - offset
is less than
n
.GL20.glBindRenderbuffer(int, int)
,
GL20.glDeleteRenderbuffers(int, IntBuffer)
,
GL20.glGenRenderbuffers(int, IntBuffer)
,
GL20.glGenRenderbuffers(int, int[], int)
,
GL20.glIsRenderbuffer(int)
void glDeleteRenderbuffers(int n, IntBuffer renderbuffers)
Buffer
version of glDeleteRenderbuffers
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of renderbuffer objects to be deleted.renderbuffers
- Specifies the renderbuffer objects to be deleted.
IllegalArgumentException
- If framebuffers
is null
.
IllegalArgumentException
- If framebuffers.remaining()
is less than n
.GL20.glDeleteRenderbuffers(int, int[], int)
void glDeleteShader(int shader)
glDeleteShader
frees the memory and invalidates the name
associated with the shader object specified by shader
. This command
effectively undoes the effects of a call to glCreateShader
.
If a shader object to be deleted is attached to a program object,
it will be flagged for deletion, but it will not be deleted until
it is no longer attached to any program object, for any rendering
context (i.e., it must be detached from wherever it was attached
before it will be deleted). A value of 0 for shader
will be
silently ignored.
To determine whether an object has been flagged for deletion,
call glGetShaderiv
/
glGetShaderiv
with
arguments shader
and GL_DELETE_STATUS
.
GL_INVALID_VALUE
is generated if shader
is
not a value generated by OpenGL.
glGetAttachedShaders
/
glGetAttachedShaders
with the program object to be queried
glGetShaderiv
/
glGetShaderiv
with arguments shader
and GL_DELETE_STATUS
shader
- Specifies the shader object to be deleted.GL20.glCreateProgram()
,
GL20.glCreateShader(int)
,
GL20.glDetachShader(int, int)
,
GL20.glUseProgram(int)
void glDeleteTextures(int n, int[] textures, int offset)
glDeleteTextures
deletes n
textures named by the
elements of the array textures
. After a texture is deleted,
it has no contents or dimensionality, and its name is free for
reuse (for example by glGenTextures
/
glGenTextures
). If a texture that is
currently bound is deleted, the binding reverts to 0 (the default texture).
glDeleteTextures
silently ignores 0's and names that do
not correspond to existing textures.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of textures to be deleted.textures
- Specifies an array of textures to be deleted.offset
- The starting offset within the textures
array.
IllegalArgumentException
- If textures
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If textures.length - offset
is less than
n
.GL20.glBindTexture(int, int)
,
GL20.glDeleteTextures(int, IntBuffer)
,
GL20.glGenTextures(int, IntBuffer)
,
GL20.glGenTextures(int, int[], int)
,
GL20.glIsTexture(int)
void glDeleteTextures(int n, IntBuffer textures)
Buffer
version of glDeleteTextures
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of textures to be deleted.textures
- Specifies the textures to be deleted.
IllegalArgumentException
- If textures
is null
.
IllegalArgumentException
- If textures.remaining()
is less than n
.GL20.glDeleteTextures(int, int[], int)
void glDepthFunc(int func)
glDepthFunc
specifies the function used to
compare each incoming pixel depth value with the depth value
present in the depth buffer. The comparison is performed
only if depth testing is enabled.
(See glEnable
and glDisable
of GL_DEPTH_TEST
.)
func
specifies the conditions under which the pixel will be drawn.
The comparison functions are as follows:
GL_NEVER
Never passes.
GL_LESS
Passes if the incoming depth value is less than the stored depth value.
GL_EQUAL
Passes if the incoming depth value is equal to the stored depth value.
GL_LEQUAL
Passes if the incoming depth value is less than or equal to the stored depth value.
GL_GREATER
Passes if the incoming depth value is greater than the stored depth value.
GL_NOTEQUAL
Passes if the incoming depth value is not equal to the stored depth value.
GL_GEQUAL
Passes if the incoming depth value is greater than or equal to the stored depth value.
GL_ALWAYS
Always passes.
The initial value of func
is GL_LESS
. Initially, depth testing is disabled.
If depth testing is disabled or no depth buffer exists,
it is as if the depth test always passes.
Even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled.
GL_INVALID_ENUM
is generated if func
is not an accepted value.
glGetIntegerv
/glGetIntegerv
with argument GL_DEPTH_FUNC
glIsEnabled
with argument GL_DEPTH_TEST
func
- Specifies the depth comparison function.
Symbolic constants GL_NEVER
, GL_LESS
, GL_EQUAL
,
GL_LEQUAL
, GL_GREATER
, GL_NOTEQUAL
, GL_GEQUAL
, and
GL_ALWAYS
are accepted.
The initial value is GL_LESS
.GL20.glDepthRangef(float, float)
,
GL20.glEnable(int)
,
GL20.glPolygonOffset(float, float)
void glDepthMask(boolean flag)
glDepthMask
specifies whether the depth buffer
is enabled for writing. If flag
is GL_FALSE
, depth buffer
writing is disabled. Otherwise, it is enabled. Initially,
depth buffer writing is enabled.
glGetIntegerv
/glGetIntegerv
with argument GL_DEPTH_WRITEMASK
flag
- Specifies whether the depth buffer is enabled for writing.
If flag
is GL_FALSE
, depth buffer writing is disabled. Otherwise,
it is enabled. Initially, depth buffer writing is enabled.GL20.glColorMask(boolean, boolean, boolean, boolean)
,
GL20.glDepthFunc(int)
,
GL20.glDepthRangef(float, float)
,
GL20.glStencilMask(int)
void glDepthRangef(float zNear, float zFar)
glDepthRangef
specifies
a linear mapping of the normalized depth coordinates in this range to window
depth coordinates. Regardless of the actual depth buffer implementation, window
coordinate depth values are treated as though they range from 0 through 1
(like color components). Thus, the values accepted by glDepthRangef
are both
clamped to this range before they are accepted.
The setting of (0,1) maps the near plane to 0 and the far plane to 1. With this mapping, the depth buffer range is fully utilized.
It is not necessary that nearVal
be less than farVal
. Reverse mappings
such as nearVal = 1
, and farVal = 0
are acceptable.
glGetIntegerv
/glGetIntegerv
with argument GL_DEPTH_RANGE
zNear
- Specifies the mapping of the near clipping plane to
window coordinates. The initial value is 0.zFar
- Specifies the mapping of the far clipping plane to
window coordinates. The initial value is 1.GL20.glDepthFunc(int)
,
GL20.glPolygonOffset(float, float)
,
GL20.glViewport(int, int, int, int)
void glDetachShader(int program, int shader)
glDetachShader
detaches the shader object specified by
shader
from the program object specified by program
. This command can
be used to undo the effect of the command glAttachShader
.
If shader
has already been flagged for deletion by a call
to glDeleteShader
and it is not attached to any other program
object, it will be deleted after it has been detached.
GL_INVALID_VALUE
is generated if either program
or
shader
is a value that was not generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if shader
is not a shader object.
GL_INVALID_OPERATION
is generated if shader
is not attached to
program
.
glGetAttachedShaders
/
glGetAttachedShaders
with the handle of a valid program object
glGetShaderiv
/
glGetShaderiv
with arguments shader
and GL_DELETE_STATUS
program
- Specifies the program object from which to detach the shader object.shader
- Specifies the shader object to be detached.GL20.glAttachShader(int, int)
void glDisable(int cap)
glDisable
disables various capabilities.
Use glIsEnabled
or
glGetBooleanv
/glGetBooleanv
to determine the current setting of any capability. The initial value for each capability
with the exception of GL_DITHER
is GL_FALSE
.
The initial value for GL_DITHER
is GL_TRUE
.
cap
can assume one of the following values:
GL_BLEND
If enabled, blend the computed fragment color values with the
values in the color buffers. See glBlendFunc
.
GL_CULL_FACE
If enabled, cull polygons based on their winding in
window coordinates. See glCullFace
.
GL_DEPTH_TEST
If enabled, do depth comparisons and update the depth buffer.
Note that even if the depth buffer exists and the depth mask is non-zero,
the depth buffer is not updated if the depth test is
disabled. See glDepthFunc
and glDepthRangef
.
GL_DITHER
If enabled, dither color components or indices before they are written to the color buffer.
GL_POLYGON_OFFSET_FILL
If enabled, an offset is added to depth values of a polygon's
fragments produced by rasterization. See glPolygonOffset
.
GL_SAMPLE_ALPHA_TO_COVERAGE
If enabled, compute a temporary coverage value where each bit
is determined by the alpha value at the corresponding sample
location. The temporary coverage value is then AND
ed with the
fragment coverage value.
GL_SAMPLE_COVERAGE
If enabled, the fragment's coverage is AND
ed with the temporary
coverage value. If GL_SAMPLE_COVERAGE_INVERT
is set to GL_TRUE
,
invert the coverage value. See glSampleCoverage
.
GL_SCISSOR_TEST
If enabled, discard fragments that are outside the scissor rectangle.
See glScissor
.
GL_STENCIL_TEST
If enabled, do stencil testing and update the stencil buffer.
See glStencilFunc
and glStencilOp
.
GL_INVALID_ENUM
is generated if cap
is not one of the values listed previously.
cap
- Specifies a symbolic constant indicating a GL capability.GL20.glActiveTexture(int)
,
GL20.glBlendFunc(int, int)
,
GL20.glCullFace(int)
,
GL20.glDepthFunc(int)
,
GL20.glDepthRangef(float, float)
,
GL20.glGetBooleanv(int, IntBuffer)
,
GL20.glGetBooleanv(int, boolean[], int)
,
GL20.glIsEnabled(int)
,
GL20.glLineWidth(float)
,
GL20.glPolygonOffset(float, float)
,
GL20.glScissor(int, int, int, int)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilOp(int, int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
void glDisableVertexAttribArray(int index)
glDisableVertexAttribArray
disables the generic vertex attribute array
specified by index
. By default, all client-side capabilities are
disabled, including all generic vertex attribute arrays. If enabled, the values in the
generic vertex attribute array will be accessed and used for rendering when calls are
made to vertex array commands such as glDrawArrays
or glDrawElements
/glDrawElements
.
GL_INVALID_VALUE
is generated if index
is greater than or
equal to GL_MAX_VERTEX_ATTRIBS
.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttrib
/
glGetVertexAttrib
/
glGetVertexAttrib
/
glGetVertexAttrib
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_ENABLED
index
- Specifies the index of the generic vertex attribute to be disabled.GL20.glBindAttribLocation(int, int, String)
,
GL20.glDrawArrays(int, int, int)
,
GL20.glDrawElements(int, int, int, Buffer)
,
GL20.glDrawElements(int, int, int, int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glDrawArrays(int mode, int first, int count)
glDrawArrays
specifies multiple geometric primitives with very few
subroutine calls. Instead of calling a GL procedure to pass each individual
vertex attribute, you can use
glVertexAttribPointer
/
glVertexAttribPointer
to prespecify separate arrays of vertices, normals, and colors and use them to construct a
sequence of primitives with a single call to glDrawArrays
.
When glDrawArrays
is called, it uses count
sequential elements from each
enabled array to construct a sequence of geometric primitives, beginning
with element first
. mode
specifies what kind of primitives are constructed
and how the array elements construct those primitives.
To enable and disable a generic vertex attribute array,
call glEnableVertexAttribArray
and
glDisableVertexAttribArray
.
If the current program object, as set by glUseProgram
, is invalid, rendering
results are undefined. However, no error is generated for this case.
GL_INVALID_ENUM
is generated if mode
is not an accepted value.
GL_INVALID_VALUE
is generated if count
is negative.
GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound
framebuffer is not framebuffer complete (i.e. the return value
from glCheckFramebufferStatus
is not GL_FRAMEBUFFER_COMPLETE
).
mode
- Specifies what kind of primitives to render.
Symbolic constants GL_POINTS
, GL_LINE_STRIP
,
GL_LINE_LOOP
, GL_LINES
, GL_TRIANGLE_STRIP
,
GL_TRIANGLE_FAN
, and GL_TRIANGLES
are accepted.first
- Specifies the starting index in the enabled arrays.count
- Specifies the number of indices to be rendered.
ArrayIndexOutOfBoundsException
- If any index
in the sequence first, ..., first + count - 1
will result in a reference to an entry outside of the
enabled generic vertex attribute data array(s).GL20.glCheckFramebufferStatus(int)
,
GL20.glDisableVertexAttribArray(int)
,
GL20.glDrawElements(int, int, int, Buffer)
,
GL20.glDrawElements(int, int, int, int)
,
GL20.glEnableVertexAttribArray(int)
,
GL20.glUseProgram(int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glDrawElements(int mode, int count, int type, Buffer indices)
glDrawElements
specifies multiple geometric primitives with very few subroutine calls.
Instead of calling a GL function to pass each vertex attribute, you can
use glVertexAttribPointer
/
glVertexAttribPointer
to prespecify separate arrays of vertex attributes and use them to construct a sequence
of primitives with a single call to glDrawElements
.
When glDrawElements
is called, it uses count
elements from
an enabled array, accessing the elements specified by indices
to construct
a sequence of geometric primitives. mode
specifies
what kind of primitives are constructed and how the array elements construct these
primitives. If more than one array is enabled, each is used.
To enable and disable a generic vertex attribute array,
call glEnableVertexAttribArray
and glDisableVertexAttribArray
.
If the current program object, as set by glUseProgram
,
is invalid, rendering results are undefined. However, no error is generated for this case.
GL_INVALID_ENUM
is generated if mode
is not an accepted value.
GL_INVALID_ENUM
is generated if type
is not
GL_UNSIGNED_BYTE
or GL_UNSIGNED_SHORT
.
GL_INVALID_VALUE
is generated if count
is negative.
GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer
is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus
is not GL_FRAMEBUFFER_COMPLETE
).
mode
- Specifies what kind of primitives to render.
Symbolic constants GL_POINTS
, GL_LINE_STRIP
,
GL_LINE_LOOP
, GL_LINES
, GL_TRIANGLE_STRIP
,
GL_TRIANGLE_FAN
, and GL_TRIANGLES
are accepted.count
- Specifies the number of elements to be rendered.type
- Specifies the type of the values in indices
.
Must be GL_UNSIGNED_BYTE
or GL_UNSIGNED_SHORT
.indices
- Specifies the indices as a buffer.
IllegalStateException
- If the most recent call
to glBindBuffer
for the
GL_ELEMENT_ARRAY_BUFFER
target had a
non-zero buffer
parameter (i.e., an
index buffer is bound).
IllegalArgumentException
- If
indices
is null
.
ArrayIndexOutOfBoundsException
- If any index
in the sequence of indices from 0
to
count - 1
would result in a reference
to an entry outside of the currently bound index array
or the enabled generic vertex attribute data array(s).GL20.glCheckFramebufferStatus(int)
,
GL20.glDisableVertexAttribArray(int)
,
GL20.glDrawArrays(int, int, int)
,
GL20.glDrawElements(int, int, int, int)
,
GL20.glEnableVertexAttribArray(int)
,
GL20.glUseProgram(int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glDrawElements(int mode, int count, int type, int offset)
glDrawElements
.
GL_INVALID_ENUM
is generated if mode
is not an accepted value.
GL_INVALID_ENUM
is generated if type
is not
GL_UNSIGNED_BYTE
or GL_UNSIGNED_SHORT
.
GL_INVALID_VALUE
is generated if count
is negative.
GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound framebuffer
is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus
is not GL_FRAMEBUFFER_COMPLETE
).
mode
- Specifies what kind of primitives to render.
Symbolic constants GL_POINTS
, GL_LINE_STRIP
,
GL_LINE_LOOP
, GL_LINES
, GL_TRIANGLE_STRIP
,
GL_TRIANGLE_FAN
, and GL_TRIANGLES
are accepted.count
- Specifies the number of elements to be rendered.type
- Specifies the type of the values in currently bound index buffer.
Must be GL_UNSIGNED_BYTE
or GL_UNSIGNED_SHORT
.offset
- Specifies the offset into the currently bound index buffer.
IllegalStateException
- If the most recent call to
glBindBuffer
for the
GL_ELEMENT_ARRAY_BUFFER
target had a
buffer
parameter of 0 (i.e., an index
buffer is not bound).
ArrayIndexOutOfBoundsException
- If any index
in the sequence of indices from offset
to offset + count - 1
would result in a reference to an entry
outside of indices
or the enabled
generic vertex attribute data array(s), where
indices
refers to the set of values
bound to the GL_ELEMENT_ARRAY_BUFFER
target.GL20.glDrawElements(int, int, int, Buffer)
void glEnable(int cap)
glEnable
enables various capabilities.
Use glIsEnabled
or
glGetBooleanv
/glGetBooleanv
to determine the current setting of any capability. The initial value for each capability
with the exception of GL_DITHER
is GL_FALSE
.
The initial value for GL_DITHER
is GL_TRUE
.
cap
can assume one of the following values:
GL_BLEND
If enabled, blend the computed fragment color values with the
values in the color buffers. See glBlendFunc
.
GL_CULL_FACE
If enabled, cull polygons based on their winding in
window coordinates. See glCullFace
.
GL_DEPTH_TEST
If enabled, do depth comparisons and update the depth buffer.
Note that even if the depth buffer exists and the depth mask is non-zero,
the depth buffer is not updated if the depth test is
disabled. See glDepthFunc
and glDepthRangef
.
GL_DITHER
If enabled, dither color components or indices before they are written to the color buffer.
GL_POLYGON_OFFSET_FILL
If enabled, an offset is added to depth values of a polygon's
fragments produced by rasterization. See glPolygonOffset
.
GL_SAMPLE_ALPHA_TO_COVERAGE
If enabled, compute a temporary coverage value where each bit
is determined by the alpha value at the corresponding sample
location. The temporary coverage value is then AND
ed with the
fragment coverage value.
GL_SAMPLE_COVERAGE
If enabled, the fragment's coverage is AND
ed with the temporary
coverage value. If GL_SAMPLE_COVERAGE_INVERT
is set to GL_TRUE
,
invert the coverage value. See glSampleCoverage
.
GL_SCISSOR_TEST
If enabled, discard fragments that are outside the scissor rectangle.
See glScissor
.
GL_STENCIL_TEST
If enabled, do stencil testing and update the stencil buffer.
See glStencilFunc
and glStencilOp
.
GL_INVALID_ENUM
is generated if cap
is not one of the values listed previously.
cap
- Specifies a symbolic constant indicating a GL capability.GL20.glActiveTexture(int)
,
GL20.glBlendFunc(int, int)
,
GL20.glCullFace(int)
,
GL20.glDepthFunc(int)
,
GL20.glDepthRangef(float, float)
,
GL20.glGetBooleanv(int, IntBuffer)
,
GL20.glGetBooleanv(int, boolean[], int)
,
GL20.glIsEnabled(int)
,
GL20.glLineWidth(float)
,
GL20.glPolygonOffset(float, float)
,
GL20.glScissor(int, int, int, int)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilOp(int, int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
void glEnableVertexAttribArray(int index)
glEnableVertexAttribArray
enables the generic vertex attribute array
specified by index
. By default, all client-side capabilities are
disabled, including all generic vertex attribute arrays. If enabled, the values in the
generic vertex attribute array will be accessed and used for rendering when calls are
made to vertex array commands such as glDrawArrays
or glDrawElements
/glDrawElements
.
GL_INVALID_VALUE
is generated if index
is greater
than or equal to GL_MAX_VERTEX_ATTRIBS
.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttrib
/
glGetVertexAttrib
/
glGetVertexAttrib
/
glGetVertexAttrib
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_ENABLED
index
- Specifies the index of the generic vertex attribute to be enabled.GL20.glBindAttribLocation(int, int, String)
,
GL20.glDrawArrays(int, int, int)
,
GL20.glDrawElements(int, int, int, Buffer)
,
GL20.glDrawElements(int, int, int, int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glFinish()
glFinish
does not return until the effects of all
previously called GL commands are complete. Such effects include
all changes to GL state, all changes to connection state, and all
changes to the frame buffer contents.
glFinish
requires a round trip to the server.
GL20.glFlush()
void glFlush()
glFlush
empties all of these buffers, causing all issued
commands to be executed as quickly as they are accepted by the actual
rendering engine. Though this execution may not be completed in any
particular time period, it does complete in finite time.
Because any GL program might be executed over a network,
or on an accelerator that buffers commands, all programs should
call glFlush
whenever they count on having all of their
previously issued commands completed. For example, call glFlush
before waiting for user input that depends on the generated image.
glFlush
can return at any time. It does not wait until
the execution of all previously issued GL commands is complete.
GL20.glFinish()
void glFramebufferRenderbuffer(int target, int attachment, int renderbuffertarget, int renderbuffer)
glFramebufferRenderbuffer
attaches the renderbuffer
specified by renderbuffer
as one of the logical buffers of the
currently bound framebuffer object. attachment
specifies whether
the renderbuffer should be attached to the framebuffer object's
color, depth, or stencil buffer. A renderbuffer may not be attached
to the default framebuffer object name 0.
If renderbuffer
is not 0, the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
for the specified attachment point is set to GL_RENDERBUFFER
and the value
of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is set to renderbuffer
.
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
and GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
are set to the default values 0 and GL_TEXTURE_CUBE_MAP_POSITIVE_X
, respectively.
Any previous attachment to the attachment
logical buffer of the currently bound
framebuffer object is broken.
If renderbuffer
is 0, the current image, if any, attached to the attachment
logical
buffer of the currently bound framebuffer object is detached. The value of
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is set to GL_NONE
.
The value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is set to 0.
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
and GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
are set to the default values 0 and GL_TEXTURE_CUBE_MAP_POSITIVE_X
, respectively.
If a renderbuffer object is deleted while its image is attached to the currently bound framebuffer,
then it is as if glFramebufferRenderbuffer
had been called with a renderbuffer
of 0 for the
attachment point to which this image was attached in the currently bound framebuffer object.
In other words, the renderbuffer image is detached from the currently bound framebuffer.
Note that the renderbuffer image is specifically not detached from any non-bound framebuffers.
Detaching the image from any non-bound framebuffers is the responsibility of the application.
GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
GL_INVALID_ENUM
is generated if renderbuffertarget
is not
GL_RENDERBUFFER
and renderbuffer
is not 0.
GL_INVALID_ENUM
is generated if attachment
is not an accepted attachment point.
GL_INVALID_OPERATION
is generated if the default framebuffer object name 0 is bound.
GL_INVALID_OPERATION
is generated if renderbuffer
is neither 0 nor
the name of an existing renderbuffer object.
glGetFramebufferAttachmentParameteriv
/
glGetFramebufferAttachmentParameteriv
target
- Specifies the framebuffer target. The symbolic
constant must be GL_FRAMEBUFFER
.attachment
- Specifies the attachment point to which
renderbuffer
should be attached. Must be one of the following
symbolic constants: GL_COLOR_ATTACHMENT0
,
GL_DEPTH_ATTACHMENT
, or GL_STENCIL_ATTACHMENT
.renderbuffertarget
- Specifies the renderbuffer target.
The symbolic constant must be GL_RENDERBUFFER
.renderbuffer
- Specifies the renderbuffer object that
is to be attached.GL20.glBindFramebuffer(int, int)
,
GL20.glBindRenderbuffer(int, int)
,
GL20.glCheckFramebufferStatus(int)
,
GL20.glDeleteFramebuffers(int, IntBuffer)
,
GL20.glDeleteFramebuffers(int, int[], int)
,
GL20.glDeleteRenderbuffers(int, IntBuffer)
,
GL20.glDeleteRenderbuffers(int, int[], int)
,
GL20.glFramebufferTexture2D(int, int, int, int, int)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, IntBuffer)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, int[], int)
,
GL20.glRenderbufferStorage(int, int, int, int)
void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level)
glFramebufferTexture2D
attaches the texture image specified by
texture
and level
as one of the logical buffers of the currently bound framebuffer object.
attachment
specifies whether the texture image should be attached to the framebuffer
object's color, depth, or stencil buffer. A texture image may not be attached to the
default framebuffer object name 0.
If texture
is not 0, the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
for the specified attachment point is set to GL_TEXTURE
, the value of
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is set to texture
, and the value of
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
is set to level
. If texture
is a
cube map texture, the value of GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
is set to textarget
; otherwise it is set to the default value
GL_TEXTURE_CUBE_MAP_POSITIVE_X
. Any previous attachment to the attachment
logical buffer of the currently bound framebuffer object is broken.
If texture
is 0, the current image, if any, attached to the attachment
logical buffer of the currently bound framebuffer object is detached.
The value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is set to GL_NONE
.
The value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is set to 0.
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
and GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
are set to the default values 0 and GL_TEXTURE_CUBE_MAP_POSITIVE_X
, respectively.
Special precautions need to be taken to avoid attaching a texture image to the currently bound framebuffer while the texture object is currently bound and potentially sampled by the current vertex or fragment shader. Doing so could lead to the creation of a "feedback loop" between the writing of pixels by rendering operations and the simultaneous reading of those same pixels when used as texels in the currently bound texture. In this scenario, the framebuffer will be considered framebuffer complete, but the values of fragments rendered while in this state will be undefined. The values of texture samples may be undefined as well.
If a texture object is deleted while its image is attached to the currently bound
framebuffer, then it is as if glFramebufferTexture2D
had been called with a
texture
of 0 for the attachment point to which this image was attached in
the currently bound framebuffer object. In other words, the texture image
is detached from the currently bound framebuffer. Note that the texture image
is specifically not detached from any non-bound framebuffers.
Detaching the image from any non-bound framebuffers is the responsibility
of the application.
GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
GL_INVALID_ENUM
is generated if textarget
is
not an accepted texture target and texture
is not 0.
GL_INVALID_ENUM
is generated if attachment
is not
an accepted attachment point.
GL_INVALID_VALUE
is generated if level
is not 0 and
texture
is not 0.
GL_INVALID_OPERATION
is generated if the default framebuffer object name 0 is bound.
GL_INVALID_OPERATION
is generated if texture
is neither 0
nor the name of an existing texture object.
GL_INVALID_OPERATION
is generated if texture
is the name of
an existing two-dimensional texture object but
textarget
is not GL_TEXTURE_2D
or if texture
is the name of an existing cube map texture object but textarget
is GL_TEXTURE_2D
.
glGetFramebufferAttachmentParameteriv
/
glGetFramebufferAttachmentParameteriv
target
- Specifies the framebuffer target.
The symbolic constant must be GL_FRAMEBUFFER
.attachment
- Specifies the attachment point to
which an image from texture
should be attached.
Must be one of the following symbolic constants:
GL_COLOR_ATTACHMENT0
, GL_DEPTH_ATTACHMENT
, or
GL_STENCIL_ATTACHMENT
.textarget
- Specifies the texture target.
Must be one of the following symbolic constants:
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X
, GL_TEXTURE_CUBE_MAP_POSITIVE_Y
,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
, GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.texture
- Specifies the texture object whose image is to be attached.level
- Specifies the mipmap level of the texture image to be attached, which must be 0.GL20.glBindFramebuffer(int, int)
,
GL20.glBindTexture(int, int)
,
GL20.glCheckFramebufferStatus(int)
,
GL20.glDeleteFramebuffers(int, IntBuffer)
,
GL20.glDeleteFramebuffers(int, int[], int)
,
GL20.glDeleteTextures(int, IntBuffer)
,
GL20.glDeleteTextures(int, int[], int)
,
GL20.glFramebufferRenderbuffer(int, int, int, int)
,
GL20.glGenerateMipmap(int)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, IntBuffer)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, int[], int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
void glFrontFace(int mode)
glEnable
and glDisable
with
argument GL_CULL_FACE
.
The projection of a polygon to window coordinates is said to
have clockwise winding if an imaginary object following the
path from its first vertex, its second vertex, and so on,
to its last vertex, and finally back to its first vertex,
moves in a clockwise direction about the interior of the polygon.
The polygon's winding is said to be counterclockwise if the imaginary
object following the same path moves in a counterclockwise direction
about the interior of the polygon. glFrontFace
specifies whether
polygons with clockwise winding in window coordinates, or counterclockwise
winding in window coordinates, are taken to be front-facing.
Passing GL_CCW
to mode
selects counterclockwise polygons as front-facing;
GL_CW
selects clockwise polygons as front-facing.
By default, counterclockwise polygons are taken to be front-facing.
GL_INVALID_ENUM
is generated if mode
is not an accepted value.
glGetIntegerv
/glGetIntegerv
with argument GL_FRONT_FACE
mode
- Specifies the orientation of front-facing polygons.
GL_CW
and GL_CCW
are accepted. The initial value is GL_CCW
.GL20.glCullFace(int)
void glGenBuffers(int n, int[] buffers, int offset)
glGenBuffers
returns n
buffer object names in buffers
.
There is no guarantee that the names form a contiguous set of integers;
however, it is guaranteed that none of the returned names was in use
immediately before the call to glGenBuffers
.
Buffer object names returned by a call to glGenBuffers
are not
returned by subsequent calls, unless they are first deleted
with glDeleteBuffers
/
glDeleteBuffers
.
No buffer objects are associated with the returned buffer object
names until they are first bound by calling glBindBuffer
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of buffer object names to be generated.buffers
- Specifies an array in which the generated buffer object names are stored.offset
- The starting offset within the buffers
array.
IllegalArgumentException
- If buffers
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If buffers.length -
offset
is less than n
.GL20.glBindBuffer(int, int)
,
GL20.glDeleteBuffers(int, IntBuffer)
,
GL20.glDeleteBuffers(int, int[], int)
,
GL20.glGenBuffers(int, IntBuffer)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
void glGenBuffers(int n, IntBuffer buffers)
Buffer
version of glGenBuffers
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of buffer object names to be generated.buffers
- Specifies a buffer in which the generated buffer object names are stored.
IllegalArgumentException
- If buffers
is null
.
IllegalArgumentException
- If buffers.remaining()
is less than n
.GL20.glGenBuffers(int, int[], int)
void glGenFramebuffers(int n, int[] framebuffers, int offset)
glGenFramebuffers
returns n
framebuffer object names in framebuffers
.
There is no guarantee that the names form a contiguous set of integers;
however, it is guaranteed that none of the returned names was in use
immediately before the call to glGenFramebuffers
.
Framebuffer object names returned by a call to glGenFramebuffers
are not returned by subsequent calls, unless they are first deleted
with glDeleteFramebuffers
/
glDeleteFramebuffers
.
No framebuffer objects are associated with the returned
framebuffer object names until they are first bound by
calling glBindFramebuffer
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of framebuffer object names to be generated.framebuffers
- Specifies an array in which the generated framebuffer object names are stored.offset
- The starting offset within the framebuffers
array.
IllegalArgumentException
- If framebuffers
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If framebuffers.length -
offset
is less than n
.GL20.glBindFramebuffer(int, int)
,
GL20.glDeleteFramebuffers(int, IntBuffer)
,
GL20.glDeleteFramebuffers(int, int[], int)
,
GL20.glGenFramebuffers(int, IntBuffer)
,
GL20.glIsFramebuffer(int)
void glGenFramebuffers(int n, IntBuffer framebuffers)
Buffer
version of glGenBuffers
.
GL_INVALID_VALUE
is generated if n is negative.
n
- Specifies the number of framebuffer object names to be generated.framebuffers
- Specifies the buffer in which the generated framebuffer object names are stored.
IllegalArgumentException
- If framebuffers
is null
.
IllegalArgumentException
- If framebuffers.remaining()
is less than n
.GL20.glGenFramebuffers(int, int[], int)
void glGenRenderbuffers(int n, int[] renderbuffers, int offset)
glGenRenderbuffers
returns n
renderbuffer object names in renderbuffers
.
There is no guarantee that the names form a contiguous set of integers;
however, it is guaranteed that none of the returned names was in use immediately
before the call to glGenRenderbuffers
.
Renderbuffer object names returned by a call to glGenRenderbuffers
are not returned by subsequent calls, unless they are first deleted
with glDeleteRenderbuffers
/
glDeleteRenderbuffers
.
No renderbuffer objects are associated with the returned renderbuffer
object names until they are first bound by calling glBindRenderbuffer
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of renderbuffer object names to be generated.renderbuffers
- Specifies an array in which the generated renderbuffer object names are stored.offset
- The starting offset within the renderbuffers
array.
IllegalArgumentException
- If renderbuffers
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If renderbuffers.length -
offset
is less than n
.GL20.glBindRenderbuffer(int, int)
,
GL20.glDeleteRenderbuffers(int, IntBuffer)
,
GL20.glDeleteRenderbuffers(int, int[], int)
,
GL20.glGenRenderbuffers(int, IntBuffer)
,
GL20.glIsRenderbuffer(int)
void glGenRenderbuffers(int n, IntBuffer renderbuffers)
Buffer
version of glGenRenderbuffers
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies Specifies the number of renderbuffer object names to be generated.renderbuffers
- Specifies the buffer in which the generated renderbuffer object names are stored.
IllegalArgumentException
- If renderbuffers
is null
.
IllegalArgumentException
- If renderbuffers.remaining()
is less than n
.GL20.glGenRenderbuffers(int, int[], int)
void glGenTextures(int n, int[] textures, int offset)
glGenTextures
returns n
texture names in textures
. There is no guarantee
that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was
in use immediately before the call to glGenTextures
.
The generated textures have no dimensionality; they assume the dimensionality of the texture target to which
they are first bound (see glBindTexture
).
Texture names returned by a call to glGenTextures
are not returned by subsequent calls, unless they are first
deleted with glDeleteTextures
/glDeleteTextures
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of texture names to be generated.textures
- Specifies an array in which the generated texture names are stored.offset
- The starting offset within the textures
array.
IllegalArgumentException
- If textures
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If textures.length -
offset
is less than n
.GL20.glBindTexture(int, int)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glDeleteTextures(int, IntBuffer)
,
GL20.glDeleteTextures(int, int[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
,
GL20.glGetTexParameterfv(int, int, float[], int)
,
GL20.glGetTexParameterfv(int, int, FloatBuffer)
,
GL20.glGetTexParameteriv(int, int, int[], int)
,
GL20.glGetTexParameteriv(int, int, IntBuffer)
,
GL20.glGenTextures(int, IntBuffer)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glGenTextures(int n, IntBuffer textures)
Buffer
version of glGenTextures
.
GL_INVALID_VALUE
is generated if n
is negative.
n
- Specifies the number of texture names to be generated.textures
- Specifies the buffer in which the generated texture names are stored.
IllegalArgumentException
- If textures
is null
.
IllegalArgumentException
- If textures.remaining()
is less than n
.GL20.glGenTextures(int, int[], int)
void glGenerateMipmap(int target)
glGenerateMipmap
computes a complete set of
mipmap arrays derived from the zero level array. Array levels
up to and including the 1x1 dimension texture image are replaced
with the derived arrays, regardless of previous contents.
The zero level texture image is left unchanged.
The internal formats of the derived mipmap arrays all match those of the zero level texture image. The dimensions of the derived arrays are computed by halving the width and height of the zero level texture image, then in turn halving the dimensions of each array level until the 1x1 dimension texture image is reached.
The contents of the derived arrays are computed
by repeated filtered reduction of the zero level array.
No particular filter algorithm is required,
though a box filter is recommended. glHint
may
be called to express a preference for speed or
quality of filtering.
GL_INVALID_ENUM
is generated if target
is
not GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.
GL_INVALID_OPERATION
is generated if the texture bound to target
is a cube map,
but its six faces do not share indentical widths, heights, formats, and types.
GL_INVALID_OPERATION
is generated if either the width or height
of the zero level array is not a power of two.
GL_INVALID_OPERATION
is generated if the zero level array is stored
in a compressed internal format.
target
- Specifies the texture target of the texture object whose mipmaps
will be generated. Must be one of the following symbolic
constants: GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.GL20.glBindTexture(int, int)
,
GL20.glFramebufferTexture2D(int, int, int, int, int)
,
GL20.glHint(int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
String glGetActiveAttrib(int program, int index, int[] size, int sizeOffset, int[] type, int typeOffset)
glGetActiveAttrib
returns information about an
active attribute variable in the program object specified
by program
. The number of active attributes can be obtained
by calling glGetProgramiv
/
glGetProgramiv
with the value GL_ACTIVE_ATTRIBUTES
.
A value of 0 for index
selects the first active attribute variable.
Permissible values for index
range from 0 to the number of active
attribute variables minus 1.
Attribute variables have arbitrary names and obtain their values
through numbered generic vertex attributes. An attribute variable
is considered active if it is determined during the link operation
that it may be accessed during program execution.
Therefore, program
should have previously been the target
of a call to glLinkProgram
, but it is not necessary for it
to have been linked successfully.
glGetActiveAttrib
returns the name of the attribute variable indicated
by index
.
The type
argument will return the attribute variable's data type.
The symbolic constants GL_FLOAT
, GL_FLOAT_VEC2
, GL_FLOAT_VEC3
,
GL_FLOAT_VEC4
, GL_FLOAT_MAT2
, GL_FLOAT_MAT3
, or GL_FLOAT_MAT4
may be returned. The size
argument will return the size of the attribute,
in units of the type returned in type
.
This function will return as much information as it can about the specified
active attribute variable. If no information is available then an empty string wil be returned.
This situation could occur if this function
is called after a link operation that failed. If an error occurs, the return
values size
and type
will be unmodified
and an empty string will be returned.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_VALUE
is generated if index
is greater than or equal to the
number of active attribute variables in program
.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_ATTRIBS
.
glGetProgramiv
/
glGetProgramiv
with argument GL_ACTIVE_ATTRIBUTES
or GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
.
program
- Specifies the program object to be queried.index
- Specifies the index of the attribute variable to be queried.size
- An int
array of length at least 1.
Returns the size of the attribute variable. May be null
.sizeOffset
- The starting offset within the size
array.type
- An int
array of length at least 1.
Returns the data type of the attribute variable. May be null
.typeOffset
- The starting offset within the type
array.
String
containing the name of the attribute variable.
IllegalArgumentException
- If size
is
non-null
but size
.length - sizeOffset
is smaller than 1.
IllegalArgumentException
- If sizeOffset
is less than 0.
IllegalArgumentException
- If type
is
non-null
but type
.length - typeOffset
is smaller than 1.
IllegalArgumentException
- If typeOffset
is less than 0.GL20.glGetActiveAttrib(int, int, int, int[], int, int[], int, int[], int, byte[], int)
,
GL20.glBindAttribLocation(int, int, String)
,
GL20.glGetActiveUniform(int, int, int[], int, int[], int)
,
GL20.glLinkProgram(int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glGetActiveAttrib(int program, int index, int bufSize, int[] length, int lengthOffset, int[] size, int sizeOffset, int[] type, int typeOffset, byte[] name, int nameOffset)
glGetActiveAttrib
returns information about an
active attribute variable in the program object specified
by program
. The number of active attributes can be obtained
by calling glGetProgramiv
/
glGetProgramiv
with the value GL_ACTIVE_ATTRIBUTES
.
A value of 0 for index
selects the first active attribute variable.
Permissible values for index
range from 0 to the number of active
attribute variables minus 1.
Attribute variables have arbitrary names and obtain their values
through numbered generic vertex attributes. An attribute variable
is considered active if it is determined during the link operation
that it may be accessed during program execution.
Therefore, program
should have previously been the target
of a call to glLinkProgram
, but it is not necessary for it
to have been linked successfully.
The size of the character buffer required to store the longest
attribute variable name in program
can be obtained by
calling glGetProgramiv
/
glGetProgramiv
with the
value GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
.
This value should be used to allocate a buffer of sufficient size to
store the returned attribute name. The size of this character buffer is
passed in bufSize
, and the character buffer is passed in name
.
glGetActiveAttrib
returns the name of the attribute variable indicated
by index
, storing it in the character buffer specified by name
.
The actual number of characters written into this buffer is returned in length
. If the length
of the returned string is not required, a value of null
can be passed
in the length
argument.
The type
argument will return the attribute variable's data type.
The symbolic constants GL_FLOAT
, GL_FLOAT_VEC2
, GL_FLOAT_VEC3
,
GL_FLOAT_VEC4
, GL_FLOAT_MAT2
, GL_FLOAT_MAT3
, or GL_FLOAT_MAT4
may be returned. The size
argument will return the size of the attribute,
in units of the type returned in type
.
This function will return as much information as it can about the specified
active attribute variable. If no information is available, length
will be 0,
and name
will be an empty string. This situation could occur if this function
is called after a link operation that failed. If an error occurs, the return
values length
, size
, type
,
and name
will be unmodified.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_VALUE
is generated if index
is greater than or equal to the
number of active attribute variables in program
.
GL_INVALID_VALUE
is generated if bufSize
is less than 0.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_ATTRIBS
.
glGetProgramiv
/
glGetProgramiv
with argument GL_ACTIVE_ATTRIBUTES
or GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
.
program
- Specifies the program object to be queried.index
- Specifies the index of the attribute variable to be queried.bufSize
- Specifies the maximum number of characters OpenGL is allowed to
write in the character buffer indicated by name
.length
- An int
array of length at least 1.
Returns the number of characters actually written by OpenGL
in the string indicated by name
if a value other than null
is passed. May be null
.lengthOffset
- The starting offset within the length
array.size
- An int
array of length at least 1.
Returns the size of the attribute variable. May be null
.sizeOffset
- The starting offset within the size
array.type
- An int
array of length at least 1.
Returns the data type of the attribute variable. May be null
.typeOffset
- The starting offset within the type
array.name
- Returns a byte[]
containing the name of the attribute variable.nameOffset
- The starting offset within the name
array.
IllegalArgumentException
- If length
is
non-null
but but length
.length - lengthOffset
is smaller than 1.
IllegalArgumentException
- If lengthOffset
is less than 0.
IllegalArgumentException
- If size
is
non-null
but size
.length - sizeOffset
is smaller than 1.
IllegalArgumentException
- If sizeOffset
is less than 0.
IllegalArgumentException
- If type
is
non-null
but type
.length - typeOffset
is smaller than 1.
IllegalArgumentException
- If typeOffset
is less than 0.
IllegalArgumentException
- If name
is null.
IllegalArgumentException
- If nameOffset
is less than 0.GL20.glGetActiveAttrib(int, int, int[], int, int[], int)
,
GL20.glBindAttribLocation(int, int, String)
,
GL20.glGetActiveUniform(int, int, int[], int, int[], int)
,
GL20.glLinkProgram(int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
String glGetActiveUniform(int program, int index, int[] size, int sizeOffset, int[] type, int typeOffset)
glGetActiveUniform
returns information about an active
uniform variable in the program object specified by program
.
The number of active uniform variables can be obtained by
calling glGetProgramiv
/
glGetProgramiv
with the value GL_ACTIVE_UNIFORMS
.
A value of 0 for index
selects the first active uniform variable.
Permissible values for index
range from 0 to the number of
active uniform variables minus 1.
Shaders may use either built-in uniform variables,
user-defined uniform variables, or both. Built-in uniform
variables have a prefix of "gl_" and reference existing OpenGL state
or values derived from such state (e.g., gl_DepthRange
).
User-defined uniform variables have arbitrary names and obtain
their values from the application through calls to
glUniform1f
/
glUniform1fv
/
glUniform1fv
/
glUniform1i
/
glUniform1iv
/
glUniform1iv
/
glUniform2f
/
glUniform2fv
/
glUniform2fv
/
glUniform2i
/
glUniform2iv
/
glUniform2iv
/
glUniform3f
/
glUniform3fv
/
glUniform3fv
/
glUniform3i
/
glUniform3iv
/
glUniform3iv
/
glUniform4f
/
glUniform4fv
/
glUniform4fv
/
glUniform4i
/
glUniform4iv
/
glUniform4iv
/
glUniformMatrix2fv
/
glUniformMatrix2fv
/
glUniformMatrix3fv
/
glUniformMatrix3fv
/
glUniformMatrix4fv
/
glUniformMatrix4fv
.
A uniform variable (either built-in or user-defined) is considered
active if it is determined during the link operation that it may be
accessed during program execution. Therefore, program
should have
previously been the target of a call to
glLinkProgram
, but it is not
necessary for it to have been linked successfully.
glGetActiveUniform
returns the name of the uniform variable
indicated by index
.
The type
argument will return the uniform variable's
data type. The symbolic constants GL_FLOAT
, GL_FLOAT_VEC2
,
GL_FLOAT_VEC3
, GL_FLOAT_VEC4
, GL_INT
, GL_INT_VEC2
,
GL_INT_VEC3
, GL_INT_VEC4
, GL_BOOL
, GL_BOOL_VEC2
,
GL_BOOL_VEC3
, GL_BOOL_VEC4
, GL_FLOAT_MAT2
, GL_FLOAT_MAT3
,
GL_FLOAT_MAT4
, GL_SAMPLER_2D
, or GL_SAMPLER_CUBE
may be returned.
If one or more elements of an array are active, the name of
the array is returned, the type is returned in type
,
and the size
parameter returns the highest array element
index used, plus one, as determined by the compiler and/or linker.
Only one active uniform variable will be reported for a uniform array.
Uniform variables that are declared as structures or arrays of
structures will not be returned directly by this function. Instead,
each of these uniform variables will be reduced to its fundamental
components containing the "." and "[]" operators such that each
of the names is valid as an argument to glGetUniformLocation
.
Each of these reduced uniform variables is counted as one active
uniform variable and is assigned an index. A valid name cannot
be a structure, an array of structures, or a subcomponent of a
vector or matrix.
The size of the uniform variable will be returned in size
.
Uniform variables other than arrays will have a size of 1.
Structures and arrays of structures will be reduced as described earlier,
such that each of the names returned will be a data type in the earlier list.
If this reduction results in an array, the size returned will be as described
for uniform arrays; otherwise, the size returned will be 1.
The list of active uniform variables may include both built-in uniform variables (which begin with the prefix "gl_") as well as user-defined uniform variable names.
This function will return as much information as it can about the
specified active uniform variable. If no information is available then
an empty string will be returned. This situation
could occur if this function is called after a link
operation that failed. If an error occurs, the return values
size
and type
will be unmodified and an empty string will be returned.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_VALUE
is generated if index
is greater than or equal to
the number of active uniform variables in program
.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_UNIFORM_VECTORS
or GL_MAX_FRAGMENT_UNIFORM_VECTORS
.
glGetProgramiv
/
glGetProgramiv
with argument GL_ACTIVE_UNIFORMS
or GL_ACTIVE_UNIFORM_MAX_LENGTH
.
program
- Specifies the program object to be queried.index
- Specifies the index of the uniform variable to be queried.size
- An int
array of length at least 1.
Returns the size of the uniform variable. May be null
.sizeOffset
- The starting offset within the size
array.type
- An int
array of length at least 1.
Returns the data type of the uniform variable. May be null
.typeOffset
- The starting offset within the type
array.
String
containing the name of the uniform variable.
IllegalArgumentException
- If size
is
non-null
but size
.length - sizeOffset
is smaller than 1.
IllegalArgumentException
- If sizeOffset
is less than 0.
IllegalArgumentException
- If type
is
non-null
but type
.length - typeOffset
is smaller than 1.
IllegalArgumentException
- If typeOffset
is less than 0.GL20.glGetActiveUniform(int, int, int, int[], int, int[], int, int[], int, byte[], int)
,
GL20.glGetActiveAttrib(int, int, int[], int, int[], int)
,
GL20.glGetUniformfv(int, int, int, FloatBuffer)
,
GL20.glGetUniformfv(int, int, int, float[], int)
,
GL20.glGetUniformiv(int, int, int, IntBuffer)
,
GL20.glGetUniformiv(int, int, int, int[], int)
,
GL20.glGetUniformLocation(int, String)
,
GL20.glLinkProgram(int)
,
GL20.glUniform1f(int, float)
,
GL20.glUniform1fv(int, int, FloatBuffer)
,
GL20.glUniform1fv(int, int, float[], int)
,
GL20.glUniform1i(int, int)
,
GL20.glUniform1iv(int, int, IntBuffer)
,
GL20.glUniform1iv(int, int, int[], int)
,
GL20.glUniform2f(int, float, float)
,
GL20.glUniform2fv(int, int, FloatBuffer)
,
GL20.glUniform2fv(int, int, float[], int)
,
GL20.glUniform2i(int, int, int)
,
GL20.glUniform2iv(int, int, IntBuffer)
,
GL20.glUniform2iv(int, int, int[], int)
,
GL20.glUniform3f(int, float, float, float)
,
GL20.glUniform3fv(int, int, FloatBuffer)
,
GL20.glUniform3fv(int, int, float[], int)
,
GL20.glUniform3i(int, int, int, int)
,
GL20.glUniform3iv(int, int, IntBuffer)
,
GL20.glUniform3iv(int, int, int[], int)
,
GL20.glUniform4f(int, float, float, float, float)
,
GL20.glUniform4fv(int, int, FloatBuffer)
,
GL20.glUniform4fv(int, int, float[], int)
,
GL20.glUniform4i(int, int, int, int, int)
,
GL20.glUniform4iv(int, int, IntBuffer)
,
GL20.glUniform4iv(int, int, int[], int)
,
GL20.glUniformMatrix2fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix2fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix3fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix3fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix4fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix4fv(int, int, boolean, float[], int)
,
GL20.glUseProgram(int)
void glGetActiveUniform(int program, int index, int bufSize, int[] length, int lengthOffset, int[] size, int sizeOffset, int[] type, int typeOffset, byte[] name, int nameOffset)
glGetActiveUniform
returns information about an active
uniform variable in the program object specified by program
.
The number of active uniform variables can be obtained by
calling glGetProgramiv
/
glGetProgramiv
with the value GL_ACTIVE_UNIFORMS
.
A value of 0 for index
selects the first active uniform variable.
Permissible values for index
range from 0 to the number of
active uniform variables minus 1.
Shaders may use either built-in uniform variables,
user-defined uniform variables, or both. Built-in uniform
variables have a prefix of "gl_" and reference existing OpenGL state
or values derived from such state (e.g., gl_DepthRange
).
User-defined uniform variables have arbitrary names and obtain
their values from the application through calls to
glUniform1f
/
glUniform1fv
/
glUniform1fv
/
glUniform1i
/
glUniform1iv
/
glUniform1iv
/
glUniform2f
/
glUniform2fv
/
glUniform2fv
/
glUniform2i
/
glUniform2iv
/
glUniform2iv
/
glUniform3f
/
glUniform3fv
/
glUniform3fv
/
glUniform3i
/
glUniform3iv
/
glUniform3iv
/
glUniform4f
/
glUniform4fv
/
glUniform4fv
/
glUniform4i
/
glUniform4iv
/
glUniform4iv
/
glUniformMatrix2fv
/
glUniformMatrix2fv
/
glUniformMatrix3fv
/
glUniformMatrix3fv
/
glUniformMatrix4fv
/
glUniformMatrix4fv
.
A uniform variable (either built-in or user-defined) is considered
active if it is determined during the link operation that it may be
accessed during program execution. Therefore, program
should have
previously been the target of a call to
glLinkProgram
, but it is not
necessary for it to have been linked successfully.
The size of the character buffer required to store the longest
uniform variable name in program
can be obtained by
calling glGetProgramiv
/
glGetProgramiv
with the value GL_ACTIVE_UNIFORM_MAX_LENGTH
.
This value should be used to allocate a buffer of sufficient size to
store the returned uniform variable name. The size of this character
buffer is passed in bufSize
, and the character
buffer itself is passed in name
.
glGetActiveUniform
returns the name of the uniform variable
indicated by index
, storing it in the character buffer
specified by name
.
The actual number of characters written into this buffer is
returned in length
. If the length of the returned string
is not required, a value of null
can be passed in the
length
argument.
The type
argument will return the uniform variable's
data type. The symbolic constants GL_FLOAT
, GL_FLOAT_VEC2
,
GL_FLOAT_VEC3
, GL_FLOAT_VEC4
, GL_INT
, GL_INT_VEC2
,
GL_INT_VEC3
, GL_INT_VEC4
, GL_BOOL
, GL_BOOL_VEC2
,
GL_BOOL_VEC3
, GL_BOOL_VEC4
, GL_FLOAT_MAT2
, GL_FLOAT_MAT3
,
GL_FLOAT_MAT4
, GL_SAMPLER_2D
, or GL_SAMPLER_CUBE
may be returned.
If one or more elements of an array are active, the name of
the array is returned in name
, the type is returned in type
,
and the size
parameter returns the highest array element
index used, plus one, as determined by the compiler and/or linker.
Only one active uniform variable will be reported for a uniform array.
Uniform variables that are declared as structures or arrays of
structures will not be returned directly by this function. Instead,
each of these uniform variables will be reduced to its fundamental
components containing the "." and "[]" operators such that each
of the names is valid as an argument to glGetUniformLocation
.
Each of these reduced uniform variables is counted as one active
uniform variable and is assigned an index. A valid name cannot
be a structure, an array of structures, or a subcomponent of a
vector or matrix.
The size of the uniform variable will be returned in size
.
Uniform variables other than arrays will have a size of 1.
Structures and arrays of structures will be reduced as described earlier,
such that each of the names returned will be a data type in the earlier list.
If this reduction results in an array, the size returned will be as described
for uniform arrays; otherwise, the size returned will be 1.
The list of active uniform variables may include both built-in uniform variables (which begin with the prefix "gl_") as well as user-defined uniform variable names.
This function will return as much information as it can about the
specified active uniform variable. If no information is available,
length
will be 0, and name
will be an empty string. This situation
could occur if this function is called after a link
operation that failed. If an error occurs, the return values
length
, size
, type
,
and name
will be unmodified.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_VALUE
is generated if index
is greater than or equal to
the number of active uniform variables in program
.
GL_INVALID_VALUE
is generated if bufSize
is less than 0.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_UNIFORM_VECTORS
or GL_MAX_FRAGMENT_UNIFORM_VECTORS
.
glGetProgramiv
/
glGetProgramiv
with argument GL_ACTIVE_UNIFORMS
or GL_ACTIVE_UNIFORM_MAX_LENGTH
.
program
- Specifies the program object to be queried.index
- Specifies the index of the uniform variable to be queried.bufSize
- Specifies the maximum number of characters OpenGL is
allowed to write in the character buffer indicated by name
.length
- An int
array of length at least 1.
Returns the number of characters actually written by OpenGL in the string indicated
by name
if a value other than null
is passed. May be null
.lengthOffset
- The starting offset within the length
array.size
- An int
array of length at least 1.
Returns the size of the uniform variable. May be null
.sizeOffset
- The starting offset within the size
array.type
- An int
array of length at least 1.
Returns the data type of the uniform variable. May be null
.typeOffset
- The starting offset within the type
array.name
- Returns a byte[]
containing the name of the uniform variable.nameOffset
- The starting offset within the name
array.
IllegalArgumentException
- If length
is
non-null
but length
.length - lengthOffset
is smaller than 1.
IllegalArgumentException
- If lengthOffset
is less than 0.
IllegalArgumentException
- If size
is
non-null
but size
.length - sizeOffset
is smaller than 1.
IllegalArgumentException
- If sizeOffset
is less than 0.
IllegalArgumentException
- If type
is
non-null
but type
.length - typeOffset
is smaller than 1.
IllegalArgumentException
- If typeOffset
is less than 0.
IllegalArgumentException
- If name
is null
.
IllegalArgumentException
- If nameOffset
is less than 0.GL20.glGetActiveUniform(int, int, int[], int, int[], int)
,
GL20.glGetActiveAttrib(int, int, int[], int, int[], int)
,
GL20.glGetUniformfv(int, int, int, FloatBuffer)
,
GL20.glGetUniformfv(int, int, int, float[], int)
,
GL20.glGetUniformiv(int, int, int, IntBuffer)
,
GL20.glGetUniformiv(int, int, int, int[], int)
,
GL20.glGetUniformLocation(int, String)
,
GL20.glLinkProgram(int)
,
GL20.glUniform1f(int, float)
,
GL20.glUniform1fv(int, int, FloatBuffer)
,
GL20.glUniform1fv(int, int, float[], int)
,
GL20.glUniform1i(int, int)
,
GL20.glUniform1iv(int, int, IntBuffer)
,
GL20.glUniform1iv(int, int, int[], int)
,
GL20.glUniform2f(int, float, float)
,
GL20.glUniform2fv(int, int, FloatBuffer)
,
GL20.glUniform2fv(int, int, float[], int)
,
GL20.glUniform2i(int, int, int)
,
GL20.glUniform2iv(int, int, IntBuffer)
,
GL20.glUniform2iv(int, int, int[], int)
,
GL20.glUniform3f(int, float, float, float)
,
GL20.glUniform3fv(int, int, FloatBuffer)
,
GL20.glUniform3fv(int, int, float[], int)
,
GL20.glUniform3i(int, int, int, int)
,
GL20.glUniform3iv(int, int, IntBuffer)
,
GL20.glUniform3iv(int, int, int[], int)
,
GL20.glUniform4f(int, float, float, float, float)
,
GL20.glUniform4fv(int, int, FloatBuffer)
,
GL20.glUniform4fv(int, int, float[], int)
,
GL20.glUniform4i(int, int, int, int, int)
,
GL20.glUniform4iv(int, int, IntBuffer)
,
GL20.glUniform4iv(int, int, int[], int)
,
GL20.glUniformMatrix2fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix2fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix3fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix3fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix4fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix4fv(int, int, boolean, float[], int)
,
GL20.glUseProgram(int)
void glGetAttachedShaders(int program, int maxcount, int[] count, int countOffset, int[] shaders, int shadersOffset)
glGetAttachedShaders
returns the names of the shader
objects attached to program
. The names of shader objects that are
attached to program
will be returned in shaders
.
The actual number of shader names written into shaders
is returned in count
. If no shader objects are
attached to program
, count
is set to 0.
The maximum number of shader names that may be returned in shaders
is specified by maxcount
.
If the number of names actually returned is not required
(for instance, if it has just been obtained by calling
glGetProgramiv
/
glGetProgramiv
),
a value of null
may be passed for count
.
If no shader objects are attached to program
, a value
of 0 will be returned in count
.
The actual number of attached shaders can be obtained by
calling glGetProgramiv
/
glGetProgramiv
with the value GL_ATTACHED_SHADERS
.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_VALUE
is generated if maxcount
is less than 0.
glGetProgramiv
/
glGetProgramiv
with argument GL_ATTACHED_SHADERS
program
- Specifies the program object to be queried.maxcount
- Specifies the size of the array for storing the
returned object names.count
- An int
array of length at least 1.
Returns the number of names actually returned in shaders
.
May be null
.countOffset
- The starting offset within the count
array.shaders
- Specifies an array that is used to return the
names of attached shader objects.shadersOffset
- The starting offset within the shaders
array.
IllegalArgumentException
- If countOffset
is less than 0.
IllegalArgumentException
- If count
is
non-null
but count
.length - countOffset
is smaller than 1.
IllegalArgumentException
- If shaders
is null
.
IllegalArgumentException
- If shadersOffset
is less than 0.
IllegalArgumentException
- If shaders.length -
shadersOffset
is less than n
.GL20.glAttachShader(int, int)
,
GL20.glDetachShader(int, int)
,
GL20.glGetAttachedShaders(int, int, IntBuffer, IntBuffer)
void glGetAttachedShaders(int program, int maxcount, IntBuffer count, IntBuffer shaders)
Buffer
version of
glGetAttachedShaders
.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_VALUE
is generated if maxcount
is less than 0.
program
- Specifies the program object to be queried.maxcount
- Specifies the size of the array for storing the
returned object names.count
- Specifies the buffer that is used to
return the number of names actually returned in shaders
.
May be null
.shaders
- Specifies the buffer that is used to return the
names of attached shader objects.
IllegalArgumentException
- If count
is
non-null
but count.remaining()
is less than 1.
IllegalArgumentException
- If shaders
is null
.
IllegalArgumentException
- If shaders.remaining()
is less than n
.GL20.glGetAttachedShaders(int, int, int[], int, int[], int)
int glGetAttribLocation(int program, String name)
glGetAttribLocation
queries the previously linked program object
specified by program
for the attribute variable specified by name
and returns
the index of the generic vertex attribute that is bound to that attribute variable.
If name
is a matrix attribute variable, the index of the first column of the
matrix is returned. If the named attribute variable is not an active
attribute in the specified program object or if name
starts with the
reserved prefix "gl_", a value of -1 is returned.
The association between an attribute variable name and a generic
attribute index can be specified at any time by calling
glBindAttribLocation
.
Attribute bindings do not go into effect until
glLinkProgram
is called. After a program
object has been linked successfully, the index values for attribute
variables remain fixed until the next link command occurs.
The attribute values can only be queried after a link if the
link was successful. glGetAttribLocation
returns the binding
that actually went into effect the last time glLinkProgram
was
called for the specified program object. Attribute bindings that
have been specified since the last link operation are not
returned by glGetAttribLocation
.
GL_INVALID_OPERATION
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if program
has not been successfully linked.
glGetActiveAttrib
with argument program
and the index of an active attribute
program
- Specifies the program object to be queried.name
- A string containing the name of the attribute variable whose location is to be queried.
IllegalArgumentException
- If name
is null
.GL20.glBindAttribLocation(int, int, String)
,
GL20.glLinkProgram(int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glGetBooleanv(int pname, boolean[] params, int offset)
glGetIntegerv
.
Note:
Type conversion is performed if params
has a different type
than the state variable value being requested. When glGetBooleanv
is called, a floating-point (or integer) value is converted
to GL_FALSE
if and only if it is 0.0 (or 0). Otherwise,
it is converted to GL_TRUE
.
GL_INVALID_ENUM
is generated if pname
is not one of the
values listed in the documention for GL20.glGetIntegerv(int, int[], int)
.
pname
- Specifies the parameter value to be returned.
The symbolic constants in the list above are accepted.params
- Returns the value or values of the specified parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glGetIntegerv(int, int[], int)
void glGetBooleanv(int pname, IntBuffer params)
glGetIntegerv
. A
value of 0 represents false
and a value of 1
represents true
.
GL_INVALID_ENUM
is generated if pname
is not one of the
values listed in the documention for GL20.glGetIntegerv(int, int[], int)
.
pname
- Specifies the parameter value to be returned.
The symbolic constants in the list above are accepted.params
- Returns the value or values of the specified parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the number of values required by the parameter.GL20.glGetIntegerv(int, IntBuffer)
void glGetBufferParameteriv(int target, int pname, int[] params, int offset)
glGetBufferParameteriv
returns in data
a selected
parameter of the buffer object specified by target
.
value
names a specific buffer object parameter, as follows:
GL_BUFFER_SIZE
params
returns the size of the buffer object, measured in bytes. The initial value is 0.
GL_BUFFER_USAGE
params
returns the buffer object's usage pattern. The initial value is GL_STATIC_DRAW
.
If an error is generated, no change is made to the contents of data
.
GL_INVALID_ENUM
is generated if target
or pname
is not an accepted value.
GL_INVALID_OPERATION
is generated if the reserved buffer
object name 0 is bound to target
.
target
- Specifies the target buffer object.
The symbolic constant must be GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.pname
- Specifies the symbolic name of a buffer object parameter.
Accepted values are GL_BUFFER_SIZE
or GL_BUFFER_USAGE
.params
- Returns the requested parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glBindBuffer(int, int)
,
GL20.glBufferData(int, int, Buffer, int)
,
GL20.glGetBufferParameteriv(int, int, IntBuffer)
void glGetBufferParameteriv(int target, int pname, IntBuffer params)
Buffer
version of
glGetBufferParameteriv
.
GL_INVALID_ENUM
is generated if target
or pname
is not an accepted value.
GL_INVALID_OPERATION
is generated if the reserved buffer
object name 0 is bound to target
.
target
- Specifies the target buffer object.
The symbolic constant must be GL_ARRAY_BUFFER
or GL_ELEMENT_ARRAY_BUFFER
.pname
- Specifies the symbolic name of a buffer object parameter.
Accepted values are GL_BUFFER_SIZE
or GL_BUFFER_USAGE
.params
- Returns the requested parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the number of values required by the parameter.GL20.glBindBuffer(int, int)
,
GL20.glBufferData(int, int, Buffer, int)
,
GL20.glGetBufferParameteriv(int, int, int[], int)
int glGetError()
glGetError
returns the value of the error flag. Each detectable
error is assigned a numeric code and symbolic name. When an error occurs,
the error flag is set to the appropriate error code value. No other errors are
recorded until glGetError
is called, the error code is returned, and the flag
is reset to GL_NO_ERROR
. If a call to glGetError
returns GL_NO_ERROR
,
there has been no detectable error since the last call to glGetError
,
or since the GL was initialized.
To allow for distributed implementations, there may be several error flags.
If any single error flag has recorded an error, the value of that flag is
returned and that flag is reset to GL_NO_ERROR
when glGetError
is called.
If more than one flag has recorded an error, glGetError
returns and clears
an arbitrary error flag value. Thus, glGetError
should always be
called in a loop, until it returns GL_NO_ERROR
, if all error
flags are to be reset.
Initially, all error flags are set to GL_NO_ERROR
.
The following errors are currently defined:
GL_NO_ERROR
No error has been recorded. The value of this symbolic constant is guaranteed to be 0.
GL_INVALID_ENUM
An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag.
GL_INVALID_VALUE
A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag.
GL_INVALID_OPERATION
The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag.
GL_INVALID_FRAMEBUFFER_OPERATION
The command is trying to render to or read from the framebuffer while the currently
bound framebuffer is not framebuffer complete (i.e. the return value
from glCheckFramebufferStatus
is not GL_FRAMEBUFFER_COMPLETE
). The offending command
is ignored and has no other side effect than to set the error flag.
GL_OUT_OF_MEMORY
There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded.
When an error flag is set, results of a GL operation are undefined
only if GL_OUT_OF_MEMORY
has occurred. In all other cases, the command generating
the error is ignored and has no effect on the GL state or frame buffer contents.
If the generating command returns a value, it returns 0.
GL20.glCheckFramebufferStatus(int)
void glGetFloatv(int pname, float[] params, int offset)
glGetIntegerv
.
Note:
Type conversion is performed if params
has a different type
than the state variable value being requested. When glGetFloatv
is called, boolean values are
returned as GL_TRUE
or GL_FALSE
, and integer values are
converted to floating-point values.
GL_INVALID_ENUM
is generated if pname
is not one of the
values listed in the documention for glGetIntegerv
.
pname
- Specifies the parameter value to be returned.
The symbolic constants in the list above are accepted.params
- Returns the value or values of the specified parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glGetIntegerv(int, int[], int)
void glGetFloatv(int pname, FloatBuffer params)
glGetIntegerv
.
GL_INVALID_ENUM
is generated if pname
is not one of the
values listed in the documention for glGetIntegerv
.
pname
- Specifies the parameter value to be returned.
The symbolic constants in the list above are accepted.params
- Returns the value or values of the specified parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the number of values required by the parameter.GL20.glGetIntegerv(int, IntBuffer)
void glGetFramebufferAttachmentParameteriv(int target, int attachment, int pname, int[] params, int offset)
glGetFramebufferAttachmentParameteriv
returns in params
a
selected attachment parameter of the attachpoint point attachment
of
the currently bound framebuffer object.
pname
names a specific framebuffer object attachment parameter,
as follows:
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
params
returns the type of object which contains the attached image,
either GL_RENDERBUFFER
, GL_TEXTURE
, or if no image is attached, GL_NONE
.
The initial value is GL_NONE
.
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is GL_RENDERBUFFER
,
params
returns the name of the renderbuffer object which contains the attached image.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is GL_TEXTURE
,
params
returns the name of the texture object which contains the attached image.
The initial value is zero.
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is GL_TEXTURE
,
params
returns the mipmap level of the texture object which contains
the attached image. The initial value is zero.
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
is GL_TEXTURE
and
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
is the name of a cube-map texture,
params
returns the cube map face of the cube-map texture object which
contains the attached image. If the attached image is from a texture
object but not a cube-map, params
returns 0. The initial value is
GL_TEXTURE_CUBE_MAP_POSITIVE_X
.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
GL_INVALID_ENUM
is generated if attachment
is not
GL_COLOR_ATTACHMENT0
, GL_DEPTH_ATTACHMENT
, or GL_STENCIL_ATTACHMENT
.
GL_INVALID_ENUM
is generated if the attached object at the named
attachment point is GL_RENDERBUFFER
and pname
is not
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
or GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
.
GL_INVALID_ENUM
is generated if the attached object at the named
attachment point is GL_TEXTURE
and pname
is not
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
,
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
, or
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
.
GL_INVALID_ENUM
is generated if there is no attached object
at the named attachment point and pname
is not
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
.
GL_INVALID_OPERATION
is generated if the default
framebuffer object name 0 is bound.
target
- Specifies the target framebuffer object.
The symbolic constant must be GL_FRAMEBUFFER
.attachment
- Specifies the symbolic name of a framebuffer object attachment point.
Accepted values are GL_COLOR_ATTACHMENT0
, GL_DEPTH_ATTACHMENT
,
and GL_STENCIL_ATTACHMENT
.pname
- Specifies the symbolic name of a framebuffer object attachment parameter.
Accepted values are GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
,
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
, and
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
.params
- Returns the requested parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glBindFramebuffer(int, int)
,
GL20.glFramebufferRenderbuffer(int, int, int, int)
,
GL20.glFramebufferTexture2D(int, int, int, int, int)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, IntBuffer)
void glGetFramebufferAttachmentParameteriv(int target, int attachment, int pname, IntBuffer params)
Buffer
version of
glGetFramebufferAttachmentParameteriv
.
GL_INVALID_ENUM
is generated if target
is not GL_FRAMEBUFFER
.
GL_INVALID_ENUM
is generated if attachment
is not
GL_COLOR_ATTACHMENT0
, GL_DEPTH_ATTACHMENT
, or GL_STENCIL_ATTACHMENT
.
GL_INVALID_ENUM
is generated if the attached object at the named
attachment point is GL_RENDERBUFFER
and pname
is not
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
or GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
.
GL_INVALID_ENUM
is generated if the attached object at the named
attachment point is GL_TEXTURE
and pname
is not
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
,
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
, or
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
.
GL_INVALID_ENUM
is generated if there is no attached object
at the named attachment point and pname
is not
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
.
GL_INVALID_OPERATION
is generated if the default
framebuffer object name 0 is bound.
target
- Specifies the target framebuffer object.
The symbolic constant must be GL_FRAMEBUFFER
.attachment
- Specifies the symbolic name of a framebuffer object attachment point.
Accepted values are GL_COLOR_ATTACHMENT0
, GL_DEPTH_ATTACHMENT
,
and GL_STENCIL_ATTACHMENT
.pname
- Specifies the symbolic name of a framebuffer object attachment parameter.
Accepted values are GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
,
GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
, and
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
.params
- Returns the requested parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the number of values required by the parameter.GL20.glBindFramebuffer(int, int)
,
GL20.glFramebufferRenderbuffer(int, int, int, int)
,
GL20.glFramebufferTexture2D(int, int, int, int, int)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, int[], int)
void glGetIntegerv(int pname, int[] params, int offset)
pname
is a symbolic constant indicating the state variable to be
returned, and params
is an array in which to place the returned data.
Type conversion is performed if params
has a different type
than the state variable value being requested. When glGetIntegerv
is called,
boolean values are returned as GL_TRUE
or GL_FALSE
, and most
floating-point values are rounded to the nearest integer value.
Floating-point colors and normals, however, are returned with a
linear mapping that maps 1.0 to the most positive representable
integer value and -1.0 to the most negative representable
integer value.
The following symbolic constants are accepted by pname
:
GL_ACTIVE_TEXTURE
params
returns a single value indicating the active multitexture unit.
The initial value is GL_TEXTURE0
. See glActiveTexture
.
GL_ALIASED_LINE_WIDTH_RANGE
params
returns two values, the smallest and largest supported
widths for aliased lines. The range must include width 1.
GL_ALIASED_POINT_SIZE_RANGE
params
returns two values, the smallest and largest supported
sizes for aliased points. The range must include size 1.
GL_ALPHA_BITS
params
returns one value, the number of alpha bitplanes in the
color buffer of the currently bound framebuffer.
GL_ARRAY_BUFFER_BINDING
params
returns a single value, the name of the buffer object
currently bound to the target GL_ARRAY_BUFFER
. If no buffer object
is bound to this target, 0 is returned. The initial value is 0.
See glBindBuffer
.
GL_BLEND
params
returns a single boolean value indicating whether blending
is enabled. The initial value is GL_FALSE
. See glBlendFunc
.
GL_BLEND_COLOR
params
returns four values, the red, green, blue, and alpha values
which are the components of the blend color. See glBlendColor
.
GL_BLEND_DST_ALPHA
params
returns one value, the symbolic constant identifying the
alpha destination blend function. The initial value is GL_ZERO
.
See glBlendFunc
and glBlendFuncSeparate
.
GL_BLEND_DST_RGB
params
returns one value, the symbolic constant identifying the RGB
destination blend function. The initial value is GL_ZERO
.
See glBlendFunc
and glBlendFuncSeparate
.
GL_BLEND_EQUATION_ALPHA
params
returns one value, a symbolic constant indicating whether
the Alpha blend equation is GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or
GL_FUNC_REVERSE_SUBTRACT
. See glBlendEquationSeparate
.
GL_BLEND_EQUATION_RGB
params
returns one value, a symbolic constant indicating whether
the RGB blend equation is GL_FUNC_ADD
, GL_FUNC_SUBTRACT
, or
GL_FUNC_REVERSE_SUBTRACT
. See glBlendEquationSeparate
.
GL_BLEND_SRC_ALPHA
params
returns one value, the symbolic constant identifying
the alpha source blend function. The initial value is GL_ONE
.
See glBlendFunc
and glBlendFuncSeparate
.
GL_BLEND_SRC_RGB
params
returns one value, the symbolic constant identifying
the RGB source blend function. The initial value is GL_ONE
.
See glBlendFunc
and glBlendFuncSeparate
.
GL_BLUE_BITS
params
returns one value, the number of blue bitplanes in
the color buffer of the currently bound framebuffer.
GL_COLOR_CLEAR_VALUE
params
returns four values: the red, green, blue, and alpha values
used to clear the color buffers. Integer values, if requested,
are linearly mapped from the internal floating-point representation
such that 1.0 returns the most positive representable integer
value, and -1.0 returns the most negative representable integer value.
The initial value is (0, 0, 0, 0)
. See glClearColor
.
GL_COLOR_WRITEMASK
params
returns four boolean values: the red, green, blue, and alpha
write enables for the color buffers. The initial value
is (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE)
. See glColorMask
.
GL_COMPRESSED_TEXTURE_FORMATS
params
returns a list of symbolic constants of length
GL_NUM_COMPRESSED_TEXTURE_FORMATS
indicating which
compressed texture formats are available.
See glCompressedTexImage2D
.
GL_CULL_FACE
params
returns a single boolean value indicating whether
polygon culling is enabled. The initial value is GL_FALSE
.
See glCullFace
.
GL_CULL_FACE_MODE
params
returns one value, a symbolic constant indicating
which polygon faces are to be culled. The initial value
is GL_BACK
. See glCullFace
.
GL_CURRENT_PROGRAM
params
returns one value, the name of the program object that is
currently active, or 0 if no program object is active.
See glUseProgram
.
GL_DEPTH_BITS
params
returns one value, the number of bitplanes in the
depth buffer of the currently bound framebuffer.
GL_DEPTH_CLEAR_VALUE
params
returns one value, the value that is used to clear
the depth buffer. Integer values, if requested, are linearly
mapped from the internal floating-point representation such
that 1.0 returns the most positive representable integer value,
and -1.0 returns the most negative representable integer value.
The initial value is 1. See glClearDepthf
.
GL_DEPTH_FUNC
params
returns one value, the symbolic constant that indicates
the depth comparison function. The initial value is GL_LESS
.
See glDepthFunc
.
GL_DEPTH_RANGE
params
returns two values: the near and far mapping limits for
the depth buffer. Integer values, if requested, are linearly
mapped from the internal floating-point representation such
that 1.0 returns the most positive representable integer value,
and -1.0 returns the most negative representable integer value.
The initial value is (0, 1)
. See glDepthRangef
.
GL_DEPTH_TEST
params
returns a single boolean value indicating whether depth
testing of fragments is enabled. The initial value is GL_FALSE
.
See glDepthFunc
and glDepthRangef
.
GL_DEPTH_WRITEMASK
params
returns a single boolean value indicating if the depth buffer
is enabled for writing. The initial value is GL_TRUE
.
See glDepthMask
.
GL_DITHER
params
returns a single boolean value indicating whether
dithering of fragment colors and indices is enabled.
The initial value is GL_TRUE
.
GL_ELEMENT_ARRAY_BUFFER_BINDING
params
returns a single value, the name of the buffer object
currently bound to the target GL_ELEMENT_ARRAY_BUFFER
.
If no buffer object is bound to this target, 0 is returned.
The initial value is 0. See glBindBuffer
.
GL_FRAMEBUFFER_BINDING
params
returns a single value, the name of the currently
bound framebuffer. The initial value is 0, indicating
the default framebuffer. See glBindFramebuffer
.
GL_FRONT_FACE
params
returns one value, a symbolic constant indicating
whether clockwise or counterclockwise polygon winding is
treated as front-facing. The initial value is GL_CCW
.
See glFrontFace
.
GL_GENERATE_MIPMAP_HINT
params
returns one value, a symbolic constant indicating
the mode of the mipmap generation filtering hint.
The initial value is GL_DONT_CARE
. See glHint
.
GL_GREEN_BITS
params
returns one value, the number of green
bitplanes in the color buffer of the currently
bound framebuffer.
GL_IMPLEMENTATION_COLOR_READ_FORMAT
params
returns one value, the format chosen by the
implementation in which pixels may be read from the
color buffer of the currently bound framebuffer in
conjunction with GL_IMPLEMENTATION_COLOR_READ_TYPE
.
In addition to this implementation-dependent format/type pair,
format GL_RGBA
in conjunction with type GL_UNSIGNED_BYTE
is always allowed by every implementation, regardless
of the currently bound render surface.
See glReadPixels
.
GL_IMPLEMENTATION_COLOR_READ_TYPE
params
returns one value, the type chosen by the implementation
with which pixels may be read from the color buffer of the currently
bound framebuffer in conjunction with GL_IMPLEMENTATION_COLOR_READ_FORMAT
.
In addition to this implementation-dependent format/type pair,
format GL_RGBA
in conjunction with type GL_UNSIGNED_BYTE
is
always allowed by every implementation, regardless of the
currently bound render surface. See glReadPixels
.
GL_LINE_WIDTH
params
returns one value, the line width as specified
with glLineWidth
. The initial value is 1.
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
params
returns one value, the maximum supported
texture image units that can be used to access texture
maps from the vertex shader and the fragment processor combined.
If both the vertex shader and the fragment processing stage access
the same texture image unit, then that counts as using two texture
image units against this limit. The value must be at least 8.
See glActiveTexture
.
GL_MAX_CUBE_MAP_TEXTURE_SIZE
params
returns one value. The value gives a rough estimate of the
largest cube-map texture that the GL can handle.
The value must be at least 16. See glTexImage2D
.
GL_MAX_FRAGMENT_UNIFORM_VECTORS
params
returns one value, the maximum number of four-element
floating-point, integer, or boolean vectors that can be held
in uniform variable storage for a fragment shader.
The value must be at least 16. See glUniform1f
/
glUniform1fv
/
glUniform1fv
/
glUniform1i
/
glUniform1iv
/
glUniform1iv
/
glUniform2f
/
glUniform2fv
/
glUniform2fv
/
glUniform2i
/
glUniform2iv
/
glUniform2iv
/
glUniform3f
/
glUniform3fv
/
glUniform3fv
/
glUniform3i
/
glUniform3iv
/
glUniform3iv
/
glUniform4f
/
glUniform4fv
/
glUniform4fv
/
glUniform4i
/
glUniform4iv
/
glUniform4iv
/
glUniformMatrix2fv
/
glUniformMatrix2fv
/
glUniformMatrix3fv
/
glUniformMatrix3fv
/
glUniformMatrix4fv
/
glUniformMatrix4fv
.
GL_MAX_RENDERBUFFER_SIZE
params
returns one value. The value indicates the largest
renderbuffer width and height that the GL can handle.
The value must be at least 1. See glRenderbufferStorage
.
GL_MAX_TEXTURE_IMAGE_UNITS
params
returns one value, the maximum supported texture image units
that can be used to access texture maps from the fragment shader.
The value must be at least 8. See glActiveTexture
.
GL_MAX_TEXTURE_SIZE
params
returns one value. The value gives a rough estimate of the
largest texture that the GL can handle. The value must be at least 64.
See glTexImage2D
.
GL_MAX_VARYING_VECTORS
params
returns one value, the maximum number four-element
floating-point vectors available for interpolating varying
variables used by vertex and fragment shaders. Varying variables
declared as matrices or arrays will consume multiple interpolators.
The value must be at least 8.
GL_MAX_VERTEX_ATTRIBS
params
returns one value, the maximum number of 4-component
generic vertex attributes accessible to a vertex shader.
The value must be at least 8. See glVertexAttrib1f
/
glVertexAttrib1fv
/
glVertexAttrib1fv
/
glVertexAttrib2f
/
glVertexAttrib2fv
/
glVertexAttrib2fv
/
glVertexAttrib3f
/
glVertexAttrib3fv
/
glVertexAttrib3fv
/
glVertexAttrib4f
/
glVertexAttrib4fv
/
glVertexAttrib4fv
.
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
params
returns one value, the maximum supported texture image
units that can be used to access texture maps from the vertex shader.
The value may be 0. See glActiveTexture
.
GL_MAX_VERTEX_UNIFORM_VECTORS
params
returns one value, the maximum number of four-element
floating-point, integer, or boolean vectors that can be held in
uniform variable storage for a vertex shader.
The value must be at least 128. See glUniform1f
/
glUniform1fv
/
glUniform1fv
/
glUniform1i
/
glUniform1iv
/
glUniform1iv
/
glUniform2f
/
glUniform2fv
/
glUniform2fv
/
glUniform2i
/
glUniform2iv
/
glUniform2iv
/
glUniform3f
/
glUniform3fv
/
glUniform3fv
/
glUniform3i
/
glUniform3iv
/
glUniform3iv
/
glUniform4f
/
glUniform4fv
/
glUniform4fv
/
glUniform4i
/
glUniform4iv
/
glUniform4iv
/
glUniformMatrix2fv
/
glUniformMatrix2fv
/
glUniformMatrix3fv
/
glUniformMatrix3fv
/
glUniformMatrix4fv
/
glUniformMatrix4fv
.
GL_MAX_VIEWPORT_DIMS
params
returns two values: the maximum supported
width and height of the viewport. These must be at
least as large as the visible dimensions of the display
being rendered to. See glViewport
.
GL_NUM_COMPRESSED_TEXTURE_FORMATS
params
returns a single integer value indicating the
number of available compressed texture formats.
The minimum value is 0. See glCompressedTexImage2D
.
GL_NUM_SHADER_BINARY_FORMATS
params
returns a single integer value indicating the
number of available shader binary formats.
The minimum value is 0. See glShaderBinary
/
glShaderBinary
.
GL_PACK_ALIGNMENT
params
returns one value, the byte alignment used for
writing pixel data to memory. The initial value is 4.
See glPixelStorei
.
GL_POLYGON_OFFSET_FACTOR
params
returns one value, the scaling factor used to determine
the variable offset that is added to the depth value of each fragment
generated when a polygon is rasterized. The initial value is 0.
See glPolygonOffset
.
GL_POLYGON_OFFSET_FILL
params
returns a single boolean value indicating whether polygon
offset is enabled for polygons in fill mode. The initial value is GL_FALSE
.
See glPolygonOffset
.
GL_POLYGON_OFFSET_UNITS
params
returns one value. This value is multiplied by an implementation-specific
value and then added to the depth value of each fragment generated when a polygon
is rasterized. The initial value is 0. See glPolygonOffset
.
GL_RED_BITS
params
returns one value, the number of red bitplanes in the
color buffer of the currently bound framebuffer.
GL_RENDERBUFFER_BINDING
params
returns a single value, the name of the currently bound renderbuffer.
The initial value is 0, indicating no renderbuffer is bound. See glBindRenderbuffer
.
GL_SAMPLE_ALPHA_TO_COVERAGE
params
returns a single boolean value indicating if the fragment coverage value
should be AND
ed with a temporary coverage value based on the fragment's alpha value.
The initial value is GL_FALSE
. See glSampleCoverage
.
GL_SAMPLE_BUFFERS
params
returns a single integer value indicating the number of sample buffers
associated with the currently bound framebuffer. See glSampleCoverage
.
GL_SAMPLE_COVERAGE
params
returns a single boolean value indicating if the fragment coverage value
should be AND
ed with a temporary coverage value based on the current sample coverage value.
The initial value is GL_FALSE
. See glSampleCoverage
.
GL_SAMPLE_COVERAGE_INVERT
params
returns a single boolean value indicating if the
temporary coverage value should be inverted. See glSampleCoverage
.
GL_SAMPLE_COVERAGE_VALUE
params
returns a single positive floating-point value indicating
the current sample coverage value. See glSampleCoverage
.
GL_SAMPLES
params
returns a single integer value indicating the coverage mask
size of the currently bound framebuffer. See glSampleCoverage
.
GL_SCISSOR_BOX
params
returns four values: the x and y window coordinates of the scissor box,
followed by its width and height. Initially the x and y window coordinates are
both 0 and the width and height are set to the size of the window. See glScissor
.
GL_SCISSOR_TEST
params
returns a single boolean value indicating whether scissoring is enabled.
The initial value is GL_FALSE
. See glScissor
.
GL_SHADER_BINARY_FORMATS
params
returns a list of symbolic constants of length GL_NUM_SHADER_BINARY_FORMATS
indicating which shader binary formats are available.
See glShaderBinary
/
glShaderBinary
.
GL_SHADER_COMPILER
params
returns a single boolean value indicating whether a shader compiler
is supported. GL_FALSE
indicates that any call to
glShaderSource
, glCompileShader
,
or glReleaseShaderCompiler
will
result in a GL_INVALID_OPERATION
error being generated.
GL_STENCIL_BACK_FAIL
params
returns one value, a symbolic constant indicating what action
is taken for back-facing polygons when the stencil test fails.
The initial value is GL_KEEP
. See glStencilOpSeparate
.
GL_STENCIL_BACK_FUNC
params
returns one value, a symbolic constant indicating what
function is used for back-facing polygons to compare the stencil reference
value with the stencil buffer value. The initial value is GL_ALWAYS
.
See glStencilFuncSeparate
.
GL_STENCIL_BACK_PASS_DEPTH_FAIL
params
returns one value, a symbolic constant indicating what action is
taken for back-facing polygons when the stencil test passes, but the depth
test fails. The initial value is GL_KEEP
.
See glStencilOpSeparate
.
GL_STENCIL_BACK_PASS_DEPTH_PASS
params
returns one value, a symbolic constant indicating what action is
taken for back-facing polygons when the stencil test passes and the
depth test passes. The initial value is GL_KEEP
.
See glStencilOpSeparate
.
GL_STENCIL_BACK_REF
params
returns one value, the reference value that is compared
with the contents of the stencil buffer for back-facing polygons.
The initial value is 0. See glStencilFuncSeparate
.
GL_STENCIL_BACK_VALUE_MASK
params
returns one value, the mask that is used for back-facing
polygons to mask both the stencil reference value and the stencil
buffer value before they are compared.
The initial value is all 1's. See glStencilFuncSeparate
.
GL_STENCIL_BACK_WRITEMASK
params
returns one value, the mask that controls writing of the
stencil bitplanes for back-facing polygons. The initial value
is all 1's. See glStencilMaskSeparate
.
GL_STENCIL_BITS
params
returns one value, the number of bitplanes in
the stencil buffer of the currently bound framebuffer.
GL_STENCIL_CLEAR_VALUE
params
returns one value, the index to which the stencil
bitplanes are cleared. The initial value is 0.
See glClearStencil
.
GL_STENCIL_FAIL
params
returns one value, a symbolic constant indicating what
action is taken when the stencil test fails for front-facing
polygons and non-polygons. The initial value is GL_KEEP
.
See glStencilOp
and
glStencilOpSeparate
.
GL_STENCIL_FUNC
params
returns one value, a symbolic constant indicating what
function is used to compare the stencil reference value with
the stencil buffer value for front-facing polygons and non-polygons.
The initial value is GL_ALWAYS
. See glStencilFunc
and glStencilFuncSeparate
.
GL_STENCIL_PASS_DEPTH_FAIL
params
returns one value, a symbolic constant indicating what action is
taken when the stencil test passes, but the depth test fails for
front-facing polygons and non-polygons. The initial value is GL_KEEP
.
See glStencilOp
and
glStencilOpSeparate
.
GL_STENCIL_PASS_DEPTH_PASS
params
returns one value, a symbolic constant indicating what action
is taken when the stencil test passes and the depth test passes for
front-facing polygons and non-polygons. The initial value is GL_KEEP
.
See glStencilOp
and
glStencilOpSeparate
.
GL_STENCIL_REF
params
returns one value, the reference value that is
compared with the contents of the stencil buffer for front-facing
polygons and non-polygons. The initial value is 0.
See glStencilFunc
and
glStencilFuncSeparate
.
GL_STENCIL_TEST
params
returns a single boolean value indicating whether stencil
testing of fragments is enabled. The initial value is GL_FALSE
.
See glStencilFunc
and glStencilOp
.
GL_STENCIL_VALUE_MASK
params
returns one value, the mask that is used to mask both
the stencil reference value and the stencil buffer value before
they are compared for front-facing polygons and non-polygons.
The initial value is all 1's.
See glStencilFunc
and
glStencilFuncSeparate
.
GL_STENCIL_WRITEMASK
params
returns one value, the mask that controls writing of the
stencil bitplanes for front-facing polygons and non-polygons.
The initial value is all 1's.
See glStencilMask
and glStencilMaskSeparate
.
GL_SUBPIXEL_BITS
params
returns one value, an estimate of the number of
bits of subpixel resolution that are used to position
rasterized geometry in window coordinates.
The value must be at least 4.
GL_TEXTURE_BINDING_2D
params
returns a single value, the name of the texture
currently bound to the target GL_TEXTURE_2D
for the active
multitexture unit. The initial value is 0. See glBindTexture
.
GL_TEXTURE_BINDING_CUBE_MAP
params
returns a single value, the name of the texture
currently bound to the target GL_TEXTURE_CUBE_MAP
for
the active multitexture unit. The initial value is 0.
See glBindTexture
.
GL_UNPACK_ALIGNMENT
params
returns one value, the byte alignment used for
reading pixel data from memory. The initial value is 4.
See glPixelStorei
.
GL_VIEWPORT
params
returns four values: the x and y window coordinates
of the viewport, followed by its width and height.
Initially the x and y window coordinates are both set to 0,
and the width and height are set to the width and height
of the window into which the GL will do its rendering.
See glViewport
.
Many of the boolean parameters can also be queried more
easily using glIsEnabled
.
GL_INVALID_ENUM
is generated if pname
is not one of the values listed previously.
pname
- Specifies the parameter value to be returned.
The symbolic constants in the list above are accepted.params
- Returns the value or values of the specified parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values
required by the parameter.GL20.glGetActiveAttrib(int, int, int[], int, int[], int)
,
GL20.glGetActiveUniform(int, int, int[], int, int[], int)
,
GL20.glGetAttachedShaders(int, int, IntBuffer, IntBuffer)
,
GL20.glGetAttachedShaders(int, int, int[], int, int[], int)
,
GL20.glGetAttribLocation(int, String)
,
GL20.glGetBufferParameteriv(int, int, IntBuffer)
,
GL20.glGetBufferParameteriv(int, int, int[], int)
,
GL20.glGetError()
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, IntBuffer)
,
GL20.glGetFramebufferAttachmentParameteriv(int, int, int, int[], int)
,
GL20.glGetProgramiv(int, int, IntBuffer)
,
GL20.glGetProgramiv(int, int, int[], int)
,
GL20.glGetProgramInfoLog(int)
,
GL20.glGetRenderbufferParameteriv(int, int, IntBuffer)
,
GL20.glGetRenderbufferParameteriv(int, int, int[], int)
,
GL20.glGetShaderiv(int, int, IntBuffer)
,
GL20.glGetShaderiv(int, int, int[], int)
,
GL20.glGetShaderInfoLog(int)
,
GL20.glGetShaderSource(int, int, int[], byte[])
,
GL20.glGetString(int)
,
GL20.glGetTexParameterfv(int, int, FloatBuffer)
,
GL20.glGetTexParameterfv(int, int, float[], int)
,
GL20.glGetTexParameteriv(int, int, IntBuffer)
,
GL20.glGetTexParameteriv(int, int, int[], int)
,
GL20.glGetUniformfv(int, int, int, FloatBuffer)
,
GL20.glGetUniformfv(int, int, int, float[], int)
,
GL20.glGetUniformiv(int, int, int, IntBuffer)
,
GL20.glGetUniformiv(int, int, int, int[], int)
,
GL20.glGetUniformLocation(int, String)
,
GL20.glGetVertexAttribfv(int, int, FloatBuffer)
,
GL20.glGetVertexAttribfv(int, int, float[], int)
,
GL20.glGetVertexAttribiv(int, int, IntBuffer)
,
GL20.glGetVertexAttribiv(int, int, int[], int)
,
GL20.glIsEnabled(int)
void glGetIntegerv(int pname, IntBuffer params)
Buffer
version of glGetIntegerv
.
GL_INVALID_ENUM
is generated if pname
is not one of the
values listed in the documention for glGetIntegerv
.
pname
- Specifies the parameter value to be returned.
The symbolic constants in the list above are accepted.params
- Returns the value or values of the specified parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetIntegerv(int, int[], int)
void glGetProgramiv(int program, int pname, int[] params, int offset)
glGetProgramiv
returns in params
the value of a parameter
for a specific program object. The following parameters are defined:
GL_DELETE_STATUS
params
returns GL_TRUE
if program
is currently flagged
for deletion, and GL_FALSE
otherwise.
GL_LINK_STATUS
params
returns GL_TRUE
if the last link operation on program
was successful, and GL_FALSE
otherwise.
GL_VALIDATE_STATUS
params
returns GL_TRUE
or if the last validation operation
on program
was successful, and GL_FALSE
otherwise.
GL_INFO_LOG_LENGTH
params
returns the number of characters in the information log for
program
(i.e., the size of the
character buffer required to store the information log).
If program
has no information log, a value of 0 is returned.
GL_ATTACHED_SHADERS
params
returns the number of shader objects attached to program
.
GL_ACTIVE_ATTRIBUTES
params
returns the number of active attribute variables for program
.
GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
params
returns the length of the longest active attribute name for program
,
(i.e., the size of the character buffer required to store the longest attribute name).
If no active attributes exist, 0 is returned.
GL_ACTIVE_UNIFORMS
params
returns the number of active uniform variables for program
.
GL_ACTIVE_UNIFORM_MAX_LENGTH
params
returns the length of the longest active uniform variable name
for program
, (i.e., the
size of the character buffer required to store the longest uniform
variable name). If no active uniform variables exist, 0 is returned.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_ENUM
is generated if pname
is not an
accepted value.
GL_INVALID_VALUE
is generated if program
is
not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
does not refer to a program object.
glGetActiveAttrib
with argument program
glGetActiveUniform
with argument program
glGetAttachedShaders
/
glGetAttachedShaders
with argument program
glGetProgramInfoLog
with argument program
program
- Specifies the program object to be queried.pname
- Specifies the object parameter. Accepted symbolic names are
GL_DELETE_STATUS
, GL_LINK_STATUS
, GL_VALIDATE_STATUS
, GL_INFO_LOG_LENGTH
,
GL_ATTACHED_SHADERS
, GL_ACTIVE_ATTRIBUTES
, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
,
GL_ACTIVE_UNIFORMS
, GL_ACTIVE_UNIFORM_MAX_LENGTH
.params
- Returns the requested object parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values
required by the parameter.GL20.glAttachShader(int, int)
,
GL20.glCreateProgram()
,
GL20.glDeleteProgram(int)
,
GL20.glGetProgramiv(int, int, IntBuffer)
,
GL20.glGetShaderiv(int, int, IntBuffer)
,
GL20.glGetShaderiv(int, int, int[], int)
,
GL20.glLinkProgram(int)
,
GL20.glValidateProgram(int)
void glGetProgramiv(int program, int pname, IntBuffer params)
Buffer
version of glGetProgramiv
.
GL_INVALID_ENUM
is generated if pname
is not an
accepted value.
GL_INVALID_VALUE
is generated if program
is
not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
does not refer to a program object.
program
- Specifies the program object to be queried.pname
- Specifies the object parameter. Accepted symbolic names are
GL_DELETE_STATUS
, GL_LINK_STATUS
, GL_VALIDATE_STATUS
, GL_INFO_LOG_LENGTH
,
GL_ATTACHED_SHADERS
, GL_ACTIVE_ATTRIBUTES
, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
,
GL_ACTIVE_UNIFORMS
, GL_ACTIVE_UNIFORM_MAX_LENGTH
.params
- Returns the requested object parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetProgramiv(int, int, int[], int)
String glGetProgramInfoLog(int program)
glGetProgramInfoLog
returns the information log for
the specified program object. The information log for a program
object is modified when the program object is linked or validated.
The information log for a program object is either an empty string, or a string containing information about the last link operation, or a string containing information about the last validation operation. It may contain diagnostic messages, warning messages, and other information. When a program object is created, its information log will be a string of length 0.
The information log for a program object is the OpenGL implementer's primary mechanism for conveying information about linking and validating. Therefore, the information log can be helpful to application developers during the development process, even when these operations are successful. Application developers should not expect different OpenGL implementations to produce identical information logs.
GL_INVALID_VALUE
if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
glGetProgramiv
/glGetProgramiv
with argument GL_INFO_LOG_LENGTH
program
- Specifies the program object whose information log is to be queried.
String
containing the information log.GL20.glCompileShader(int)
,
GL20.glGetShaderInfoLog(int)
,
GL20.glLinkProgram(int)
,
GL20.glValidateProgram(int)
void glGetProgramInfoLog(int program, int maxsize, int[] length, byte[] infolog)
glGetProgramInfoLog
returns the information log for
the specified program object. The information log for a program
object is modified when the program object is linked or validated.
glGetProgramInfoLog
returns in infolog
as much of the
information log as it can, up to a maximum of maxsize
characters.
The number of characters actually returned is specified by length
.
If the length of the returned string is not required, a value of null
can be passed in
the length
argument. The size of the buffer required to store
the returned information log can be obtained by
calling glGetProgramiv
/
glGetProgramiv
with the value GL_INFO_LOG_LENGTH
.
The information log for a program object is either an empty string, or a string containing information about the last link operation, or a string containing information about the last validation operation. It may contain diagnostic messages, warning messages, and other information. When a program object is created, its information log will be a string of length 0.
The information log for a program object is the OpenGL implementer's primary mechanism for conveying information about linking and validating. Therefore, the information log can be helpful to application developers during the development process, even when these operations are successful. Application developers should not expect different OpenGL implementations to produce identical information logs.
GL_INVALID_VALUE
if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_VALUE
is generated if maxsize
is less than 0.
glGetProgramiv
/glGetProgramiv
with argument GL_INFO_LOG_LENGTH
program
- Specifies the program object whose information log is to be queried.maxsize
- Specifies the size of the character buffer for storing the returned information log.length
- Returns (in the first element of the array) the length of the string returned in infolog
.
If non-null
, it must have length at least 1. May be null
.infolog
- Specifies an array of characters that is used to return the information log.
IllegalArgumentException
- If length
is
non-null
but has length less than 1.
IllegalArgumentException
- If infolog
is null
.GL20.glCompileShader(int)
,
GL20.glGetShaderInfoLog(int, int, int[], byte[])
,
GL20.glLinkProgram(int)
,
GL20.glValidateProgram(int)
void glGetRenderbufferParameteriv(int target, int pname, int[] params, int offset)
glGetRenderbufferParameteriv
returns in params
a selected
parameter of the currently bound renderbuffer object.
pname
names a specific renderbuffer object parameter, as follows:
GL_RENDERBUFFER_WIDTH
params
returns the width in pixels of the image of the currently
bound renderbuffer. The initial value is 0.
GL_RENDERBUFFER_HEIGHT
params
returns the height in pixels of the image of the currently
bound renderbuffer. The initial value is 0.
GL_RENDERBUFFER_INTERNAL_FORMAT
params
returns the internal format of the image of the currently
bound renderbuffer. The initial value is GL_RGBA4
.
GL_RENDERBUFFER_RED_SIZE
params
returns the resolution in bits for the red component of the
image of the currently bound renderbuffer. The initial value is 0.
GL_RENDERBUFFER_GREEN_SIZE
params
returns the resolution in bits for the green component of the
image of the currently bound renderbuffer. The initial value is 0.
GL_RENDERBUFFER_BLUE_SIZE
params
returns the resolution in bits for the blue component of the
image of the currently bound renderbuffer. The initial value is 0.
GL_RENDERBUFFER_ALPHA_SIZE
params
returns the resolution in bits for the alpha component of the
image of the currently bound renderbuffer. The initial value is 0.
GL_RENDERBUFFER_DEPTH_SIZE
params
returns the resolution in bits for the depth component of the
image of the currently bound renderbuffer. The initial value is 0.
GL_RENDERBUFFER_STENCIL_SIZE
params
returns the resolution in bits for the stencil component of the
image of the currently bound renderbuffer. The initial value is 0.
The resolution of components reported by glGetRenderbufferParameteriv
are the actual resolutions at which the components are stored,
which may be different than those requested by the internalformat
parameter of glRenderbufferStorage
.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
GL_INVALID_ENUM
is generated if pname
is not GL_RENDERBUFFER_WIDTH
,
GL_RENDERBUFFER_HEIGHT
, GL_RENDERBUFFER_INTERNAL_FORMAT
,
GL_RENDERBUFFER_RED_SIZE
, GL_RENDERBUFFER_GREEN_SIZE
,
GL_RENDERBUFFER_BLUE_SIZE
, GL_RENDERBUFFER_ALPHA_SIZE
,
GL_RENDERBUFFER_DEPTH_SIZE
, or GL_RENDERBUFFER_STENCIL_SIZE
.
GL_INVALID_OPERATION
is generated if the reserved
renderbuffer object name 0 is bound.
target
- Specifies the target renderbuffer object.
The symbolic constant must be GL_RENDERBUFFER
.pname
- Specifies the symbolic name of a renderbuffer
object parameter. Accepted values are GL_RENDERBUFFER_WIDTH
,
GL_RENDERBUFFER_HEIGHT
, GL_RENDERBUFFER_INTERNAL_FORMAT
,
GL_RENDERBUFFER_RED_SIZE
, GL_RENDERBUFFER_GREEN_SIZE
,
GL_RENDERBUFFER_BLUE_SIZE
, GL_RENDERBUFFER_ALPHA_SIZE
,
GL_RENDERBUFFER_DEPTH_SIZE
, or GL_RENDERBUFFER_STENCIL_SIZE
params
- Returns the requested parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glBindRenderbuffer(int, int)
,
GL20.glGetRenderbufferParameteriv(int, int, IntBuffer)
,
GL20.glRenderbufferStorage(int, int, int, int)
void glGetRenderbufferParameteriv(int target, int pname, IntBuffer params)
Buffer
version of
glGetRenderbufferParameteriv
.
GL_INVALID_ENUM
is generated if target
is not GL_RENDERBUFFER
.
GL_INVALID_ENUM
is generated if pname
is not GL_RENDERBUFFER_WIDTH
,
GL_RENDERBUFFER_HEIGHT
, GL_RENDERBUFFER_INTERNAL_FORMAT
,
GL_RENDERBUFFER_RED_SIZE
, GL_RENDERBUFFER_GREEN_SIZE
,
GL_RENDERBUFFER_BLUE_SIZE
, GL_RENDERBUFFER_ALPHA_SIZE
,
GL_RENDERBUFFER_DEPTH_SIZE
, or GL_RENDERBUFFER_STENCIL_SIZE
.
GL_INVALID_OPERATION
is generated if the reserved
renderbuffer object name 0 is bound.
target
- Specifies the target renderbuffer object.
The symbolic constant must be GL_RENDERBUFFER
.pname
- Specifies the symbolic name of a renderbuffer
object parameter. Accepted values are GL_RENDERBUFFER_WIDTH
,
GL_RENDERBUFFER_HEIGHT
, GL_RENDERBUFFER_INTERNAL_FORMAT
,
GL_RENDERBUFFER_RED_SIZE
, GL_RENDERBUFFER_GREEN_SIZE
,
GL_RENDERBUFFER_BLUE_SIZE
, GL_RENDERBUFFER_ALPHA_SIZE
,
GL_RENDERBUFFER_DEPTH_SIZE
, or GL_RENDERBUFFER_STENCIL_SIZE
params
- Returns the requested parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetRenderbufferParameteriv(int, int, int[], int)
void glGetShaderiv(int shader, int pname, int[] params, int offset)
glGetShaderiv
returns in params
the value of a parameter
for a specific shader object. The following parameters are defined:
GL_SHADER_TYPE
params
returns GL_VERTEX_SHADER
if shader
is a vertex shader object,
and GL_FRAGMENT_SHADER
if shader
is a fragment shader object.
GL_DELETE_STATUS
params
returns GL_TRUE
if shader
is currently flagged for deletion,
and GL_FALSE
otherwise.
GL_COMPILE_STATUS
For implementations that support a shader compiler, params
returns
GL_TRUE
if the last compile operation on shader
was successful,
and GL_FALSE
otherwise.
GL_INFO_LOG_LENGTH
For implementations that support a shader compiler,
params
returns the number of characters in the information log for
shader
(i.e., the size of
the character buffer required to store the information log).
If shader
has no information log, a value of 0 is returned.
GL_SHADER_SOURCE_LENGTH
For implementations that support a shader compiler,
params
returns the length of the concatenation of the source
strings that make up the shader source for shader
(i.e., the size of the
character buffer required to store the shader source).
If no source code exists, 0 is returned.
Shader compiler support is optional, and thus must be queried before use by calling
glGetIntegerv
/glGetIntegerv
with argument GL_SHADER_COMPILER
. glShaderSource
,
glCompileShader
,
glGetShaderPrecisionFormat
,
and glReleaseShaderCompiler
will each generate GL_INVALID_OPERATION
on implementations that do not support a shader compiler, as
will glGetShaderiv
queries of GL_COMPILE_STATUS
, GL_INFO_LOG_LENGTH
,
and GL_SHADER_SOURCE_LENGTH
. Such implementations instead offer
the glShaderBinary
/
glShaderBinary
alternative for supplying a pre-compiled shader binary.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_ENUM
is generated if pname
is not an accepted value.
GL_INVALID_VALUE
is generated if shader
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if pname
is GL_COMPILE_STATUS
,
GL_INFO_LOG_LENGTH
, or GL_SHADER_SOURCE_LENGTH
but a shader compiler is not supported.
GL_INVALID_OPERATION
is generated if shader
does not
refer to a shader object.
glGetIntegerv
/glGetIntegerv
with argument GL_SHADER_COMPILER
glGetShaderInfoLog
with argument shader
glGetShaderSource
with argument shader
shader
- Specifies the shader object to be queried.pname
- Specifies the object parameter. Accepted symbolic
names are GL_SHADER_TYPE
, GL_DELETE_STATUS
, GL_COMPILE_STATUS
,
GL_INFO_LOG_LENGTH
, GL_SHADER_SOURCE_LENGTH
.params
- Returns the requested object parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glCompileShader(int)
,
GL20.glCreateShader(int)
,
GL20.glDeleteShader(int)
,
GL20.glGetProgramiv(int, int, IntBuffer)
,
GL20.glGetProgramiv(int, int, int[], int)
,
GL20.glShaderSource(int, int, String[], int[])
,
GL20.glShaderBinary(int, IntBuffer, int, Buffer, int)
,
GL20.glShaderBinary(int, int[], int, int, Buffer, int)
void glGetShaderiv(int shader, int pname, IntBuffer params)
Buffer
version of glGetShaderiv
.
GL_INVALID_ENUM
is generated if pname
is not an accepted value.
GL_INVALID_VALUE
is generated if shader
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if pname
is GL_COMPILE_STATUS
,
GL_INFO_LOG_LENGTH
, or GL_SHADER_SOURCE_LENGTH
but a shader compiler is not supported.
GL_INVALID_OPERATION
is generated if shader
does not
refer to a shader object.
shader
- Specifies the shader object to be queried.pname
- Specifies the object parameter. Accepted symbolic
names are GL_SHADER_TYPE
, GL_DELETE_STATUS
, GL_COMPILE_STATUS
,
GL_INFO_LOG_LENGTH
, GL_SHADER_SOURCE_LENGTH
.params
- Returns the requested object parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetShaderiv(int, int, int[], int)
String glGetShaderInfoLog(int shader)
glGetShaderInfoLog
returns the information log for the
specified shader object. The information log for a shader object is
modified when the shader is compiled.
The information log for a shader object is a string that may contain diagnostic messages, warning messages, and other information about the last compile operation. When a shader object is created, its information log will be a string of length 0.
The information log for a shader object is the OpenGL implementer's primary mechanism for conveying information about the compilation process. Therefore, the information log can be helpful to application developers during the development process, even when compilation is successful. Application developers should not expect different OpenGL implementations to produce identical information logs.
GL_INVALID_VALUE
is generated if shader
is not a
value generated by OpenGL.
GL_INVALID_OPERATION
is generated if shader
is
not a shader object.
glGetShaderiv
/glGetShaderiv
with argument GL_INFO_LOG_LENGTH
shader
- Specifies the shader object whose
information log is to be queried.
String
containing the information log.GL20.glCompileShader(int)
,
GL20.glGetProgramInfoLog(int)
,
GL20.glLinkProgram(int)
,
GL20.glValidateProgram(int)
void glGetShaderInfoLog(int shader, int maxsize, int[] length, byte[] infolog)
glGetShaderInfoLog
returns the information log for the
specified shader object. The information log for a shader object is
modified when the shader is compiled.
glGetShaderInfoLog
returns in infolog
as much of the
information log as it can, up to a maximum of maxsize
characters.
The number of characters actually returned is specified by length
. If the length of the
returned string is not required, a value of null
can be passed in the
length
argument. The size of the buffer required to store the
returned information log can be obtained by
calling glGetShaderiv
/
glGetShaderiv
with the value GL_INFO_LOG_LENGTH
.
The information log for a shader object is a string that may contain diagnostic messages, warning messages, and other information about the last compile operation. When a shader object is created, its information log will be a string of length 0.
The information log for a shader object is the OpenGL implementer's primary mechanism for conveying information about the compilation process. Therefore, the information log can be helpful to application developers during the development process, even when compilation is successful. Application developers should not expect different OpenGL implementations to produce identical information logs.
GL_INVALID_VALUE
is generated if shader
is not a
value generated by OpenGL.
GL_INVALID_OPERATION
is generated if shader
is
not a shader object.
GL_INVALID_VALUE
is generated if maxsize
is less than 0.
glGetShaderiv
/glGetShaderiv
with argument GL_INFO_LOG_LENGTH
shader
- Specifies the shader object whose
information log is to be queried.maxsize
- Specifies the size of the character
buffer for storing the returned information log.length
- Returns the length of the string returned in infolog
.
If non-null
, it must have length at least 1. May be null
.infolog
- Specifies an array of characters
that is used to return the information log.
IllegalArgumentException
- If length
is
non-null
but has length less than 1.
IllegalArgumentException
- If infolog
is null
.GL20.glCompileShader(int)
,
GL20.glGetProgramInfoLog(int, int, int[], byte[])
,
GL20.glLinkProgram(int)
,
GL20.glValidateProgram(int)
void glGetShaderPrecisionFormat(int shadertype, int precisiontype, int[] range, int rangeOffset, int[] precision, int precisionOffset)
glGetShaderPrecisionFormat
returns range and precision
limits for floating-point and integer shader variable formats with
low, medium, and high precision qualifiers. When minRep
and maxRep
are the minimum and maximum representable values of the format,
floor(log_2(|minRep|))
and floor(log_2(|maxRep|))
are returned in
range
as the first and second elements, respectively.
If the smallest representable value greater
than 1 is (1 + ϵ)
then floor(-log_2(ϵ))
is returned in precision
.
An integer format will have an ϵ
of 1, and thus will return 0.
Floating-point formats will return values greater than 0.
The minimum range and precision required for different formats is described in the OpenGL ES Shading Language Specification.
If a high precision floating-point format is not supported for
fragment shaders, calling glGetShaderPrecisionFormat
with
arguments GL_FRAGMENT_SHADER
and GL_HIGH_FLOAT
will return 0
for both range
and precision
. Support for a high precision
floating-point format is mandatory for vertex shaders.
Shader compiler support is optional, and thus must be
queried before use by calling glGetIntegerv
/
glGetIntegerv
with argument
GL_SHADER_COMPILER
. glShaderSource
,
glCompileShader
, glGetShaderPrecisionFormat
,
and glReleaseShaderCompiler
will each generate GL_INVALID_OPERATION
on implementations
that do not support a shader compiler. Such implementations
instead offer the glShaderBinary
/
glShaderBinary
alternative for supplying
a pre-compiled shader binary.
If an error is generated, no change is made to the
contents of range
or precision
.
GL_INVALID_OPERATION
is generated if a
shader compiler is not supported.
GL_INVALID_ENUM
is generated if shadertype
or
precisiontype
is not an accepted value.
glGetIntegerv
/glGetIntegerv
with argument GL_SHADER_COMPILER
shadertype
- Specifies the type of shader to query.
Must be either GL_VERTEX_SHADER
or GL_FRAGMENT_SHADER
.precisiontype
- Specifies the numeric format to query,
corresponding to a shader precision qualifier and variable type.
Must be one of GL_LOW_FLOAT
, GL_MEDIUM_FLOAT
, GL_HIGH_FLOAT
,
GL_LOW_INT
, GL_MEDIUM_INT
, or GL_HIGH_INT
.range
- An int
array of length at least 2.
Specifies the two-element array in which the log_2
of the minimum and maximum representable
magnitudes of the format are returned. May be null
.rangeOffset
- The starting offset within the range
array.precision
- An int
array of length at least 1.
Specifies the one-element array in which the log_2
of the
precision of the format is returned. May be null
.precisionOffset
- The starting offset within the precision
array.
IllegalArgumentException
- If rangeOffset
is less than 0.
IllegalArgumentException
- If range
is
non-null
but range
.length - rangeOffset
is smaller than 2.
IllegalArgumentException
- If precisionOffset
is less than 0.
IllegalArgumentException
- If precision
is
non-null
but but precision
.length - precisionOffset
is smaller than 1.GL20.glCompileShader(int)
,
GL20.glShaderSource(int, int, String[], int[])
String glGetShaderSource(int shader)
glGetShaderSource
returns the concatenation of the source
code strings from the shader object specified by shader
. The source
code strings for a shader object are the result of a previous
call to glShaderSource
.
GL_INVALID_VALUE
is generated if shader
is not a
value generated by OpenGL.
GL_INVALID_OPERATION
is generated if shader
is not a
shader object.
glGetShaderiv
/glGetShaderiv
with argument GL_SHADER_SOURCE_LENGTH
shader
- Specifies the shader object to be queried.
String
containing the shader source.GL20.glCreateShader(int)
,
GL20.glShaderSource(int, int, String[], int[])
void glGetShaderSource(int shader, int bufSize, int[] length, byte[] source)
glGetShaderSource
returns the concatenation of the source
code strings from the shader object specified by shader
. The source
code strings for a shader object are the result of a previous
call to glShaderSource
.
glGetShaderSource
returns in source
as much of the source
code string as it can, up to a maximum of bufSize
characters.
The number of characters actually returned is specified by length
.
If the length of the returned string is not required, a
value of null
can be passed in the length
argument.
The size of the buffer required to store the returned
source code string can be obtained by calling glGetShaderiv
/
glGetShaderiv
with the value GL_SHADER_SOURCE_LENGTH
.
GL_INVALID_VALUE
is generated if shader
is not a
value generated by OpenGL.
GL_INVALID_OPERATION
is generated if shader
is not a
shader object.
GL_INVALID_VALUE
is generated if bufSize
is
less than 0.
glGetShaderiv
/glGetShaderiv
with argument GL_SHADER_SOURCE_LENGTH
shader
- Specifies the shader object to be queried.bufSize
- Specifies the size of the character buffer for
storing the returned source code string.length
- Returns the length of the string returned in source
.
If non-null
, it must have length at least 1. May be null
.source
- Specifies an array of characters that is used to
return the source code string.
IllegalArgumentException
- If length
is
non-null
but has length less than 1.
IllegalArgumentException
- If source
is null
.GL20.glCreateShader(int)
,
GL20.glShaderSource(int, int, String[], int[])
String glGetString(int name)
String
object.
glGetString
returns a string describing some aspect
of the current GL connection. name
can be one of the following:
GL_VENDOR
Returns the company responsible for this GL implementation. This name does not change from release to release.
GL_RENDERER
Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release.
GL_VERSION
Returns a version or release number of the form
OpenGL<space>ES<space><version number><space><vendor-specific information>
.
GL_SHADING_LANGUAGE_VERSION
Returns a version or release number for the shading language of the form
OpenGL<space>ES<space>GLSL<space>ES<space><version number><space><vendor-specific information>
.
GL_EXTENSIONS
Returns a space-separated list of supported extensions to GL.
Because the GL does not include queries for the performance
characteristics of an implementation, some applications are
written to recognize known platforms and modify their GL usage
based on known performance characteristics of these platforms.
Strings GL_VENDOR
and GL_RENDERER
together uniquely specify a platform.
They do not change from release to release and should be used by
platform-recognition algorithms.
Some applications want to make use of features that are not
part of the standard GL. These features may be implemented as
extensions to the standard GL. The GL_EXTENSIONS
string is a
space-separated list of supported GL extensions.
(Extension names never contain a space character.)
If an error is generated, glGetString
returns null
.
The client and server may support different versions or extensions.
glGetString
always returns a compatible version number or list
of extensions. The release number always describes the server.
GL_INVALID_ENUM
is generated if name
is not an accepted value.
name
- Specifies a symbolic constant, one of
GL_VENDOR
, GL_RENDERER
, GL_VERSION
,
GL_SHADING_LANGUAGE_VERSION
, or GL_EXTENSIONS
.
String
formatted as described above.void glGetTexParameterfv(int target, int pname, float[] params, int offset)
glGetTexParameteriv
.
GL_INVALID_ENUM
is generated if target
or pname
is not an accepted value.
target
- Specifies the symbolic name of the target texture.
GL_TEXTURE_2D
and GL_TEXTURE_CUBE_MAP
are accepted.pname
- Specifies the symbolic name of a texture parameter.
GL_TEXTURE_MAG_FILTER
, GL_TEXTURE_MIN_FILTER
,
GL_TEXTURE_WRAP_S
, and GL_TEXTURE_WRAP_T
are accepted.params
- Returns the texture parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glGetTexParameterfv(int, int, FloatBuffer)
,
GL20.glGetTexParameteriv(int, int, IntBuffer)
,
GL20.glGetTexParameteriv(int, int, int[], int)
void glGetTexParameterfv(int target, int pname, FloatBuffer params)
glGetTexParameteriv
.
GL_INVALID_ENUM
is generated if target
or pname
is not an accepted value.
target
- Specifies the symbolic name of the target texture.
GL_TEXTURE_2D
and GL_TEXTURE_CUBE_MAP
are accepted.pname
- Specifies the symbolic name of a texture parameter.
GL_TEXTURE_MAG_FILTER
, GL_TEXTURE_MIN_FILTER
,
GL_TEXTURE_WRAP_S
, and GL_TEXTURE_WRAP_T
are accepted.params
- Returns the texture parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetTexParameterfv(int, int, float[], int)
,
GL20.glGetTexParameteriv(int, int, IntBuffer)
,
GL20.glGetTexParameteriv(int, int, int[], int)
void glGetTexParameteriv(int target, int pname, int[] params, int offset)
glGetTexParameter
returns in params
the value of the texture
parameter specified as pname
. target
defines the target texture,
either GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
, to specify
two-dimensional or cube-mapped texturing. pname
accepts the
same symbols as glTexParameterf
/
glTexParameterfv
/
glTexParameterfv
/
glTexParameteri
/
glTexParameteriv
/
glTexParameteriv
, with the same interpretations:
GL_TEXTURE_MAG_FILTER
Returns the single-valued texture magnification filter,
a symbolic constant. The initial value is GL_LINEAR
.
GL_TEXTURE_MIN_FILTER
Returns the single-valued texture minification filter, a symbolic constant.
The initial value is GL_NEAREST_MIPMAP_LINEAR
.
GL_TEXTURE_WRAP_S
Returns the single-valued wrapping function for texture coordinate s,
a symbolic constant. The initial value is GL_REPEAT
.
GL_TEXTURE_WRAP_T
Returns the single-valued wrapping function for texture coordinate t,
a symbolic constant. The initial value is GL_REPEAT
.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_ENUM
is generated if target
or pname
is not an accepted value.
target
- Specifies the symbolic name of the target texture.
GL_TEXTURE_2D
and GL_TEXTURE_CUBE_MAP
are accepted.pname
- Specifies the symbolic name of a texture parameter.
GL_TEXTURE_MAG_FILTER
, GL_TEXTURE_MIN_FILTER
,
GL_TEXTURE_WRAP_S
, and GL_TEXTURE_WRAP_T
are accepted.params
- Returns the texture parameter.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glGetTexParameterfv(int, int, FloatBuffer)
,
GL20.glGetTexParameterfv(int, int, float[], int)
,
GL20.glGetTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glGetTexParameteriv(int target, int pname, IntBuffer params)
Buffer
version of glGetTexParameteriv
.
GL_INVALID_ENUM
is generated if target
or pname
is not an accepted value.
target
- Specifies the symbolic name of the target texture.
GL_TEXTURE_2D
and GL_TEXTURE_CUBE_MAP
are accepted.pname
- Specifies the symbolic name of a texture parameter.
GL_TEXTURE_MAG_FILTER
, GL_TEXTURE_MIN_FILTER
,
GL_TEXTURE_WRAP_S
, and GL_TEXTURE_WRAP_T
are accepted.params
- Returns the texture parameter.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetTexParameterfv(int, int, FloatBuffer)
,
GL20.glGetTexParameterfv(int, int, float[], int)
,
GL20.glGetTexParameteriv(int, int, int[], int)
void glGetUniformfv(int program, int location, int count, float[] params, int offset)
glGetUniformiv
.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if program
has not been successfully linked.
GL_INVALID_OPERATION
is generated if location
does not correspond to a valid
uniform variable location for the specified program object.
program
- Specifies the program object to be queried.location
- Specifies the location of the uniform variable to be queried.count
- Specifies the number of values to be returned.params
- Returns the value of the specified uniform variable.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glGetUniformfv(int, int, int, FloatBuffer)
,
GL20.glGetUniformiv(int, int, int, IntBuffer)
,
GL20.glGetUniformiv(int, int, int, int[], int)
void glGetUniformfv(int program, int location, int count, FloatBuffer params)
glGetUniformiv
.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if program
has not been successfully linked.
GL_INVALID_OPERATION
is generated if location
does not correspond to a valid
uniform variable location for the specified program object.
program
- Specifies the program object to be queried.location
- Specifies the location of the uniform variable to be queried.count
- Specifies the number of values to be returned.params
- Returns the value of the specified uniform variable.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetUniformfv(int, int, int, FloatBuffer)
,
GL20.glGetUniformfv(int, int, int, float[], int)
,
GL20.glGetUniformiv(int, int, int, int[], int)
void glGetUniformiv(int program, int location, int count, int[] params, int offset)
glGetUniform
returns in params
the value(s) of the
specified uniform variable. The type of the uniform variable
specified by location
determines the number of values returned.
If the uniform variable is defined in the shader as a
boolean, int, or float, a single value will be returned.
If it is defined as a vec2, ivec2, or bvec2, two values
will be returned. If it is defined as a vec3, ivec3, or bvec3,
three values will be returned, and so on. To query values
stored in uniform variables declared as arrays,
call glGetUniform
for each element of the array.
To query values stored in uniform variables declared as
structures, call glGetUniform
for each field in the
structure. The values for uniform variables declared
as a matrix will be returned in column major order.
The locations assigned to uniform variables are not
known until the program object is linked.
After linking has occurred, the command glGetUniformLocation
can be used to obtain the location of a uniform variable.
This location value can then be passed to glGetUniform
in order to query the current value of the uniform variable.
After a program object has been linked successfully, the index
values for uniform variables remain fixed until the next
link command occurs. The uniform variable values can
only be queried after a link if the link was successful.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if program
has not been successfully linked.
GL_INVALID_OPERATION
is generated if location
does not correspond to a valid
uniform variable location for the specified program object.
glGetActiveUniform
with arguments program
and the index of an active uniform variable
glGetProgramiv
/glGetProgramiv
with arguments program
and GL_ACTIVE_UNIFORMS
or GL_ACTIVE_UNIFORM_MAX_LENGTH
glGetUniformLocation
with arguments
program
and the name of a uniform variable
program
- Specifies the program object to be queried.location
- Specifies the location of the uniform variable to be queried.count
- Specifies the number of values to be returned.params
- Returns the value of the specified uniform variable.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glCreateProgram()
,
GL20.glGetUniformfv(int, int, int, FloatBuffer)
,
GL20.glGetUniformfv(int, int, int, float[], int)
,
GL20.glGetUniformiv(int, int, int, IntBuffer)
,
GL20.glLinkProgram(int)
,
GL20.glUniform1f(int, float)
,
GL20.glUniform1fv(int, int, FloatBuffer)
,
GL20.glUniform1fv(int, int, float[], int)
,
GL20.glUniform1i(int, int)
,
GL20.glUniform1iv(int, int, IntBuffer)
,
GL20.glUniform1iv(int, int, int[], int)
,
GL20.glUniform2f(int, float, float)
,
GL20.glUniform2fv(int, int, FloatBuffer)
,
GL20.glUniform2fv(int, int, float[], int)
,
GL20.glUniform2i(int, int, int)
,
GL20.glUniform2iv(int, int, IntBuffer)
,
GL20.glUniform2iv(int, int, int[], int)
,
GL20.glUniform3f(int, float, float, float)
,
GL20.glUniform3fv(int, int, FloatBuffer)
,
GL20.glUniform3fv(int, int, float[], int)
,
GL20.glUniform3i(int, int, int, int)
,
GL20.glUniform3iv(int, int, IntBuffer)
,
GL20.glUniform3iv(int, int, int[], int)
,
GL20.glUniform4f(int, float, float, float, float)
,
GL20.glUniform4fv(int, int, FloatBuffer)
,
GL20.glUniform4fv(int, int, float[], int)
,
GL20.glUniform4i(int, int, int, int, int)
,
GL20.glUniform4iv(int, int, IntBuffer)
,
GL20.glUniform4iv(int, int, int[], int)
,
GL20.glUniformMatrix2fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix2fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix3fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix3fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix4fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix4fv(int, int, boolean, float[], int)
void glGetUniformiv(int program, int location, int count, IntBuffer params)
Buffer
version of glGetUniformiv
.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if program
has not been successfully linked.
GL_INVALID_OPERATION
is generated if location
does not correspond to a valid
uniform variable location for the specified program object.
program
- Specifies the program object to be queried.location
- Specifies the location of the uniform variable to be queried.count
- Specifies the number of values to be returned.params
- Returns the value of the specified uniform variable.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetUniformfv(int, int, int, FloatBuffer)
,
GL20.glGetUniformfv(int, int, int, float[], int)
,
GL20.glGetUniformiv(int, int, int, int[], int)
int glGetUniformLocation(int program, String name)
glGetUniformLocation
returns an integer that represents the location of a
specific uniform variable within a program object. name
must be a
string that contains no white space. name
must be an active uniform variable name
in program
that is not a structure, an array of structures, or a subcomponent of
a vector or a matrix. This function returns -1 if name
does not correspond to an
active uniform variable in program
or if name
starts with
the reserved prefix "gl_".
Uniform variables that are structures or arrays of structures may be queried by calling
glGetUniformLocation
for each field within the structure. The array element operator "[]"
and the structure field operator "." may be used in name
in order to select elements within
an array or fields within a structure. The result of using these operators is not allowed
to be another structure, an array of structures, or a subcomponent of a vector or a matrix.
Except if the last part of name
indicates a uniform variable array, the location of the first
element of an array can be retrieved by using the name of the array, or by using the name
appended by "[0]".
The actual locations assigned to uniform variables are not known until the program
object is linked successfully. After linking has occurred, the command glGetUniformLocation
can be used to obtain the location of a uniform variable. This location value can then
be passed to glUniform1f
/
glUniform1fv
/
glUniform1fv
/
glUniform1i
/
glUniform1iv
/
glUniform1iv
/
glUniform2f
/
glUniform2fv
/
glUniform2fv
/
glUniform2i
/
glUniform2iv
/
glUniform2iv
/
glUniform3f
/
glUniform3fv
/
glUniform3fv
/
glUniform3i
/
glUniform3iv
/
glUniform3iv
/
glUniform4f
/
glUniform4fv
/
glUniform4fv
/
glUniform4i
/
glUniform4iv
/
glUniform4iv
/
glUniformMatrix2fv
/
glUniformMatrix2fv
/
glUniformMatrix3fv
/
glUniformMatrix3fv
/
glUniformMatrix4fv
/
glUniformMatrix4fv
to set the value of the uniform variable or to
glGetUniformfv
/
glGetUniformfv
/
glGetUniformiv
/
glGetUniformiv
in
order to query the current value of the uniform variable. After a program object
has been linked successfully, the index values for uniform variables remain
fixed until the next link command occurs. Uniform variable locations and values
can only be queried after a link if the link was successful.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if program
has not been successfully linked.
glGetActiveUniform
with arguments program
and the index of an active uniform variable
glGetProgramiv
/glGetProgramiv
with arguments program
and GL_ACTIVE_UNIFORMS
or GL_ACTIVE_UNIFORM_MAX_LENGTH
glGetUniformfv
/
glGetUniformfv
/
glGetUniformiv
/
glGetUniformiv
with arguments program
and the name of a uniform variable
program
- Specifies the program object to be queried.name
- Specifies a String
containing the name of the uniform whose location is to be queried.
IllegalArgumentException
- If name
is null
.GL20.glLinkProgram(int)
,
GL20.glUniform1f(int, float)
,
GL20.glUniform1fv(int, int, FloatBuffer)
,
GL20.glUniform1fv(int, int, float[], int)
,
GL20.glUniform1i(int, int)
,
GL20.glUniform1iv(int, int, IntBuffer)
,
GL20.glUniform1iv(int, int, int[], int)
,
GL20.glUniform2f(int, float, float)
,
GL20.glUniform2fv(int, int, FloatBuffer)
,
GL20.glUniform2fv(int, int, float[], int)
,
GL20.glUniform2i(int, int, int)
,
GL20.glUniform2iv(int, int, IntBuffer)
,
GL20.glUniform2iv(int, int, int[], int)
,
GL20.glUniform3f(int, float, float, float)
,
GL20.glUniform3fv(int, int, FloatBuffer)
,
GL20.glUniform3fv(int, int, float[], int)
,
GL20.glUniform3i(int, int, int, int)
,
GL20.glUniform3iv(int, int, IntBuffer)
,
GL20.glUniform3iv(int, int, int[], int)
,
GL20.glUniform4f(int, float, float, float, float)
,
GL20.glUniform4fv(int, int, FloatBuffer)
,
GL20.glUniform4fv(int, int, float[], int)
,
GL20.glUniform4i(int, int, int, int, int)
,
GL20.glUniform4iv(int, int, IntBuffer)
,
GL20.glUniform4iv(int, int, int[], int)
,
GL20.glUniformMatrix2fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix2fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix3fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix3fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix4fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix4fv(int, int, boolean, float[], int)
void glGetVertexAttribfv(int index, int pname, float[] params, int offset)
glGetVertexAttribiv
.
GL_INVALID_ENUM
is generated if pname
is not an
accepted value.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the generic vertex attribute parameter to be queried.pname
- Specifies the symbolic name of the vertex attribute parameter
to be queried. Accepted values are GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
,
GL_VERTEX_ATTRIB_ARRAY_ENABLED
, GL_VERTEX_ATTRIB_ARRAY_SIZE
,
GL_VERTEX_ATTRIB_ARRAY_STRIDE
, GL_VERTEX_ATTRIB_ARRAY_TYPE
,
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, or GL_CURRENT_VERTEX_ATTRIB
.params
- Returns the requested data.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glGetVertexAttribfv(int, int, FloatBuffer)
,
GL20.glGetVertexAttribiv(int, int, IntBuffer)
,
GL20.glGetVertexAttribiv(int, int, int[], int)
void glGetVertexAttribfv(int index, int pname, FloatBuffer params)
glGetVertexAttribiv
.
GL_INVALID_ENUM
is generated if pname
is not an
accepted value.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the generic vertex attribute parameter to be queried.pname
- Specifies the symbolic name of the vertex attribute parameter
to be queried. Accepted values are GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
,
GL_VERTEX_ATTRIB_ARRAY_ENABLED
, GL_VERTEX_ATTRIB_ARRAY_SIZE
,
GL_VERTEX_ATTRIB_ARRAY_STRIDE
, GL_VERTEX_ATTRIB_ARRAY_TYPE
,
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, or GL_CURRENT_VERTEX_ATTRIB
.params
- Returns the requested data.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetVertexAttribfv(int, int, float[], int)
,
GL20.glGetVertexAttribiv(int, int, IntBuffer)
,
GL20.glGetVertexAttribiv(int, int, int[], int)
void glGetVertexAttribiv(int index, int pname, int[] params, int offset)
glGetVertexAttrib
returns in params
the value of a generic
vertex attribute parameter. The generic vertex attribute
to be queried is specified by index
, and the parameter
to be queried is specified by pname
.
The accepted parameter names are as follows:
GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
params
returns a single value, the name of the buffer
object currently bound to the binding point corresponding
to generic vertex attribute array index
. If no buffer
object is bound, 0 is returned. The initial value is 0.
GL_VERTEX_ATTRIB_ARRAY_ENABLED
params
returns a single value that is non-zero (true) if the
vertex attribute array for index
is enabled and 0 (false)
if it is disabled. The initial value is GL_FALSE
.
GL_VERTEX_ATTRIB_ARRAY_SIZE
params
returns a single value, the size of the vertex
attribute array for index
. The size is the number of
values for each element of the vertex attribute array,
and it will be 1, 2, 3, or 4. The initial value is 4.
GL_VERTEX_ATTRIB_ARRAY_STRIDE
params
returns a single value, the array stride for
(number of bytes between successive elements in) the
vertex attribute array for index
. A value of 0
indicates that the array elements are stored sequentially
in memory. The initial value is 0.
GL_VERTEX_ATTRIB_ARRAY_TYPE
params
returns a single value, a symbolic constant indicating
the array type for the vertex attribute array for index
.
Possible values are GL_BYTE
, GL_UNSIGNED_BYTE
, GL_SHORT
,
GL_UNSIGNED_SHORT
, GL_FIXED
, and GL_FLOAT
.
The initial value is GL_FLOAT
.
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
params
returns a single value that is non-zero (true)
if fixed-point data types for the vertex attribute
array indicated by index
are normalized when they
are converted to floating point, and 0 (false)
otherwise. The initial value is GL_FALSE
.
GL_CURRENT_VERTEX_ATTRIB
params
returns four values that represent the current
value for the generic vertex attribute specified by index
.
The initial value is (0,0,0,1).
All of the parameters except GL_CURRENT_VERTEX_ATTRIB
represent client-side state.
If an error is generated, no change is made to the contents of params
.
GL_INVALID_ENUM
is generated if pname
is not an
accepted value.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_ATTRIBS
index
- Specifies the generic vertex attribute parameter to be queried.pname
- Specifies the symbolic name of the vertex attribute parameter
to be queried. Accepted values are GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
,
GL_VERTEX_ATTRIB_ARRAY_ENABLED
, GL_VERTEX_ATTRIB_ARRAY_SIZE
,
GL_VERTEX_ATTRIB_ARRAY_STRIDE
, GL_VERTEX_ATTRIB_ARRAY_TYPE
,
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, or GL_CURRENT_VERTEX_ATTRIB
.params
- Returns the requested data.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glBindAttribLocation(int, int, String)
,
GL20.glBindBuffer(int, int)
,
GL20.glDisableVertexAttribArray(int)
,
GL20.glEnableVertexAttribArray(int)
,
GL20.glGetVertexAttribfv(int, int, FloatBuffer)
,
GL20.glGetVertexAttribfv(int, int, float[], int)
,
GL20.glGetVertexAttribiv(int, int, IntBuffer)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
void glGetVertexAttribiv(int index, int pname, IntBuffer params)
Buffer
version of glGetVertexAttribiv
.
GL_INVALID_ENUM
is generated if pname
is not an
accepted value.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the generic vertex attribute parameter to be queried.pname
- Specifies the symbolic name of the vertex attribute parameter
to be queried. Accepted values are GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
,
GL_VERTEX_ATTRIB_ARRAY_ENABLED
, GL_VERTEX_ATTRIB_ARRAY_SIZE
,
GL_VERTEX_ATTRIB_ARRAY_STRIDE
, GL_VERTEX_ATTRIB_ARRAY_TYPE
,
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
, or GL_CURRENT_VERTEX_ATTRIB
.params
- Returns the requested data.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glGetVertexAttribfv(int, int, FloatBuffer)
,
GL20.glGetVertexAttribfv(int, int, float[], int)
,
GL20.glGetVertexAttribiv(int, int, int[], int)
void glHint(int target, int mode)
target
is a symbolic constant indicating the behavior to be controlled,
and mode
is another symbolic constant indicating the desired behavior.
The initial value for each target
is GL_DONT_CARE
.
mode
can be one of the following:
GL_FASTEST
The most efficient option should be chosen.
GL_NICEST
The most correct, or highest quality, option should be chosen.
GL_DONT_CARE
No preference.
Though the implementation aspects that can be hinted are well defined,
the interpretation of the hints depends on the implementation.
The hint aspects that can be specified with target
, along with
suggested semantics, are as follows:
GL_GENERATE_MIPMAP_HINT
Indicates the quality of filtering when generating
mipmap images with glGenerateMipmap
.
The interpretation of hints depends on the implementation.
Some implementations ignore glHint
settings.
GL_INVALID_ENUM
is generated if either target
or
mode
is not an accepted value.
target
- Specifies a symbolic constant indicating the
behavior to be controlled. GL_GENERATE_MIPMAP_HINT
is accepted.mode
- Specifies a symbolic constant indicating the desired behavior.
GL_FASTEST
, GL_NICEST
, and GL_DONT_CARE
are accepted.GL20.glGenerateMipmap(int)
boolean glIsBuffer(int buffer)
glIsBuffer
returns true
if buffer
is currently
the name of a buffer object. If buffer
is zero, or is a non-zero
value that is not currently the name of a buffer object,
or if an error occurs, glIsBuffer
returns false
.
A name returned by glGenBuffers
/
glGenBuffers
, but not yet associated
with a buffer object by calling glBindBuffer
,
is not the name of a buffer object.
buffer
- Specifies a value that may be the name of a buffer object.
true
if buffer
is the name of a buffer object.GL20.glBindBuffer(int, int)
,
GL20.glDeleteBuffers(int, IntBuffer)
,
GL20.glDeleteBuffers(int, int[], int)
,
GL20.glGenBuffers(int, IntBuffer)
,
GL20.glGenBuffers(int, int[], int)
,
GL20.glGetBooleanv(int, IntBuffer)
,
GL20.glGetBooleanv(int, boolean[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
boolean glIsEnabled(int cap)
glIsEnabled
returns true
if cap
is an enabled capability and
returns false
otherwise. Initially all capabilities
except GL_DITHER
are disabled; GL_DITHER
is initially enabled.
The following capabilities are accepted for cap
:
Constant | See |
GL_BLEND | glBlendFunc |
GL_CULL_FACE | glCullFace |
GL_DEPTH_TEST |
glDepthFunc , glDepthRangef |
GL_DITHER | glEnable |
GL_POLYGON_OFFSET_FILL | glPolygonOffset |
GL_SAMPLE_ALPHA_TO_COVERAGE | glSampleCoverage |
GL_SAMPLE_COVERAGE | glSampleCoverage |
GL_SCISSOR_TEST | glScissor |
GL_STENCIL_TEST |
glStencilFunc , glStencilOp |
If an error is generated, glIsEnabled
returns false
.
GL_INVALID_ENUM
is generated if cap
is not an accepted value.
cap
- Specifies a symbolic constant indicating a GL capability.
true
if the given capability is enabled.GL20.glEnable(int)
,
GL20.glGetBooleanv(int, IntBuffer)
,
GL20.glGetBooleanv(int, boolean[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
boolean glIsFramebuffer(int framebuffer)
glIsFramebuffer
returns true
if framebuffer
is
currently the name of a framebuffer object. If framebuffer
is zero,
or is a non-zero value that is not currently the name of a framebuffer object,
or if an error occurs, glIsFramebuffer
returns false
.
A name returned by glGenFramebuffers
/
glGenFramebuffers
, but not yet associated with a
framebuffer object by calling glBindFramebuffer
, is not the name
of a framebuffer object.
framebuffer
- Specifies a value that may be the name of a framebuffer object.
true
if framebuffer
is the name of a framebuffer object.GL20.glBindFramebuffer(int, int)
,
GL20.glDeleteFramebuffers(int, IntBuffer)
,
GL20.glDeleteFramebuffers(int, int[], int)
,
GL20.glGenFramebuffers(int, IntBuffer)
,
GL20.glGenFramebuffers(int, int[], int)
boolean glIsProgram(int program)
glIsProgram
returns true
if program
is the
name of a program object previously created
with glCreateProgram
and not yet deleted with glDeleteProgram
.
If program
is zero or a non-zero value that is not the name
of a program object, or if an error occurs,
glIsProgram
returns false
.
No error is generated if program
is not a valid program object name.
A program object marked for deletion with glDeleteProgram
but
still in use as part of current rendering state is still
considered a program object and glIsProgram
will return true
.
program
- Specifies a potential program object.
true
if program
is the name of a program object.GL20.glCreateProgram()
,
GL20.glDeleteProgram(int)
,
GL20.glUseProgram(int)
boolean glIsRenderbuffer(int renderbuffer)
glIsRenderbuffer
returns true
if renderbuffer
is
currently the name of a renderbuffer object. If renderbuffer
is zero,
or is a non-zero value that is not currently the name of a renderbuffer
object, or if an error occurs, glIsRenderbuffer
returns false
.
A name returned by glGenRenderbuffers
/
glGenRenderbuffers
, but not yet associated with a
renderbuffer object by calling glBindRenderbuffer
, is not the name
of a renderbuffer object.
renderbuffer
- Specifies a value that may be the name of a renderbuffer object.
true
if renderbuffer
is the name of a renderbuffer object.GL20.glBindRenderbuffer(int, int)
,
GL20.glDeleteRenderbuffers(int, IntBuffer)
,
GL20.glDeleteRenderbuffers(int, int[], int)
,
GL20.glGenRenderbuffers(int, IntBuffer)
,
GL20.glGenRenderbuffers(int, int[], int)
boolean glIsShader(int shader)
glIsShader
returns true
if shader
is the name of a
shader object previously created with glCreateShader
and not yet
deleted with glDeleteShader
. If shader
is zero or a non-zero value
that is not the name of a shader object, or if an error occurs,
glIsShader
returns false
.
No error is generated if shader
is not a valid shader object name.
A shader object marked for deletion with glDeleteShader
but still
attached to a program object is still considered a shader object
and glIsShader
will return true
.
shader
- Specifies a potential shader object.
true
if shader
is the name of a shader object.GL20.glCreateShader(int)
,
GL20.glDeleteShader(int)
boolean glIsTexture(int texture)
glIsTexture
returns true
if texture
is currently the name of a texture.
If texture
is zero, or is a non-zero value that is not currently the
name of a texture, or if an error occurs, glIsTexture
returns false
.
A name returned by glGenTextures
/glGenTextures
,
but not yet associated with a texture by calling glBindTexture
, is not the name of a texture.
texture
- Specifies a value that may be the name of a texture.
true
if texture
is the name of a texture object.GL20.glBindTexture(int, int)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glDeleteTextures(int, IntBuffer)
,
GL20.glDeleteTextures(int, int[], int)
,
GL20.glGenTextures(int, IntBuffer)
,
GL20.glGenTextures(int, int[], int)
,
GL20.glGetBooleanv(int, IntBuffer)
,
GL20.glGetBooleanv(int, boolean[], int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
,
GL20.glGetTexParameterfv(int, int, FloatBuffer)
,
GL20.glGetTexParameterfv(int, int, float[], int)
,
GL20.glGetTexParameteriv(int, int, IntBuffer)
,
GL20.glGetTexParameteriv(int, int, int[], int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glLineWidth(float width)
glLineWidth
specifies the rasterized width of lines.
The actual width is determined by rounding the supplied
width to the nearest integer. (If the rounding results
in the value 0, it is as if the line width were 1.)
If Δx >= Δy
, i pixels are filled in each column that is
rasterized, where i is the rounded value of width
.
Otherwise, i pixels are filled in each row that is rasterized.
There is a range of supported line widths.
Only width 1 is guaranteed to be supported;
others depend on the implementation.
To query the range of supported widths,
call glGetIntegerv
/glGetIntegerv
with argument GL_ALIASED_LINE_WIDTH_RANGE
.
The line width specified by glLineWidth
is always
returned when GL_LINE_WIDTH
is queried.
Clamping and rounding have no effect on the specified value.
Line width may be clamped to an implementation-dependent maximum.
Call glGetIntegerv
/glGetIntegerv
with GL_ALIASED_LINE_WIDTH_RANGE
to determine the maximum width.
GL_INVALID_VALUE
is generated if width
is
less than or equal to 0.
glGetIntegerv
/glGetIntegerv
with argument GL_LINE_WIDTH
glGetIntegerv
/glGetIntegerv
with argument GL_ALIASED_LINE_WIDTH_RANGE
width
- Specifies the width of rasterized lines. The initial value is 1.GL20.glEnable(int)
void glLinkProgram(int program)
glLinkProgram
links the program object specified by program
.
Shader objects of type GL_VERTEX_SHADER
attached to program
are used to
create an executable that will run on the programmable vertex processor.
Shader objects of type GL_FRAGMENT_SHADER
attached to program
are used
to create an executable that will run on the programmable fragment processor.
The status of the link operation will be stored as part of the
program object's state. This value will be set to GL_TRUE
if the program
object was linked without errors and is ready for use, and GL_FALSE
otherwise.
It can be queried by calling glGetProgramiv
/
glGetProgramiv
with arguments
program
and GL_LINK_STATUS
.
As a result of a successful link operation, all active user-defined
uniform variables belonging to program
will be initialized to 0,
and each of the program object's active uniform variables will be
assigned a location that can be queried by calling glGetUniformLocation
.
Also, any active user-defined attribute variables that have not been
bound to a generic vertex attribute index will be bound to one at this time.
Linking of a program object can fail for a number of reasons as specified in the OpenGL ES Shading Language Specification. The following lists some of the conditions that will cause a link error.
A vertex shader and a fragment shader are not both present in the program object.
The number of active attribute variables supported by the implementation has been exceeded.
The storage limit for uniform variables has been exceeded.
The number of active uniform variables supported by the implementation has been exceeded.
The main
function is missing for the vertex shader or the fragment shader.
A varying variable actually used in the fragment shader is not declared in the same way (or is not declared at all) in the vertex shader.
A reference to a function or variable name is unresolved.
A shared global is declared with two different types or two different initial values.
One or more of the attached shader objects has not been
successfully compiled (via glCompileShader
) or loaded
with a pre-compiled shader binary (via glShaderBinary
/
glShaderBinary
).
Binding a generic attribute matrix caused some rows of the
matrix to fall outside the allowed maximum of GL_MAX_VERTEX_ATTRIBS
.
Not enough contiguous vertex attribute slots could be found to bind attribute matrices.
When a program object has been successfully linked,
the program object can be made part of current state by
calling glUseProgram
. Whether or not the link operation
was successful, the program object's information log will be overwritten.
The information log can be retrieved by calling glGetProgramInfoLog
.
glLinkProgram
will also install the generated executables as part of the
current rendering state if the link operation was successful and the
specified program object is already currently in use as a result of a
previous call to glUseProgram
. If the program object currently in use is
relinked unsuccessfully, its link status will be set to GL_FALSE
,
but the executables and associated state will remain part of the
current state until a subsequent call to glUseProgram
removes it
from use. After it is removed from use, it cannot be made part of
current state until it has been successfully relinked.
The program object's information log is updated and the program is generated at the time of the link operation. After the link operation, applications are free to modify attached shader objects, compile attached shader objects, detach shader objects, delete shader objects, and attach additional shader objects. None of these operations affects the information log or the program that is part of the program object.
If the link operation is unsuccessful, any information about a previous
link operation on program
is lost (i.e., a failed link does not restore
the old state of program
). Certain information can still be retrieved
from program
even after an unsuccessful link operation.
See for instance glGetActiveAttrib
and glGetActiveUniform
.
GL_INVALID_VALUE
is generated if program
is not a
value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is
not a program object.
glGetIntegerv
/glGetIntegerv
with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
with argument program
and the index of an active attribute variable
glGetActiveUniform
with argument program
and the index of an active uniform variable
glGetAttachedShaders
/
glGetAttachedShaders
with argument program
glGetAttribLocation
with argument program
and an attribute variable name
glGetProgramiv
/glGetProgramiv
with arguments program
and GL_LINK_STATUS
glGetProgramInfoLog
with argument program
glGetUniformfv
/
glGetUniformfv
/
glGetUniformiv
/
glGetUniformiv
with argument program
and a uniform variable location
glGetUniformLocation
with argument program
and a uniform variable name
program
- Specifies the handle of the program object to be linked.GL20.glAttachShader(int, int)
,
GL20.glBindAttribLocation(int, int, String)
,
GL20.glCompileShader(int)
,
GL20.glShaderBinary(int, IntBuffer, int, Buffer, int)
,
GL20.glShaderBinary(int, int[], int, int, Buffer, int)
,
GL20.glCreateProgram()
,
GL20.glDeleteProgram(int)
,
GL20.glDetachShader(int, int)
,
GL20.glUniform1f(int, float)
,
GL20.glUniform1fv(int, int, FloatBuffer)
,
GL20.glUniform1fv(int, int, float[], int)
,
GL20.glUniform1i(int, int)
,
GL20.glUniform1iv(int, int, IntBuffer)
,
GL20.glUniform1iv(int, int, int[], int)
,
GL20.glUniform2f(int, float, float)
,
GL20.glUniform2fv(int, int, FloatBuffer)
,
GL20.glUniform2fv(int, int, float[], int)
,
GL20.glUniform2i(int, int, int)
,
GL20.glUniform2iv(int, int, IntBuffer)
,
GL20.glUniform2iv(int, int, int[], int)
,
GL20.glUniform3f(int, float, float, float)
,
GL20.glUniform3fv(int, int, FloatBuffer)
,
GL20.glUniform3fv(int, int, float[], int)
,
GL20.glUniform3i(int, int, int, int)
,
GL20.glUniform3iv(int, int, IntBuffer)
,
GL20.glUniform3iv(int, int, int[], int)
,
GL20.glUniform4f(int, float, float, float, float)
,
GL20.glUniform4fv(int, int, FloatBuffer)
,
GL20.glUniform4fv(int, int, float[], int)
,
GL20.glUniform4i(int, int, int, int, int)
,
GL20.glUniform4iv(int, int, IntBuffer)
,
GL20.glUniform4iv(int, int, int[], int)
,
GL20.glUniformMatrix2fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix2fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix3fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix3fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix4fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix4fv(int, int, boolean, float[], int)
,
GL20.glUseProgram(int)
,
GL20.glValidateProgram(int)
void glPixelStorei(int pname, int param)
glPixelStorei
sets pixel storage modes that affect the operation of
subsequent glReadPixels
as well as the unpacking of texture patterns
(see glTexImage2D
and glTexSubImage2D
).
pname
is a symbolic constant indicating the parameter to be set,
and param
is the new value. One storage parameter affects how
pixel data is returned to client memory:
GL_PACK_ALIGNMENT
Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries).
The other storage parameter affects how pixel data is read from client memory:
GL_UNPACK_ALIGNMENT
Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries).
The following table gives the type, initial value, and range of valid values
for each storage parameter that can be set with glPixelStorei
.
pname | Type | Initial Value | Valid Range |
GL_PACK_ALIGNMENT | integer | 4 | 1, 2, 4, or 8 |
GL_UNPACK_ALIGNMENT | integer | 4 | 1, 2, 4, or 8 |
Boolean parameters are set to false if param
is 0 and true otherwise.
GL_INVALID_ENUM
is generated if pname
is not an accepted value.
GL_INVALID_VALUE
is generated if alignment is specified as other than 1, 2, 4, or 8.
glGetIntegerv
/glGetIntegerv
with argument GL_PACK_ALIGNMENT
or GL_UNPACK_ALIGNMENT
pname
- Specifies the symbolic name of the parameter to be set.
One value affects the packing of pixel data into memory:
GL_PACK_ALIGNMENT
. The other affects the unpacking of
pixel data from memory: GL_UNPACK_ALIGNMENT
.param
- Specifies the value that pname
is set to.GL20.glReadPixels(int, int, int, int, int, int, Buffer)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
void glPolygonOffset(float factor, float units)
GL_POLYGON_OFFSET_FILL
is enabled, each fragment's
depth value will be offset after it is interpolated from
the depth values of the appropriate vertices.
The value of the offset is factor × DZ + r × units
,
where DZ
is a measurement of the change in depth relative
to the screen area of the polygon, and r
is the
smallest value that is guaranteed to produce a resolvable
offset for a given implementation. The offset is added before
the depth test is performed and before the value is written
into the depth buffer.
glPolygonOffset
is useful for rendering hidden-line images,
for applying decals to surfaces, and for rendering solids
with highlighted edges.
glIsEnabled
with argument GL_POLYGON_OFFSET_FILL
.
glGetIntegerv
/glGetIntegerv
with argument GL_POLYGON_OFFSET_FACTOR
or GL_POLYGON_OFFSET_UNITS
.
factor
- Specifies a scale factor that is used to create a
variable depth offset for each polygon. The initial value is 0.units
- Is multiplied by an implementation-specific value
to create a constant depth offset. The initial value is 0.GL20.glDepthFunc(int)
,
GL20.glEnable(int)
,
GL20.glGetIntegerv(int, IntBuffer)
,
GL20.glGetIntegerv(int, int[], int)
,
GL20.glIsEnabled(int)
void glReadPixels(int x, int y, int width, int height, int format, int type, Buffer pixels)
glReadPixels
returns pixel data from the frame buffer,
starting with the pixel whose lower left corner is at
location (x, y
), into client memory in the buffer data
.
The GL_PACK_ALIGNMENT
parameter, set with the glPixelStorei
command,
affects the processing of the pixel data before it is placed into client memory.
glReadPixels
returns values from each pixel with lower left
corner at (x + i, y + j)
for 0 <= i < width
and 0 <= j < height
.
This pixel is said to be the ith pixel in the jth row. Pixels are
returned in row order from the lowest to the highest row,
left to right in each row.
format
specifies the format for the returned pixel values;
accepted values are:
GL_ALPHA
GL_RGB
GL_RGBA
RGBA color components are read from the color buffer. Each color component is converted to floating point such that zero intensity maps to 0.0 and full intensity maps to 1.0.
Unneeded data is then discarded. For example,
GL_ALPHA
discards the red, green, and blue components,
while GL_RGB
discards only the alpha component.
The final values are clamped to the range [0, 1]
.
Finally, the components are converted to the proper format,
as specified by type
. When type
is GL_UNSIGNED_BYTE
,
each component is multiplied by 2^8 - 1
.
When type
is GL_UNSIGNED_SHORT_5_6_5
, GL_UNSIGNED_SHORT_4_4_4_4
, or
GL_UNSIGNED_SHORT_5_5_5_1
, each component is multiplied by 2^N - 1
,
where N
is the number of bits in the bitfield.
Return values are placed in memory as follows.
If format
is GL_ALPHA
, a single value is returned and the
data for the ith pixel in the jth row is placed in
location j × width + i
. GL_RGB
returns three values and
GL_RGBA
returns four values for each pixel, with all values
corresponding to a single pixel occupying contiguous space in data
.
Storage parameter GL_PACK_ALIGNMENT
, set by glPixelStorei
,
affects the way that data is written into memory.
See glPixelStorei
for a description.
If the currently bound framebuffer is not the default framebuffer object,
color components are read from the color image attached to
the GL_COLOR_ATTACHMENT0
attachment point.
Only two format
/type
parameter pairs are accepted.
GL_RGBA
/GL_UNSIGNED_BYTE
is always accepted, and the other acceptable pair can be discovered by
querying GL_IMPLEMENTATION_COLOR_READ_FORMAT
and GL_IMPLEMENTATION_COLOR_READ_TYPE
.
Values for pixels that lie outside the window connected to the current GL context are undefined.
If an error is generated, no change is made to the contents of data
.
GL_INVALID_ENUM
is generated if format
or type
is not an accepted value.
GL_INVALID_VALUE
is generated if either width
or height
is negative.
GL_INVALID_OPERATION
is generated if type
is
GL_UNSIGNED_SHORT_5_6_5
and format
is not GL_RGB
.
GL_INVALID_OPERATION
is generated if type
is
GL_UNSIGNED_SHORT_4_4_4_4
or GL_UNSIGNED_SHORT_5_5_5_1
and format
is not GL_RGBA
.
GL_INVALID_OPERATION
is generated if format
and type
are neither
GL_RGBA
and GL_UNSIGNED_BYTE
, respectively, nor the format/type pair returned
by querying GL_IMPLEMENTATION_COLOR_READ_FORMAT
and GL_IMPLEMENTATION_COLOR_READ_TYPE
.
GL_INVALID_FRAMEBUFFER_OPERATION
is generated if the currently bound
framebuffer is not framebuffer complete (i.e. the return value
from glCheckFramebufferStatus
is not GL_FRAMEBUFFER_COMPLETE
).
glGetIntegerv
/glGetIntegerv
with argument GL_IMPLEMENTATION_COLOR_READ_FORMAT
or GL_IMPLEMENTATION_COLOR_READ_TYPE
glGetIntegerv
/glGetIntegerv
with argument GL_PACK_ALIGNMENT
x
- Specifies the x window coordinate of the first pixel
that is read from the frame buffer. This location is the
lower left corner of a rectangular block of pixels.y
- Specifies the y window coordinate of the first pixel
that is read from the frame buffer. This location is the
lower left corner of a rectangular block of pixels.width
- Specifies the width of the pixel rectangle.
A width
and height
of one correspond to a single pixel.height
- Specifies the height dimension of the pixel rectangle.
A width
and height
of one correspond to a single pixel.format
- Specifies the format of the pixel data.
The following symbolic values are accepted: GL_ALPHA
, GL_RGB
, and GL_RGBA
.type
- Specifies the data type of the pixel data.
Must be one of GL_UNSIGNED_BYTE
, GL_UNSIGNED_SHORT_5_6_5
,
GL_UNSIGNED_SHORT_4_4_4_4
, or GL_UNSIGNED_SHORT_5_5_5_1
.pixels
- Returns the pixel data.
IllegalArgumentException
- If pixels
is null
.
IllegalArgumentException
- If pixels
does not contain enough room for the pixel data.GL20.glCheckFramebufferStatus(int)
,
GL20.glPixelStorei(int, int)
void glReleaseShaderCompiler()
glReleaseShaderCompiler
frees resources allocated by
the shader compiler. This is a hint from the application
that additional shader compilations are unlikely to occur,
at least for some period of time, and that the resources
consumed by the shader compiler may be released and put
to better use elsewhere.
However, if a call to glCompileShader
is made after a call
to glReleaseShaderCompiler
, the shader compiler must be
restored to service the compilation request as
if glReleaseShaderCompiler
had never been called.
Shader compiler support is optional, and thus must be queried
before use by calling glGetIntegerv
/
glGetIntegerv
with argument GL_SHADER_COMPILER
.
glShaderSource
,
glCompileShader
,
glGetShaderPrecisionFormat
,
and glReleaseShaderCompiler
will each generate GL_INVALID_OPERATION
on implementations that do not support a shader compiler.
Such implementations instead offer the glShaderBinary
alternative for supplying a pre-compiled shader binary.
GL_INVALID_OPERATION
is generated if a shader compiler is not supported.
glGetIntegerv
/glGetIntegerv
with argument GL_SHADER_COMPILER
GL20.glCompileShader(int)
,
GL20.glShaderSource(int, int, String[], int[])
void glRenderbufferStorage(int target, int internalformat, int width, int height)
glRenderbufferStorage
establishes the data storage, format,
and dimensions of a renderbuffer object's image.
Any existing data store for the renderbuffer is
deleted and the contents of the new data store are undefined.
An implementation may vary its allocation of internal
component resolution based on any glRenderbufferStorage
parameter (except target
), but the allocation and chosen
internal format must not be a function of any other state and
cannot be changed once they are established.
The actual resolution in bits of each component
of the allocated image can be queried
with glGetRenderbufferParameteriv
/
glGetRenderbufferParameteriv
.
GL_INVALID_ENUM
is generated if target
is
not GL_RENDERBUFFER
.
GL_INVALID_ENUM
is generated if internalformat
is not an accepted format.
GL_INVALID_VALUE
is generated if width
or height
is less than zero or greater than GL_MAX_RENDERBUFFER_SIZE
.
GL_OUT_OF_MEMORY
is generated if the implementation
is unable to create a data store with the requested width
and height
.
GL_INVALID_OPERATION
is generated if
the reserved renderbuffer object name 0 is bound.
glGetRenderbufferParameteriv
/
glGetRenderbufferParameteriv
target
- Specifies the renderbuffer target.
The symbolic constant must be GL_RENDERBUFFER
.internalformat
- Specifies the color-renderable,
depth-renderable, or stencil-renderable format of the renderbuffer.
Must be one of the following symbolic constants:
GL_RGBA4
, GL_RGB565
, GL_RGB5_A1
, GL_DEPTH_COMPONENT16
,
or GL_STENCIL_INDEX8
.width
- Specifies the width of the renderbuffer in pixels.height
- Specifies the height of the renderbuffer in pixels.GL20.glBindRenderbuffer(int, int)
,
GL20.glDeleteRenderbuffers(int, IntBuffer)
,
GL20.glDeleteRenderbuffers(int, int[], int)
,
GL20.glFramebufferRenderbuffer(int, int, int, int)
,
GL20.glGenRenderbuffers(int, IntBuffer)
,
GL20.glGenRenderbuffers(int, int[], int)
,
GL20.glGetRenderbufferParameteriv(int, int, IntBuffer)
,
GL20.glGetRenderbufferParameteriv(int, int, int[], int)
,
GL20.glIsRenderbuffer(int)
void glSampleCoverage(float value, boolean invert)
value
is used in constructing a temporary mask used in determining which samples
will be used in resolving the final fragment color. This mask is bitwise-anded
with the coverage mask generated from the multisampling computation. If the invert
flag is set, the temporary mask is inverted (all bits flipped) and then
the bitwise-and is computed.
If an implementation does not have any multisample buffers available, or multisampling is disabled, rasterization occurs with only a single sample computing a pixel's final RGB color.
Provided an implementation supports multisample buffers, and multisampling is enabled, then a pixel's final color is generated by combining several samples per pixel. Each sample contains color, depth, and stencil information, allowing those operations to be performed on each sample.
glGetIntegerv
/glGetIntegerv
with argument GL_SAMPLE_COVERAGE_VALUE
glGetIntegerv
/glGetIntegerv
with argument GL_SAMPLE_COVERAGE_INVERT
glIsEnabled
with argument GL_SAMPLE_ALPHA_TO_COVERAGE
glIsEnabled
with argument GL_SAMPLE_COVERAGE
value
- Specifies a single floating-point sample coverage value.
The value is clamped to the range [0, 1]
. The initial value is 1.0.invert
- Specifies a single boolean value representing if the coverage masks should be inverted.
GL_TRUE
and GL_FALSE
are accepted. The initial value is GL_FALSE
.GL20.glEnable(int)
void glScissor(int x, int y, int width, int height)
glScissor
defines a rectangle, called the scissor box,
in window coordinates. The first two arguments, x
and y
,
specify the lower left corner of the box. width
and height
specify the width and height of the box.
To enable and disable the scissor test, call glEnable
and glDisable
with argument GL_SCISSOR_TEST
. The test is initially disabled.
While the test is enabled, only pixels that lie within the scissor box
can be modified by drawing commands. Window coordinates have integer
values at the shared corners of frame buffer pixels. glScissor(0,0,1,1)
allows modification of only the lower left pixel in the window, and
glScissor(0,0,0,0)
doesn't allow modification of any pixels
in the window.
When the scissor test is disabled, it is as though the scissor box includes the entire window.
GL_INVALID_VALUE
is generated if either width
or height
is negative.
glGetIntegerv
/glGetIntegerv
with argument GL_SCISSOR_BOX
glIsEnabled
with argument GL_SCISSOR_TEST
x
- Specifies the x coordinate of the lower left corner of the scissor box.
Initially 0.y
- Specifies the y coordinate of the lower left corner of the scissor box.
Initially 0.width
- Specifies the width of the scissor box.
When a GL context is first attached to a window, width
is set to the width of that window.height
- Specifies the width of the scissor box.
When a GL context is first attached to a window, height
is set to the height of that window.GL20.glEnable(int)
,
GL20.glViewport(int, int, int, int)
void glShaderBinary(int n, int[] shaders, int shadersOffset, int binaryformat, Buffer binary, int length)
glShaderBinary
loads precompiled
shader binaries. shaders
contains a list of n
shader object handles.
Each handle refers to a unique shader type (vertex shader or fragment shader).
binary
contains precompiled binary shader code in client memory, and
binaryformat
denotes the format of the pre-compiled code.
The binary image is decoded according to the extension specification
defining the specified binaryformat
. OpenGL ES defines no specific
binary formats, but does provide a mechanism to obtain symbolic
constants for such formats provided by extensions.
The number of shader binary formats supported can be obtained by
querying the value of GL_NUM_SHADER_BINARY_FORMATS
. The list of
specific binary formats supported can be obtained by querying
the value of GL_SHADER_BINARY_FORMATS
.
Depending on the types of the shader objects in shaders
, glShaderBinary
will individually load binary vertex or fragment shaders, or load an
executable binary that contains an optimized pair of vertex and fragment
shaders stored in the same binary.
If glShaderBinary
fails, the old state of shader objects for which the
binary was being loaded will not be restored.
Shader binary support is optional and thus must be queried before use by calling
glGetIntegerv
/glGetIntegerv
with arguments GL_NUM_SHADER_BINARY_FORMATS
and GL_SHADER_BINARY_FORMATS
.
glShaderBinary
generates GL_INVALID_OPERATION
on implementations that do not
support any shader binary formats. Such implementations instead offer the
glShaderSource
alternative for
supplying OpenGL ES Shading Language shader source for compilation.
If shader binary formats are supported, then an implementation may require
that an optimized pair of vertex and fragment shader binaries that were
compiled together to be specified to glLinkProgram
. Not specifying an
optimized pair my cause glLinkProgram
to fail. Such a restriction,
if it exists, will be documented in the extension specification
defining binaryformat
.
OpenGL copies the shader binary data when glShaderBinary
is called, so an application may free its copy of the data
immediately after the function returns.
GL_INVALID_ENUM
is generated if binaryformat
is not a
supported format returned in GL_SHADER_BINARY_FORMATS
.
GL_INVALID_VALUE
is generated if any value in
shaders
is not a value generated by OpenGL.
GL_INVALID_VALUE
is generated if the format of the
data pointed to by binary
does not match binaryformat
.
GL_INVALID_VALUE
is generated if n
or length
is negative.
GL_INVALID_OPERATION
is generated if any value in
shaders
is not a shader object, or if there is more than one
vertex shader object handle or more than one fragment shader
object handle in shaders
.
glGetIntegerv
/glGetIntegerv
with arguments GL_NUM_SHADER_BINARY_FORMATS
and GL_SHADER_BINARY_FORMATS
n
- Specifies the number of shader object handles present in shaders
.shaders
- Specifies an array of shader object
handles into which the shader binary will be loaded.shadersOffset
- the starting offset within the shaders
array.binaryformat
- Specifies the shader binary format.binary
- Specifies the shader binary data as a buffer in client memory.length
- Specifies the length of the shader binary data in bytes.
IllegalArgumentException
- If shaders
is null
.
IllegalArgumentException
- If shaders
is less than 0.
IllegalArgumentException
- If shaders.length -
shadersOffset
is smaller than the number of values required by the parameter.
IllegalArgumentException
- If binary
is null
.
IllegalArgumentException
- If binary.remaining()
is smaller than length
.GL20.glCreateShader(int)
,
GL20.glDeleteShader(int)
,
GL20.glLinkProgram(int)
void glShaderBinary(int n, IntBuffer shaders, int binaryformat, Buffer binary, int length)
Buffer
version of glShaderBinary
.
GL_INVALID_ENUM
is generated if binaryformat
is not a
supported format returned in GL_SHADER_BINARY_FORMATS
.
GL_INVALID_VALUE
is generated if any value in
shaders
is not a value generated by OpenGL.
GL_INVALID_VALUE
is generated if the format of the
data pointed to by binary
does not match binaryformat
.
GL_INVALID_VALUE
is generated if n
or length
is negative.
GL_INVALID_OPERATION
is generated if any value in
shaders
is not a shader object, or if there is more than one
vertex shader object handle or more than one fragment shader
object handle in shaders
.
n
- Specifies the number of shader object handles present in shaders
.shaders
- Specifies a buffer containing shader object
handles into which the shader binary will be loaded.binaryformat
- Specifies the shader binary format.binary
- Specifies the shader binary data as a buffer in client memory.length
- Specifies the length of the shader binary data in bytes.
IllegalArgumentException
- If shaders
is null
.
IllegalArgumentException
- If shaders.remaining()
is smaller than the n.
IllegalArgumentException
- If binary
is null
.
IllegalArgumentException
- If binary.remaining()
is smaller than length
.GL20.glShaderBinary(int, int[], int, int, Buffer, int)
void glShaderSource(int shader, int count, String[] strings, int[] lengths)
glShaderSource
sets the source code in shader
to the source code in the array of
strings specified by strings
. Any source code previously stored in
the shader object is completely replaced. The number of strings in
the array is specified by count
. If lengths
is null
,
the entirety of each string in strings
is used.
If lengths
is a value other than null
,
it points to an array containing a string length for each of the
corresponding elements of strings
. The source code strings
are not scanned or parsed at this time; they are simply copied into
the specified shader object.
Shader compiler support is optional, and thus must be queried before
use by calling glGetIntegerv
/
glGetIntegerv
with argument GL_SHADER_COMPILER
.
glShaderSource
, glCompileShader
,
glGetShaderPrecisionFormat
,
and glReleaseShaderCompiler
will each generate GL_INVALID_OPERATION
on implementations that do not support a shader compiler.
Such implementations instead offer the glShaderBinary
/
glShaderBinary
alternative
for supplying a pre-compiled shader binary.
OpenGL copies the shader source code strings when glShaderSource
is called, so an application may free its copy of the source code
strings immediately after the function returns.
GL_INVALID_OPERATION
is generated if a shader compiler is not supported.
GL_INVALID_VALUE
is generated if shader
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if shader
is not a shader object.
GL_INVALID_VALUE
is generated if count
is less than 0.
glGetIntegerv
/glGetIntegerv
with argument GL_SHADER_COMPILER
glGetShaderiv
/
glGetShaderiv
with arguments shader
and GL_SHADER_SOURCE_LENGTH
glGetShaderSource
with argument shader
shader
- Specifies the handle of the shader object whose source code is to be replaced.count
- Specifies the number of elements in the strings
and lengths
arrays.strings
- Specifies an array of strings containing
the source code to be loaded into the shader.lengths
- Specifies an array of string lengths. May be null
.
IllegalArgumentException
- If strings
is null
.
IllegalArgumentException
- If strings.length()
or
lengths.length()
is smaller than count
.
IllegalArgumentException
- If any element in strings
in the range [0, count - 1]
is null
.GL20.glCompileShader(int)
,
GL20.glGetShaderPrecisionFormat(int, int, int[], int, int[], int)
,
GL20.glCreateShader(int)
,
GL20.glDeleteShader(int)
void glShaderSource(int shader, String source)
glShaderSource
sets the source code in shader
to the source code in source
.
Any source code previously stored in the shader object is completely replaced.
The source code strings are not scanned or parsed at this time; they are simply copied into
the specified shader object.
Shader compiler support is optional, and thus must be queried before
use by calling glGetIntegerv
/
glGetIntegerv
with argument GL_SHADER_COMPILER
.
glShaderSource
, glCompileShader
,
glGetShaderPrecisionFormat
,
and glReleaseShaderCompiler
will each generate GL_INVALID_OPERATION
on implementations that do not support a shader compiler.
Such implementations instead offer the glShaderBinary
/
glShaderBinary
alternative
for supplying a pre-compiled shader binary.
OpenGL copies the shader source code strings when glShaderSource
is called, so an application may free its copy of the source code
strings immediately after the function returns.
GL_INVALID_OPERATION
is generated if a shader compiler is not supported.
GL_INVALID_VALUE
is generated if shader
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if shader
is not a shader object.
glGetIntegerv
/glGetIntegerv
with argument GL_SHADER_COMPILER
glGetShaderiv
/
glGetShaderiv
with arguments shader
and GL_SHADER_SOURCE_LENGTH
glGetShaderSource
with argument shader
shader
- Specifies the handle of the shader object whose source code is to be replaced.source
- The source code to be loaded into the shader.
IllegalArgumentException
- If source
is null
.GL20.glCompileShader(int)
,
GL20.glGetShaderPrecisionFormat(int, int, int[], int, int[], int)
,
GL20.glCreateShader(int)
,
GL20.glDeleteShader(int)
void glStencilFunc(int func, int ref, int mask)
The stencil test conditionally eliminates a pixel based on the
outcome of a comparison between the reference value and the
value in the stencil buffer. To enable and disable the test,
call glEnable
and glDisable
with argument GL_STENCIL_TEST
.
To specify actions based on the outcome of the stencil test,
call glStencilOp
or
glStencilOpSeparate
.
There can be two separate sets of func
,
ref
, and mask
parameters;
one affects back-facing polygons, and the other affects
front-facing polygons as well as other non-polygon primitives.
glStencilFunc
sets both front and back stencil state to the
same values. Use glStencilFuncSeparate
to set front and
back stencil state to different values.
func
is a symbolic constant that determines the stencil
comparison function. It accepts one of eight values,
shown in the following list. ref
is an integer reference
value that is used in the stencil comparison. It is clamped
to the range [0, 2^n - 1]
, where n
is the number of bitplanes
in the stencil buffer. mask
is bitwise AND
ed with both the
reference value and the stored stencil value, with
the AND
ed values participating in the comparison.
If stencil represents the value stored in the corresponding
stencil buffer location, the following list shows the effect
of each comparison function that can be specified by func
.
Only if the comparison succeeds is the pixel passed through
to the next stage in the rasterization process (see glStencilOp
).
All tests treat stencil values as unsigned integers in
the range [0, 2^n - 1]
, where n
is the number of bitplanes
in the stencil buffer.
The following values are accepted by func
:
GL_NEVER
Always fails.
GL_LESS
Passes if ( ref & mask
) < ( stencil & mask
).
GL_LEQUAL
Passes if ( ref & mask
) <= ( stencil & mask
).
GL_GREATER
Passes if ( ref & mask
) > ( stencil & mask
).
GL_GEQUAL
Passes if ( ref & mask
) >= ( stencil & mask
).
GL_EQUAL
Passes if ( ref & mask
) = ( stencil & mask
).
GL_NOTEQUAL
Passes if ( ref & mask
) != ( stencil & mask
).
GL_ALWAYS
Always passes.
Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes.
glStencilFunc
is the same as calling
glStencilFuncSeparate
with
face
set to GL_FRONT_AND_BACK
.
GL_INVALID_ENUM
is generated if func
is not one
of the eight accepted values.
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_FUNC
, GL_STENCIL_VALUE_MASK
, GL_STENCIL_REF
,
GL_STENCIL_BACK_FUNC
, GL_STENCIL_BACK_VALUE_MASK
, GL_STENCIL_BACK_REF
,
or GL_STENCIL_BITS
glIsEnabled
with argument GL_STENCIL_TEST
.
func
- Specifies the test function. Eight symbolic constants are valid:
GL_NEVER
, GL_LESS
, GL_LEQUAL
, GL_GREATER
, GL_GEQUAL
,
GL_EQUAL
, GL_NOTEQUAL
, and GL_ALWAYS
.
The initial value is GL_ALWAYS
.ref
- Specifies the reference value for the
stencil test. ref
is clamped to the range [0, 2^n - 1]
,
where n
is the number of bitplanes in the stencil buffer.
The initial value is 0.mask
- Specifies a mask that is AND
ed with both
the reference value and the stored stencil value when
the test is done. The initial value is all 1's.GL20.glBlendFunc(int, int)
,
GL20.glDepthFunc(int)
,
GL20.glEnable(int)
,
GL20.glStencilFuncSeparate(int, int, int, int)
,
GL20.glStencilMask(int)
,
GL20.glStencilMaskSeparate(int, int)
,
GL20.glStencilOp(int, int, int)
,
GL20.glStencilOpSeparate(int, int, int, int)
void glStencilFuncSeparate(int face, int func, int ref, int mask)
The stencil test conditionally eliminates a pixel based on the outcome of a comparison
between the reference value and the value in the stencil buffer. To enable and disable
the test, call glEnable
and glDisable
with argument GL_STENCIL_TEST
. To specify actions based on the outcome
of the stencil test, call glStencilOp
or
glStencilOpSeparate
.
There can be two separate sets of func
, ref
, and
mask
parameters; one affects back-facing polygons, and the other
affects front-facing polygons as well as other non-polygon primitives.
glStencilFunc
sets both front and back stencil
state to the same values, as if glStencilFuncSeparate
were called with
face
set to GL_FRONT_AND_BACK
.
func
is a symbolic constant that determines the stencil comparison
function. It accepts one of eight values, shown in the following list. ref
is an integer reference value that is used in the stencil comparison. It is clamped to the range [0, 2^n - 1]
,
where n
is the number of bitplanes in the stencil buffer. mask
is bitwise
AND
ed with both the reference value and the stored stencil value,
with the AND
ed values participating in the comparison.
If stencil represents the value stored in the corresponding stencil buffer location,
the following list shows the effect of each comparison function that can be specified by
func
. Only if the comparison succeeds is the pixel passed through to
the next stage in the rasterization process (see glStencilOp
).
All tests treat stencil values as unsigned integers in the range [0, 2^n - 1]
,
where n
is the number of bitplanes in the stencil buffer.
The following values are accepted by func
:
GL_NEVER
Always fails.
GL_LESS
Passes if ( ref & mask
) < ( stencil & mask
).
GL_LEQUAL
Passes if ( ref & mask
) <= ( stencil & mask
).
GL_GREATER
Passes if ( ref & mask
) > ( stencil & mask
).
GL_GEQUAL
Passes if ( ref & mask
) >= ( stencil & mask
).
GL_EQUAL
Passes if ( ref & mask
) = ( stencil & mask
).
GL_NOTEQUAL
Passes if ( ref & mask
) != ( stencil & mask
).
GL_ALWAYS
Always passes.
Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes.
GL_INVALID_ENUM
is generated if face
is
not GL_FRONT
, GL_BACK
, or GL_FRONT_AND_BACK
.
GL_INVALID_ENUM
is generated if func
is
not one of the eight accepted values.
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_FUNC
, GL_STENCIL_VALUE_MASK
,
GL_STENCIL_REF
, GL_STENCIL_BACK_FUNC
, GL_STENCIL_BACK_VALUE_MASK
,
GL_STENCIL_BACK_REF
, or GL_STENCIL_BITS
glIsEnabled
with argument GL_STENCIL_TEST
face
- Specifies whether front and/or back stencil state is updated.
Three symbolic constants are valid: GL_FRONT
, GL_BACK
,
and GL_FRONT_AND_BACK
.func
- Specifies the test function. Eight symbolic constants are valid:
GL_NEVER
, GL_LESS
, GL_LEQUAL
,
GL_GREATER
, GL_GEQUAL
, GL_EQUAL
,
GL_NOTEQUAL
, and GL_ALWAYS
. The initial value is GL_ALWAYS
.ref
- Specifies the reference value for the stencil test.
ref
is clamped to the range [0, 2^n - 1]
,
where n
is the number of bitplanes in the stencil buffer. The initial value is 0.mask
- Specifies a mask that is AND
ed with both the reference
value and the stored stencil value when the test is done.
The initial value is all 1's.GL20.glBlendFunc(int, int)
,
GL20.glDepthFunc(int)
,
GL20.glEnable(int)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilMask(int)
,
GL20.glStencilMaskSeparate(int, int)
,
GL20.glStencilOp(int, int, int)
,
GL20.glStencilOpSeparate(int, int, int, int)
void glStencilMask(int mask)
glStencilMask
controls the writing of individual bits in the stencil planes.
The least significant n
bits of mask
, where n
is the number of bits in the
stencil buffer, specify a mask. Where a 1 appears in the mask,
it's possible to write to the corresponding bit in the stencil buffer.
Where a 0 appears, the corresponding bit is write-protected.
Initially, all bits are enabled for writing.
There can be two separate mask
writemasks; one affects back-facing polygons,
and the other affects front-facing polygons as well as other
non-polygon primitives. glStencilMask
sets both front and back stencil
writemasks to the same values. Use glStencilMaskSeparate
to set
front and back stencil writemasks to different values.
glStencilMask
is the same as calling glStencilMaskSeparate
with
face
set to GL_FRONT_AND_BACK
.
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_WRITEMASK
, GL_STENCIL_BACK_WRITEMASK
, or GL_STENCIL_BITS
mask
- Specifies a bit mask to enable and disable writing of
individual bits in the stencil planes. Initially, the mask is all 1's.GL20.glColorMask(boolean, boolean, boolean, boolean)
,
GL20.glDepthMask(boolean)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilFuncSeparate(int, int, int, int)
,
GL20.glStencilMaskSeparate(int, int)
,
GL20.glStencilOp(int, int, int)
,
GL20.glStencilOpSeparate(int, int, int, int)
void glStencilMaskSeparate(int face, int mask)
glStencilMaskSeparate
controls the writing of individual bits in the
stencil planes. The least significant n
bits of mask
, where n
is the
number of bits in the stencil buffer, specify a mask. Where a 1
appears in the mask, it's possible to write to the corresponding
bit in the stencil buffer. Where a 0 appears, the corresponding
bit is write-protected. Initially, all bits are enabled for writing.
There can be two separate mask
writemasks; one affects back-facing polygons,
and the other affects front-facing polygons as well as other non-polygon primitives.
glStencilMask
sets both front and back stencil writemasks to the same values,
as if glStencilMaskSeparate
were called with face
set to GL_FRONT_AND_BACK
.
GL_INVALID_ENUM
is generated if face
is not
GL_FRONT
, GL_BACK
, or GL_FRONT_AND_BACK
.
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_WRITEMASK
, GL_STENCIL_BACK_WRITEMASK
, or GL_STENCIL_BITS
face
- Specifies whether the front and/or back stencil writemask is updated.
Three symbolic constants are valid: GL_FRONT
, GL_BACK
, and GL_FRONT_AND_BACK
.mask
- Specifies a bit mask to enable and disable writing of individual
bits in the stencil planes. Initially, the mask is all 1's.GL20.glColorMask(boolean, boolean, boolean, boolean)
,
GL20.glDepthMask(boolean)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilFuncSeparate(int, int, int, int)
,
GL20.glStencilMask(int)
,
GL20.glStencilMaskSeparate(int, int)
,
GL20.glStencilOp(int, int, int)
,
GL20.glStencilOpSeparate(int, int, int, int)
void glStencilOp(int fail, int zfail, int zpass)
The stencil test conditionally eliminates a pixel based on the
outcome of a comparison between the value in the stencil buffer
and a reference value. To enable and disable the test,
call glEnable
and glDisable
with argument GL_STENCIL_TEST
;
to control it, call glStencilFunc
or
glStencilFuncSeparate
.
There can be two separate sets of fail
, zfail
, and zpass
parameters;
one affects back-facing polygons, and the other affects front-facing polygons
as well as other non-polygon primitives. glStencilOp
sets both front and
back stencil state to the same values. Use glStencilOpSeparate
to set front and back stencil state to different values.
glStencilOp
takes three arguments that indicate what happens to the
stored stencil value while stenciling is enabled. If the stencil test fails,
no change is made to the pixel's color or depth buffers, and fail
specifies what happens to the stencil buffer contents.
The following eight actions are possible.
GL_KEEP
Keeps the current value.
GL_ZERO
Sets the stencil buffer value to 0.
GL_REPLACE
Sets the stencil buffer value to ref
, as specified
by glStencilFunc
.
GL_INCR
Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.
GL_INCR_WRAP
Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value.
GL_DECR
Decrements the current stencil buffer value. Clamps to 0.
GL_DECR_WRAP
Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero.
GL_INVERT
Bitwise inverts the current stencil buffer value.
Stencil buffer values are treated as unsigned integers.
When incremented and decremented, values are clamped
to the range [0, 2^n - 1]
,
where n
is the value returned by
querying GL_STENCIL_BITS
.
The other two arguments to glStencilOp
specify stencil
buffer actions that depend on whether subsequent depth
buffer tests succeed (zpass
) or fail (zfail
)
(see glDepthFunc
).
The actions are specified using the same eight symbolic constants
as fail
. Note that zfail
is ignored when there is
no depth buffer, or when the depth buffer is not enabled.
In these cases, fail
and zpass
specify stencil action when
the stencil test fails and passes, respectively.
Initially the stencil test is disabled. If there is no stencil buffer,
no stencil modification can occur and it is as if the stencil tests
always pass, regardless of any call to glStencilOp
.
glStencilOp
is the same as calling glStencilOpSeparate
with
face
set to GL_FRONT_AND_BACK
.
GL_INVALID_ENUM
is generated if fail
,
zfail
, or zpass
is any value other than the eight defined symbolic constant values.
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_FAIL
, GL_STENCIL_PASS_DEPTH_PASS
,
GL_STENCIL_PASS_DEPTH_FAIL
, GL_STENCIL_BACK_FAIL
, GL_STENCIL_BACK_PASS_DEPTH_PASS
,
GL_STENCIL_BACK_PASS_DEPTH_FAIL
, or GL_STENCIL_BITS
glIsEnabled
with argument GL_STENCIL_TEST
fail
- Specifies the action to take when the stencil test fails.
Eight symbolic constants are accepted:
GL_KEEP
, GL_ZERO
, GL_REPLACE
, GL_INCR
, GL_INCR_WRAP
,
GL_DECR
, GL_DECR_WRAP
, and GL_INVERT
.
The initial value is GL_KEEP
.zfail
- Specifies the stencil action when the stencil test passes,
but the depth test fails. zfail
accepts the same symbolic constants as fail
.
The initial value is GL_KEEP
.zpass
- Specifies the stencil action when both the stencil
test and the depth test pass, or when the stencil test passes and
either there is no depth buffer or depth testing is not enabled.
zpass
accepts the same symbolic constants as fail
. The initial value is GL_KEEP
.GL20.glBlendFunc(int, int)
,
GL20.glDepthFunc(int)
,
GL20.glEnable(int)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilFuncSeparate(int, int, int, int)
,
GL20.glStencilMask(int)
,
GL20.glStencilMaskSeparate(int, int)
,
GL20.glStencilOpSeparate(int, int, int, int)
void glStencilOpSeparate(int face, int fail, int zfail, int zpass)
The stencil test conditionally eliminates a pixel based on the outcome of a
comparison between the value in the stencil buffer and a reference value.
To enable and disable the test, call glEnable
and glDisable
with argument
GL_STENCIL_TEST
; to control it, call glStencilFunc
or glStencilFuncSeparate
.
There can be two separate sets of fail
, zfail
, and zpass
parameters;
one affects back-facing polygons, and the other affects front-facing polygons
as well as other non-polygon primitives. glStencilOp
sets both front and back
stencil state to the same values, as if glStencilOpSeparate
were called
with face set to GL_FRONT_AND_BACK
.
glStencilOpSeparate
takes three arguments that indicate what happens to the
stored stencil value while stenciling is enabled. If the stencil test fails,
no change is made to the pixel's color or depth buffers, and fail
specifies
what happens to the stencil buffer contents. The following eight actions
are possible.
GL_KEEP
Keeps the current value.
GL_ZERO
Sets the stencil buffer value to 0.
GL_REPLACE
Sets the stencil buffer value to ref
, as specified
by glStencilFunc
.
GL_INCR
Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.
GL_INCR_WRAP
Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value.
GL_DECR
Decrements the current stencil buffer value. Clamps to 0.
GL_DECR_WRAP
Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero.
GL_INVERT
Bitwise inverts the current stencil buffer value.
Stencil buffer values are treated as unsigned integers.
When incremented and decremented, values are clamped to the range
[0, 2^n - 1]
,
where n
is the value returned by querying GL_STENCIL_BITS
.
The other two arguments to glStencilOpSeparate
specify stencil buffer
actions that depend on whether subsequent depth buffer tests
succeed (zpass
) or fail (zfail
)
(see glDepthFunc
). The actions
are specified using the same eight symbolic constants as fail
.
Note that zfail
is ignored when there is no depth buffer, or when
the depth buffer is not enabled. In these cases, fail
and zpass
specify stencil action when the stencil test fails and passes, respectively.
Initially the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes.
GL_INVALID_ENUM
is generated if face
is any value other
than GL_FRONT
, GL_BACK
, or GL_FRONT_AND_BACK
.
GL_INVALID_ENUM
is generated if fail
,
zfail
, or zpass
is any value other than the eight defined symbolic constant values.
glGetIntegerv
/glGetIntegerv
with argument GL_STENCIL_FAIL
, GL_STENCIL_PASS_DEPTH_PASS
,
GL_STENCIL_PASS_DEPTH_FAIL
, GL_STENCIL_BACK_FAIL
,
GL_STENCIL_BACK_PASS_DEPTH_PASS
, GL_STENCIL_BACK_PASS_DEPTH_FAIL
,
or GL_STENCIL_BITS
glIsEnabled
with argument GL_STENCIL_TEST
face
- Specifies whether front and/or back stencil state is updated.
Three symbolic constants are valid: GL_FRONT
, GL_BACK
, and GL_FRONT_AND_BACK
.fail
- Specifies the action to take when the stencil test fails.
Eight symbolic constants are accepted: GL_KEEP
, GL_ZERO
,
GL_REPLACE
, GL_INCR
, GL_INCR_WRAP
, GL_DECR
,
GL_DECR_WRAP
, and GL_INVERT
.
The initial value is GL_KEEP
.zfail
- Specifies the stencil action when the stencil test passes,
but the depth test fails. zfail
accepts the same
symbolic constants as fail
.
The initial value is GL_KEEP
.zpass
- Specifies the stencil action when both the stencil test
and the depth test pass, or when the stencil test passes and either
there is no depth buffer or depth testing is not enabled. zpass
accepts the same symbolic constants as fail
.
The initial value is GL_KEEP
.GL20.glBlendFunc(int, int)
,
GL20.glDepthFunc(int)
,
GL20.glEnable(int)
,
GL20.glStencilFunc(int, int, int)
,
GL20.glStencilFuncSeparate(int, int, int, int)
,
GL20.glStencilMask(int)
,
GL20.glStencilMaskSeparate(int, int)
,
GL20.glStencilOp(int, int, int)
void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, Buffer data)
To define texture images, call glTexImage2D
. The arguments
describe the parameters of the texture image, such as height,
width, level-of-detail number (see glTexParameterf
/
glTexParameterfv
/
glTexParameterfv
/
glTexParameteri
/
glTexParameteriv
/
glTexParameteriv
), and format.
The last three arguments describe how the image is represented in memory.
Data is read from data
as a sequence of unsigned bytes or shorts,
depending on type
. When type
is GL_UNSIGNED_BYTE
, each of the bytes
is interpreted as one color component. When type
is one of
GL_UNSIGNED_SHORT_5_6_5
, GL_UNSIGNED_SHORT_4_4_4_4
, or
GL_UNSIGNED_SHORT_5_5_5_1
, each unsigned short value is
interpreted as containing all the components for a single texel,
with the color components arranged according to format
. Color components
are treated as groups of one, two, three, or four values, again based on
format
. Groups of components are referred to as texels.
width × height
texels are read from data
.
By default, these texels are taken from adjacent memory locations,
except that after all width
texels are read, the read pointer is
advanced to the next four-byte boundary. The four-byte row alignment
is specified by glPixelStorei
with argument GL_UNPACK_ALIGNMENT
,
and it can be set to one, two, four, or eight bytes.
The first element corresponds to the lower left corner of the texture image. Subsequent elements progress left-to-right through the remaining texels in the lowest row of the texture image, and then in successively higher rows of the texture image. The final element corresponds to the upper right corner of the texture image.
format
determines the composition of each element in data
.
It can assume one of these symbolic values:
GL_ALPHA
Each element is a single alpha component. The GL converts it to
floating point and assembles it into an RGBA element by
attaching 0 for red, green, and blue. Each component is
then clamped to the range [0, 1]
.
GL_RGB
Each element is an RGB triple. The GL converts it to floating point
and assembles it into an RGBA element by attaching 1 for alpha.
Each component is then clamped to the range [0, 1]
.
GL_RGBA
Each element contains all four components. The GL converts
it to floating point, then each component is clamped to
the range [0, 1]
.
GL_LUMINANCE
Each element is a single luminance value. The GL converts it to
floating point, then assembles it into an RGBA element by
replicating the luminance value three times for red, green,
and blue and attaching 1 for alpha. Each component is then clamped
to the range [0, 1]
.
GL_LUMINANCE_ALPHA
Each element is a luminance/alpha pair. The GL converts it to
floating point, then assembles it into an RGBA element by
replicating the luminance value three times for red, green, and blue.
Each component is then clamped to the range [0, 1]
.
Color components are converted to floating point based on the type
.
When type
is GL_UNSIGNED_BYTE
, each component is divided by 2^8 - 1
.
When type
is GL_UNSIGNED_SHORT_5_6_5
, GL_UNSIGNED_SHORT_4_4_4_4
,
or GL_UNSIGNED_SHORT_5_5_5_1
, each component is divided by 2^N - 1
,
where N
is the number of bits in the bitfield.
internalformat
must match format
. No conversion between formats is
supported during texture image processing. type
may be used as a
hint to specify how much precision is desired, but a GL implementation
may choose to store the texture array at any internal resolution it chooses.
data
may be null
. In this case, texture memory is allocated
to accommodate a texture of width width
and height height
. You can
then download subtextures to initialize this texture memory.
The image is undefined if the user tries to apply an uninitialized
portion of the texture image to a primitive.
glTexImage2D
specifies a two-dimensional or cube-map texture
for the current texture unit, specified with glActiveTexture
.
GL_INVALID_ENUM
is generated if target
is not
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
GL_INVALID_ENUM
is generated if format
or
type
is not an accepted value.
GL_INVALID_VALUE
is generated if target
is one of
the six cube map 2D image targets and the width and height
parameters are not equal.
GL_INVALID_VALUE
is generated if level
is less than 0.
GL_INVALID_VALUE
may be generated if level
is greater
than log_2(max)
, where max
is the returned value of
GL_MAX_TEXTURE_SIZE
when target
is GL_TEXTURE_2D
or
GL_MAX_CUBE_MAP_TEXTURE_SIZE
when target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if internalformat
is not an accepted format.
GL_INVALID_VALUE
is generated if width
or height
is less than 0 or greater than GL_MAX_TEXTURE_SIZE
when
target
is GL_TEXTURE_2D
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
when target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if
border
is not 0.
GL_INVALID_OPERATION
is generated if
format
does not match internalformat
.
GL_INVALID_OPERATION
is generated if
type
is GL_UNSIGNED_SHORT_5_6_5
and format
is not GL_RGB
.
GL_INVALID_OPERATION
is generated if
type
is GL_UNSIGNED_SHORT_4_4_4_4
or
GL_UNSIGNED_SHORT_5_5_5_1
and format
is not GL_RGBA
.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_TEXTURE_SIZE
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
target
- Specifies the target texture. Must be
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.level
- Specifies the level-of-detail number.
Level 0 is the base image level. Level n is the nth mipmap
reduction image.internalformat
- Specifies the internal format of the
texture. Must be one of the following symbolic constants:
GL_ALPHA
, GL_LUMINANCE
, GL_LUMINANCE_ALPHA
, GL_RGB
, GL_RGBA
.width
- Specifies the width of the texture image.
All implementations support 2D texture images that are at
least 64 texels wide and cube-mapped texture images that
are at least 16 texels wide.height
- Specifies the height of the texture image
All implementations support 2D texture images that are
at least 64 texels high and cube-mapped texture images
that are at least 16 texels high.border
- Specifies the width of the border. Must be 0.format
- Specifies the format of the texel data.
Must match internalformat
. The following symbolic values
are accepted: GL_ALPHA
, GL_RGB
, GL_RGBA
, GL_LUMINANCE
,
and GL_LUMINANCE_ALPHA
.type
- Specifies the data type of the texel data.
The following symbolic values are accepted: GL_UNSIGNED_BYTE
,
GL_UNSIGNED_SHORT_5_6_5
, GL_UNSIGNED_SHORT_4_4_4_4
, and GL_UNSIGNED_SHORT_5_5_5_1
.data
- Specifies the image data as a buffer in memory.
IllegalArgumentException
- If data
is non-null
and does not contain
the desired number of pixels.GL20.glActiveTexture(int)
,
GL20.glCompressedTexImage2D(int, int, int, int, int, int, int, Buffer)
,
GL20.glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glCopyTexSubImage2D(int, int, int, int, int, int, int, int)
,
GL20.glPixelStorei(int, int)
,
GL20.glTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glTexParameterf(int target, int pname, float param)
glTexParameterf
assigns the value or values in params
to the
texture parameter specified as pname
. target
defines
the target texture of the active texture,
either GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.
The following symbols are accepted in pname
:
GL_TEXTURE_MIN_FILTER
The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element. There are six defined minifying functions. Two of them use the nearest one or nearest four texture elements to compute the texture value. The other four use mipmaps.
A mipmap is an ordered set of arrays representing the same image at
progressively lower resolutions. If the texture has dimensions w × h
,
there are floor(log_2(max(w, h))) + 1
mipmap levels. The first mipmap
level is the original texture, with dimensions w × h
. Each subsequent
mipmap level has dimensions max(1, floor(w/2^i)) × max(1, floor(h/2^i))
,
where i is the mipmap level, until the final mipmap is reached,
which has dimension 1 × 1
.
To define the mipmap levels, call glTexImage2D
,
glCompressedTexImage2D
, or
glCopyTexImage2D
with the level argument indicating the order of the mipmaps.
Level 0 is the original texture; level floor(log_2(max(w, h)))
is
the final 1 × 1
mipmap.
params
supplies a function for minifying the texture as one of the following:
GL_NEAREST
Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
GL_LINEAR
Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured.
GL_NEAREST_MIPMAP_NEAREST
Chooses the mipmap that most closely matches the size of the pixel
being textured and uses the GL_NEAREST
criterion (the texture
element nearest to the center of the pixel) to produce a texture value.
GL_LINEAR_MIPMAP_NEAREST
Chooses the mipmap that most closely matches the size of the pixel being
textured and uses the GL_LINEAR
criterion (a weighted average of the
four texture elements that are closest to the center of the pixel)
to produce a texture value.
GL_NEAREST_MIPMAP_LINEAR
Chooses the two mipmaps that most closely match the size of the pixel being
textured and uses the GL_NEAREST
criterion (the texture element nearest
to the center of the pixel) to produce a texture value from each mipmap.
The final texture value is a weighted average of those two values.
GL_LINEAR_MIPMAP_LINEAR
Chooses the two mipmaps that most closely match the size of the pixel
being textured and uses the GL_LINEAR
criterion (a weighted average
of the four texture elements that are closest to the center of the pixel)
to produce a texture value from each mipmap. The final texture value
is a weighted average of those two values.
As more texture elements are sampled in the minification process,
fewer aliasing artifacts will be apparent. While the GL_NEAREST
and
GL_LINEAR
minification functions can be faster than the other four,
they sample only one or four texture elements to determine the texture value
of the pixel being rendered and can produce moire patterns or ragged transitions.
The initial value of GL_TEXTURE_MIN_FILTER
is GL_NEAREST_MIPMAP_LINEAR
.
GL_TEXTURE_MAG_FILTER
The texture magnification function is used when the pixel being textured
maps to an area less than or equal to one texture element. It sets the
texture magnification function to either GL_NEAREST
or GL_LINEAR
(see below).
GL_NEAREST
is generally faster than GL_LINEAR
, but it can produce textured images with
sharper edges because the transition between texture elements is not as smooth.
The initial value of GL_TEXTURE_MAG_FILTER
is GL_LINEAR
.
GL_NEAREST
Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
GL_LINEAR
Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured.
GL_TEXTURE_WRAP_S
Sets the wrap parameter for texture coordinate s to either GL_CLAMP_TO_EDGE
,
GL_MIRRORED_REPEAT
, or GL_REPEAT
. GL_CLAMP_TO_EDGE
causes s coordinates to be
clamped to the range [1/2N, 1 - 1/2N]
, where N
is the size of the texture in the
direction of clamping. GL_REPEAT
causes the integer part of the s coordinate
to be ignored; the GL uses only the fractional part, thereby creating a
repeating pattern. GL_MIRRORED_REPEAT
causes the s coordinate to be set
to the fractional part of the texture coordinate if the integer
part of s is even; if the integer part of s is odd, then the s texture
coordinate is set to 1 - frac(s)
, where frac(s)
represents the
fractional part of s
. Initially, GL_TEXTURE_WRAP_S
is set
to GL_REPEAT
.
GL_TEXTURE_WRAP_T
Sets the wrap parameter for texture coordinate t to either
GL_CLAMP_TO_EDGE
, GL_MIRRORED_REPEAT
, or GL_REPEAT
. See the
discussion under GL_TEXTURE_WRAP_S
. Initially, GL_TEXTURE_WRAP_T
is set to GL_REPEAT
.
Suppose that a texture is accessed from a fragment shader or vertex shader
and has set GL_TEXTURE_MIN_FILTER
to one of the functions that requires mipmaps.
If either the dimensions of the texture images currently defined (with previous
calls to glTexImage2D
,
glCompressedTexImage2D
,
or glCopyTexImage2D
) do not
follow the proper sequence for mipmaps (described above), or there are fewer
texture images defined than are needed, or the set of texture images were
defined with different formats or types, then the texture image unit will
return (R, G, B, A) = (0, 0, 0, 1)
.
Similarly, if the width or height of a texture image are not powers of
two and either the GL_TEXTURE_MIN_FILTER
is set to one of the functions
that requires mipmaps or the GL_TEXTURE_WRAP_S
or GL_TEXTURE_WRAP_T
is not set to GL_CLAMP_TO_EDGE
, then the texture image unit
will return (R, G, B, A) = (0, 0, 0, 1)
.
glTexParameterf
specifies the texture parameters for the
active texture unit, specified by calling glActiveTexture
.
GL_INVALID_ENUM
is generated if target
or pname
is
not one of the accepted defined values.
GL_INVALID_ENUM
is generated if params
should
have a defined symbolic constant value (based on the value of pname
)
and does not.
glGetTexParameterfv
/
glGetTexParameterfv
/
glGetTexParameteriv
/
glGetTexParameteriv
target
- Specifies the target texture, which must be either
GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.pname
- Specifies the symbolic name of a single-valued
texture parameter. pname
can be one of the following:
GL_TEXTURE_MIN_FILTER
, GL_TEXTURE_MAG_FILTER
,
GL_TEXTURE_WRAP_S
, or GL_TEXTURE_WRAP_T
.param
- Specifies the value of pname
.GL20.glActiveTexture(int)
,
GL20.glBindTexture(int, int)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glCopyTexSubImage2D(int, int, int, int, int, int, int, int)
,
GL20.glPixelStorei(int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
,
GL20.glTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
void glTexParameterfv(int target, int pname, float[] params, int offset)
glTexParameterf
.
GL_INVALID_ENUM
is generated if target
or pname
is
not one of the accepted defined values.
GL_INVALID_ENUM
is generated if params
should
have a defined symbolic constant value (based on the value of pname
)
and does not.
target
- Specifies the target texture, which must be either
GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.pname
- Specifies the symbolic name of a single-valued
texture parameter. pname
can be one of the following:
GL_TEXTURE_MIN_FILTER
, GL_TEXTURE_MAG_FILTER
,
GL_TEXTURE_WRAP_S
, or GL_TEXTURE_WRAP_T
.params
- Specifies an array where the value of pname
is stored.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glTexParameterfv(int target, int pname, FloatBuffer params)
Buffer
version of glTexParameterfv
.
GL_INVALID_ENUM
is generated if target
or pname
is
not one of the accepted defined values.
GL_INVALID_ENUM
is generated if params
should
have a defined symbolic constant value (based on the value of pname
)
and does not.
target
- Specifies the target texture, which must be either
GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.pname
- Specifies the symbolic name of a single-valued
texture parameter. pname
can be one of the following:
GL_TEXTURE_MIN_FILTER
, GL_TEXTURE_MAG_FILTER
,
GL_TEXTURE_WRAP_S
, or GL_TEXTURE_WRAP_T
.params
- Specifies a buffer where the value of pname
is stored.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glTexParameteri(int target, int pname, int param)
glTexParameterf
.
GL_INVALID_ENUM
is generated if target
or pname
is
not one of the accepted defined values.
GL_INVALID_ENUM
is generated if params
should
have a defined symbolic constant value (based on the value of pname
)
and does not.
target
- Specifies the target texture, which must be either
GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.pname
- Specifies the symbolic name of a single-valued
texture parameter. pname
can be one of the following:
GL_TEXTURE_MIN_FILTER
, GL_TEXTURE_MAG_FILTER
,
GL_TEXTURE_WRAP_S
, or GL_TEXTURE_WRAP_T
.param
- Specifies the value of pname
.GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glTexParameteriv(int target, int pname, int[] params, int offset)
glTexParameteri
.
GL_INVALID_ENUM
is generated if target
or pname
is
not one of the accepted defined values.
GL_INVALID_ENUM
is generated if params
should
have a defined symbolic constant value (based on the value of pname
)
and does not.
target
- Specifies the target texture, which must be either
GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.pname
- Specifies the symbolic name of a single-valued
texture parameter. pname
can be one of the following:
GL_TEXTURE_MIN_FILTER
, GL_TEXTURE_MAG_FILTER
,
GL_TEXTURE_WRAP_S
, or GL_TEXTURE_WRAP_T
.params
- Specifies an array where the value of pname
is stored.offset
- The starting offset within the params
array.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If params.length -
offset
is smaller than the number of values required by the parameter.GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
void glTexParameteriv(int target, int pname, IntBuffer params)
Buffer
version of glTexParameteriv
.
GL_INVALID_ENUM
is generated if target
or pname
is
not one of the accepted defined values.
GL_INVALID_ENUM
is generated if params
should
have a defined symbolic constant value (based on the value of pname
)
and does not.
target
- Specifies the target texture, which must be either
GL_TEXTURE_2D
or GL_TEXTURE_CUBE_MAP
.pname
- Specifies the symbolic name of a single-valued
texture parameter. pname
can be one of the following:
GL_TEXTURE_MIN_FILTER
, GL_TEXTURE_MAG_FILTER
,
GL_TEXTURE_WRAP_S
, or GL_TEXTURE_WRAP_T
.params
- Specifies a buffer where the value of pname
is stored.
IllegalArgumentException
- If params
is null
.
IllegalArgumentException
- If params.remaining()
is smaller than the
number of values required by the parameter.GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, int[], int)
void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, Buffer data)
glTexSubImage2D
redefines a contiguous subregion of an
existing two-dimensional texture image. The texels referenced by data
replace the portion of the existing texture array
with x indices xoffset
and xoffset + width - 1
, inclusive,
and y indices yoffset
and yoffset + height - 1
, inclusive.
This region may not include any texels outside the range of the
texture array as it was originally specified. It is not an
error to specify a subtexture with zero width or height,
but such a specification has no effect.
Storage parameter GL_UNPACK_ALIGNMENT
, set by glPixelStorei
,
affects the way that data is read out of client memory.
See glPixelStorei
for a description.
glTexSubImage2D
specifies a two-dimensional or cube-map
subtexture for the current texture unit,
specified with glActiveTexture
.
GL_INVALID_ENUM
is generated if target
is not
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.
GL_INVALID_ENUM
is generated if format
or type
is
not an accepted value.
GL_INVALID_VALUE
is generated if level
is less than 0.
GL_INVALID_VALUE
may be generated if level
is greater
than log_2(max)
, where max
is the returned value of
GL_MAX_TEXTURE_SIZE
when target
is GL_TEXTURE_2D
or
GL_MAX_CUBE_MAP_TEXTURE_SIZE
when target
is not GL_TEXTURE_2D
.
GL_INVALID_VALUE
is generated if xoffset < 0
, xoffset + width > w
,
yoffset < 0
, or yoffset + height > h
,
where w
is the width and h
is the
height of the texture image being modified.
GL_INVALID_VALUE
is generated if width
or height
is less than 0.
GL_INVALID_OPERATION
is generated if the texture array has not
been defined by a previous glTexImage2D
or glCopyTexImage2D
operation
whose internalformat
matches the format
of
glTexSubImage2D
.
GL_INVALID_OPERATION
is generated if type
is
GL_UNSIGNED_SHORT_5_6_5
and format
is not GL_RGB
.
GL_INVALID_OPERATION
is generated if type
is GL_UNSIGNED_SHORT_4_4_4_4
or
GL_UNSIGNED_SHORT_5_5_5_1
and format
is not GL_RGBA
.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_TEXTURE_SIZE
or GL_MAX_CUBE_MAP_TEXTURE_SIZE
target
- Specifies the target texture of the active texture. Must be
GL_TEXTURE_2D
, GL_TEXTURE_CUBE_MAP_POSITIVE_X
, GL_TEXTURE_CUBE_MAP_NEGATIVE_X
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y
, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z
, or GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
.level
- Specifies the level-of-detail number. Level 0 is the
base image level. Level n is the nth mipmap reduction image.xoffset
- Specifies a texel offset in the x direction
within the texture array.yoffset
- Specifies a texel offset in the y direction
within the texture array.width
- Specifies the width of the texture subimage.height
- Specifies the height of the texture subimage.format
- Specifies the format of the pixel data.
The following symbolic values are accepted:
GL_ALPHA
, GL_RGB
, GL_RGBA
, GL_LUMINANCE
, and GL_LUMINANCE_ALPHA
.type
- Specifies the data type of the pixel data.
The following symbolic values are accepted:
GL_UNSIGNED_BYTE
, GL_UNSIGNED_SHORT_5_6_5
,
GL_UNSIGNED_SHORT_4_4_4_4
, and GL_UNSIGNED_SHORT_5_5_5_1
.data
- Specifies the image data as a buffer in memory.
IllegalArgumentException
- If data
is null
.
IllegalArgumentException
- If data
does not contain
the desired number of pixels.GL20.glActiveTexture(int)
,
GL20.glCompressedTexImage2D(int, int, int, int, int, int, int, Buffer)
,
GL20.glCompressedTexSubImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glCopyTexImage2D(int, int, int, int, int, int, int, int)
,
GL20.glCopyTexSubImage2D(int, int, int, int, int, int, int, int)
,
GL20.glPixelStorei(int, int)
,
GL20.glTexImage2D(int, int, int, int, int, int, int, int, Buffer)
,
GL20.glTexParameterf(int, int, float)
,
GL20.glTexParameterfv(int, int, FloatBuffer)
,
GL20.glTexParameterfv(int, int, float[], int)
,
GL20.glTexParameteri(int, int, int)
,
GL20.glTexParameteriv(int, int, IntBuffer)
,
GL20.glTexParameteriv(int, int, int[], int)
void glUniform1f(int location, float x)
glUniform
modifies the value of a uniform variable or a
uniform variable array. The location of the uniform variable to be modified
is specified by location
, which should be a value returned
by glGetUniformLocation
.
glUniform
operates on the program object
that was made part of current state by calling glUseProgram
.
The commands glUniform{1|2|3|4}{f|i}
is used to change the
value of the uniform variable specified by location
using the
values passed as arguments. The number specified in the command
should match the number of components in the data type of the specified
uniform variable (e.g., 1
for float, int, bool; 2
for vec2, ivec2, bvec2, etc.).
The suffix f
indicates that floating-point values are being passed;
the suffix i
indicates that integer values are being passed,
and this type should also match the data type of the
specified uniform variable. The i
variants of this function should be used to
provide values for uniform variables defined as int, ivec2, ivec3, ivec4, or
arrays of these. The f
variants should be used to provide values for
uniform variables of type float, vec2, vec3, vec4, or arrays of these.
Either the i
or the f
variants may be used to provide values for
uniform variables of type bool, bvec2, bvec3, bvec4, or arrays of these.
The uniform variable will be set to false if the input value is 0 or 0.0f,
and it will be set to true otherwise.
All active uniform variables defined in a program object are initialized
to 0 when the program object is linked successfully. They retain the
values assigned to them by a call to glUniform
until the next successful
link operation occurs on the program object, when they are once again
initialized to 0.
The commands glUniform{1|2|3|4}{f|i}v
can be used to modify a
single uniform variable or a uniform variable array.
These commands pass a count and the values to be
loaded into a uniform variable or a uniform variable array.
A count of 1 should be used if modifying the value of a single
uniform variable, and a count of 1 or greater can be used to
modify an entire array or part of an array. When loading n
elements starting at an arbitrary position m in a uniform
variable array, elements m + n - 1 in the array will be replaced
with the new values. If m + n - 1 is larger than the size of the
uniform variable array, values for all array elements beyond
the end of the array will be ignored. The number specified in
the name of the command indicates the number of components for
each element in value
, and it should match the number of
components in the data type of the specified uniform variable
(e.g., 1
for float, int, bool; 2
for vec2, ivec2, bvec2, etc.).
The data type specified in the name of the command must match
the data type for the specified uniform variable as described
previously for glUniform{1|2|3|4}{f|i}
.
For uniform variable arrays, each element of the array is
considered to be of the type indicated in the name of the command
(e.g., glUniform3f
or glUniform3fv
can be used to load a uniform
variable array of type vec3). The number of elements of the uniform
variable array to be modified is specified by count
.
The commands glUniformMatrix{2|3|4}fv
are used to modify a
matrix or an array of matrices. The numbers in the command name
are interpreted as the dimensionality of the matrix.
The number 2
indicates a 2 × 2 matrix (i.e., 4 values),
the number 3
indicates a 3 × 3 matrix (i.e., 9 values),
and the number 4
indicates a 4 × 4 matrix (i.e., 16 values).
Each matrix is assumed to be supplied in column major order.
The count
argument indicates the number of matrices to be passed.
A count of 1 should be used if modifying the value of a single matrix,
and a count greater than 1 can be used to modify an array of matrices.
glUniform1i
and glUniform1iv
are the only two functions that may be
used to load uniform variables defined as sampler types.
Loading samplers with any other function will result in a
GL_INVALID_OPERATION
error.
If count
is greater than 1 and the indicated uniform variable
is not an array, a GL_INVALID_OPERATION
error is generated and the
specified uniform variable will remain unchanged.
Other than the preceding exceptions, if the type and size of the
uniform variable as defined in the shader do not match the type and
size specified in the name of the command used to load its value, a
GL_INVALID_OPERATION
error will be generated and the specified uniform
variable will remain unchanged.
If location
is a value other than -1 and it does not represent a
valid uniform variable location in the current program object,
an error will be generated, and no changes will be made to the
uniform variable storage of the current program object.
If location
is equal to -1, the data passed in will be silently
ignored and the specified uniform variable will not be changed.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
glGetIntegerv
/glGetIntegerv
with the argument GL_CURRENT_PROGRAM
glGetActiveUniform
with the handle of a program object and the index of an active uniform variable
glGetUniformfv
/
glGetUniformfv
/
glGetUniformiv
/
glGetUniformiv
with the handle of a program object and the location of a uniform variable
glGetUniformLocation
with the handle of a program object and the name of a uniform variable
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.GL20.glLinkProgram(int)
,
GL20.glUseProgram(int)
void glUniform1fv(int location, int count, float[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 1-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 1.GL20.glUniform1f(int, float)
void glUniform1fv(int location, int count, FloatBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 1-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 1.GL20.glUniform1f(int, float)
void glUniform1i(int location, int x)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.GL20.glUniform1f(int, float)
void glUniform1iv(int location, int count, int[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 1-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 1.GL20.glUniform1f(int, float)
void glUniform1iv(int location, int count, IntBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 1-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 1.GL20.glUniform1f(int, float)
void glUniform2f(int location, float x, float y)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.y
- Specifies the new value to be used for the specified uniform variable.GL20.glUniform1f(int, float)
void glUniform2fv(int location, int count, float[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 2-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 2.GL20.glUniform1f(int, float)
void glUniform2fv(int location, int count, FloatBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 2-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 2.GL20.glUniform1f(int, float)
void glUniform2i(int location, int x, int y)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.y
- Specifies the new value to be used for the specified uniform variable.GL20.glUniform1f(int, float)
void glUniform2iv(int location, int count, int[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 2-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 2.GL20.glUniform1f(int, float)
void glUniform2iv(int location, int count, IntBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 2-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 2.GL20.glUniform1f(int, float)
void glUniform3f(int location, float x, float y, float z)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.y
- Specifies the new value to be used for the specified uniform variable.z
- Specifies the new value to be used for the specified uniform variable.GL20.glUniform1f(int, float)
void glUniform3fv(int location, int count, float[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 3-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 3.GL20.glUniform1f(int, float)
void glUniform3fv(int location, int count, FloatBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 3-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 3.GL20.glUniform1f(int, float)
void glUniform3i(int location, int x, int y, int z)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.y
- Specifies the new value to be used for the specified uniform variable.z
- Specifies the new value to be used for the specified uniform variable.GL20.glUniform1f(int, float)
void glUniform3iv(int location, int count, int[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 3-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 3.GL20.glUniform1f(int, float)
void glUniform3iv(int location, int count, IntBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 3-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 3.GL20.glUniform1f(int, float)
void glUniform4f(int location, float x, float y, float z, float w)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.y
- Specifies the new value to be used for the specified uniform variable.z
- Specifies the new value to be used for the specified uniform variable.w
- Specifies the new value to be used for the specified uniform variable.GL20.glUniform1f(int, float)
void glUniform4fv(int location, int count, float[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 4-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 4.GL20.glUniform1f(int, float)
void glUniform4fv(int location, int count, FloatBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 4-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 4.GL20.glUniform1f(int, float)
void glUniform4i(int location, int x, int y, int z, int w)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform variable to be modified.x
- Specifies the new value to be used for the specified uniform variable.y
- Specifies the new value to be used for the specified uniform variable.z
- Specifies the new value to be used for the specified uniform variable.w
- Specifies the new value to be used for the specified uniform variable.GL20.glUniform1f(int, float)
void glUniform4iv(int location, int count, int[] v, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 4-element arrays that are to be modified.v
- Specifies an array of count
values that will be used to update the specified uniform variable.offset
- The starting offset within the v
array.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If v.length - offset
is smaller than 4.GL20.glUniform1f(int, float)
void glUniform4iv(int location, int count, IntBuffer v)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of sets of 4-element arrays that are to be modified.v
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If v
is null
.
IllegalArgumentException
- If v.remaining()
is smaller than 4.GL20.glUniform1f(int, float)
void glUniformMatrix2fv(int location, int count, boolean transpose, float[] value, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_VALUE
is generated if transpose
is not GL_FALSE
.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modifiedcount
- Specifies the number of matrices that are to be modified.transpose
- Specifies whether to transpose the matrix as the values are
loaded into the uniform variable. Must be GL_FALSE
.value
- Specifies an array of count
values that will be used to update
the specified uniform variable.offset
- The starting offset within the value
array.
IllegalArgumentException
- If value
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If value.length - offset
is smaller than 4.GL20.glUniform1f(int, float)
void glUniformMatrix2fv(int location, int count, boolean transpose, FloatBuffer value)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_VALUE
is generated if transpose
is not GL_FALSE
.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of matrices that are to be modified.transpose
- Specifies whether to transpose the matrix as the values are
loaded into the uniform variable. Must be GL_FALSE
.value
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If value
is null
.
IllegalArgumentException
- If value.remaining()
is smaller than 4.GL20.glUniform1f(int, float)
void glUniformMatrix3fv(int location, int count, boolean transpose, float[] value, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_VALUE
is generated if transpose
is not GL_FALSE
.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modifiedcount
- Specifies the number of matrices that are to be modified.transpose
- Specifies whether to transpose the matrix as the values are
loaded into the uniform variable. Must be GL_FALSE
.value
- Specifies an array of count
values that will be used to update
the specified uniform variable.offset
- The starting offset within the value
array.
IllegalArgumentException
- If value
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If value.length - offset
is smaller than 9.GL20.glUniform1f(int, float)
void glUniformMatrix3fv(int location, int count, boolean transpose, FloatBuffer value)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_VALUE
is generated if transpose
is not GL_FALSE
.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of matrices that are to be modified.transpose
- Specifies whether to transpose the matrix as the values are
loaded into the uniform variable. Must be GL_FALSE
.value
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If value
is null
.
IllegalArgumentException
- If value.remaining()
is smaller than 9.GL20.glUniform1f(int, float)
void glUniformMatrix4fv(int location, int count, boolean transpose, float[] value, int offset)
glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_VALUE
is generated if transpose
is not GL_FALSE
.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modifiedcount
- Specifies the number of matrices that are to be modified.transpose
- Specifies whether to transpose the matrix as the values are
loaded into the uniform variable. Must be GL_FALSE
.value
- Specifies an array of count
values that will be used to update
the specified uniform variable.offset
- The starting offset within the value
array.
IllegalArgumentException
- If value
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If value.length - offset
is smaller than 16.GL20.glUniform1f(int, float)
void glUniformMatrix4fv(int location, int count, boolean transpose, FloatBuffer value)
Buffer
version of glUniform1f
.
See glUniform1f
for documentation.
GL_INVALID_OPERATION
is generated if there is no current program object.
GL_INVALID_OPERATION
is generated if the size of the uniform variable
declared in the shader does not match the size indicated by the glUniform
command.
GL_INVALID_OPERATION
is generated if one of the integer variants of this
function is used to load a uniform variable of type float, vec2, vec3, vec4, or
an array of these, or if one of the floating-point variants of this function is
used to load a uniform variable of type int, ivec2, ivec3, or ivec4, or an array of these.
GL_INVALID_OPERATION
is generated if location
is an invalid uniform location
for the current program object and location
is not equal to -1.
GL_INVALID_VALUE
is generated if count
is less than 0.
GL_INVALID_VALUE
is generated if transpose
is not GL_FALSE
.
GL_INVALID_OPERATION
is generated if count
is greater than 1
and the indicated uniform variable is not an array variable.
GL_INVALID_OPERATION
is generated if a sampler is loaded using
a command other than glUniform1i
and glUniform1iv
.
location
- Specifies the location of the uniform value to be modified.count
- Specifies the number of matrices that are to be modified.transpose
- Specifies whether to transpose the matrix as the values are
loaded into the uniform variable. Must be GL_FALSE
.value
- Specifies a buffer that will be used to update the specified uniform variable.
IllegalArgumentException
- If value
is null
.
IllegalArgumentException
- If value.remaining()
is smaller than 16.GL20.glUniform1f(int, float)
void glUseProgram(int program)
glUseProgram
installs the program object specified by
program
as part of current rendering state. One or more
executables are created in a program object by successfully
attaching shader objects to it with glAttachShader
,
successfully compiling the shader objects with glCompileShader
,
and successfully linking the program object with glLinkProgram
.
A program object will contain executables that will run on the
vertex and fragment processors if it contains one or more
shader objects of type GL_VERTEX_SHADER
and one or more
shader objects of type GL_FRAGMENT_SHADER
that have all been
successfully compiled and linked.
While a program object is in use, applications are free to modify
attached shader objects, compile attached shader objects,
attach additional shader objects, and detach or delete shader objects.
None of these operations will affect the executables that are
part of the current state. However, relinking the program object
that is currently in use will install the program object as part
of the current rendering state if the link operation was successful
(see glLinkProgram
). If the program object currently in use is
relinked unsuccessfully, its link status will be set to GL_FALSE
,
but the executables and associated state will remain part of the
current state until a subsequent call to glUseProgram
removes
it from use. After it is removed from use, it cannot be made part
of current state until it has been successfully relinked.
If program
is 0, then the current rendering state refers to an
invalid program object, and the results of vertex and fragment shader
execution due to any glDrawArrays
or glDrawElements
/
glDrawElements
commands are undefined.
Like texture objects and buffer objects, the name space for program objects may be shared across a set of contexts, as long as the server sides of the contexts share the same address space. If the name space is shared across contexts, any attached objects and the data associated with those attached objects are shared as well.
Applications are responsible for providing the synchronization across API calls when objects are accessed from different execution threads.
GL_INVALID_VALUE
is generated if program
is neither 0 nor a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
GL_INVALID_OPERATION
is generated if program
could not be made part of current state.
glGetIntegerv
/glGetIntegerv
with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
with a valid program object and the index of an active attribute variable
glGetActiveUniform
with a valid program object and the index of an active uniform variable
glGetAttachedShaders
/
glGetAttachedShaders
with a valid program object
glGetAttribLocation
with a valid program object and the name of an attribute variable
glGetProgramiv
/glGetProgramiv
with a valid program object and the parameter to be queried
glGetProgramInfoLog
with a valid program object
glGetUniformfv
/
glGetUniformfv
/
glGetUniformiv
/
glGetUniformiv
with a valid program object and the location of a uniform variable
glGetUniformLocation
with a valid program object and the name of a uniform variable
program
- Specifies the handle of the program object whose
executables are to be used as part of current rendering state.GL20.glAttachShader(int, int)
,
GL20.glBindAttribLocation(int, int, String)
,
GL20.glCompileShader(int)
,
GL20.glCreateProgram()
,
GL20.glDeleteProgram(int)
,
GL20.glDetachShader(int, int)
,
GL20.glLinkProgram(int)
,
GL20.glUniform1f(int, float)
,
GL20.glUniform1fv(int, int, FloatBuffer)
,
GL20.glUniform1fv(int, int, float[], int)
,
GL20.glUniform1i(int, int)
,
GL20.glUniform1iv(int, int, IntBuffer)
,
GL20.glUniform1iv(int, int, int[], int)
,
GL20.glUniform2f(int, float, float)
,
GL20.glUniform2fv(int, int, FloatBuffer)
,
GL20.glUniform2fv(int, int, float[], int)
,
GL20.glUniform2i(int, int, int)
,
GL20.glUniform2iv(int, int, IntBuffer)
,
GL20.glUniform2iv(int, int, int[], int)
,
GL20.glUniform3f(int, float, float, float)
,
GL20.glUniform3fv(int, int, FloatBuffer)
,
GL20.glUniform3fv(int, int, float[], int)
,
GL20.glUniform3i(int, int, int, int)
,
GL20.glUniform3iv(int, int, IntBuffer)
,
GL20.glUniform3iv(int, int, int[], int)
,
GL20.glUniform4f(int, float, float, float, float)
,
GL20.glUniform4fv(int, int, FloatBuffer)
,
GL20.glUniform4fv(int, int, float[], int)
,
GL20.glUniform4i(int, int, int, int, int)
,
GL20.glUniform4iv(int, int, IntBuffer)
,
GL20.glUniform4iv(int, int, int[], int)
,
GL20.glUniformMatrix2fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix2fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix3fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix3fv(int, int, boolean, float[], int)
,
GL20.glUniformMatrix4fv(int, int, boolean, FloatBuffer)
,
GL20.glUniformMatrix4fv(int, int, boolean, float[], int)
,
GL20.glValidateProgram(int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
void glValidateProgram(int program)
glValidateProgram
checks to see whether the executables
contained in program
can execute given the current OpenGL state.
The information generated by the validation process will be stored
in program
's information log. The validation information may consist
of an empty string, or it may be a string containing information
about how the current program object interacts with the rest of current
OpenGL state. This provides a way for OpenGL implementers to convey more
information about why the current program is inefficient, suboptimal,
failing to execute, and so on.
The status of the validation operation will be stored as part of the
program object's state. This value will be set to GL_TRUE
if the
validation succeeded, and GL_FALSE
otherwise. It can be queried
by calling glGetProgramiv
/
glGetProgramiv
with arguments
program
and GL_VALIDATE_STATUS
.
If validation is successful, program
is guaranteed to execute
given the current state. Otherwise, program
is guaranteed to not execute.
This function is typically useful only during application development. The informational string stored in the information log is completely implementation dependent; therefore, an application should not expect different OpenGL implementations to produce identical information strings.
This function mimics the validation operation that OpenGL implementations
must perform when rendering commands are issued while programmable shaders
are part of current state. The error GL_INVALID_OPERATION
will be generated
by glDrawArrays
or
glDrawElements
/
glDrawElements
if:
any two active samplers in the current program object are of different types, but refer to the same texture image unit,
any active sampler in the current program object refers to a texture image unit where fixed-function fragment processing accesses a texture target that does not match the sampler type, or
the sum of the number of active samplers in the program and the number of texture image units enabled for fixed-function fragment processing exceeds the combined limit on the total number of texture image units allowed.
It may be difficult or cause a performance degradation for applications to
catch these errors when rendering commands are issued.
Therefore, applications are advised to make calls to glValidateProgram
to detect these issues during application development.
GL_INVALID_VALUE
is generated if program
is not a value generated by OpenGL.
GL_INVALID_OPERATION
is generated if program
is not a program object.
glGetProgramiv
/glGetProgramiv
with arguments program
and GL_VALIDATE_STATUS
glGetProgramInfoLog
with argument program
program
- Specifies the handle of the program object to be validated.GL20.glLinkProgram(int)
,
GL20.glUseProgram(int)
void glVertexAttrib1f(int index, float x)
glVertexAttrib
family of entry points allows an application
to pass generic vertex attributes in numbered locations.
Generic attributes are defined as four-component values that are
organized into an array. The first entry of this array is
numbered 0, and the size of the array is specified by the
implementation-dependent symbolic constant GL_MAX_VERTEX_ATTRIBS
.
Individual elements of this array can be modified with
a glVertexAttrib
call that specifies the index of the
element to be modified and a value for that element.
These commands can be used to specify one, two, three,
or all four components of the generic vertex attribute
specified by index
. A 1
in the name of the command indicates
that only one value is passed, and it will be used to modify
the first component of the generic vertex attribute.
The second and third components will be set to 0, and
the fourth component will be set to 1. Similarly, a 2
in the name of the command indicates that values are
provided for the first two components, the third component
will be set to 0, and the fourth component will be set to 1.
A 3
in the name of the command indicates that values are
provided for the first three components and the fourth
component will be set to 1, whereas a 4
in the name
indicates that values are provided for all four components.
The letter f
indicates that the arguments are of type float.
When v
is appended to the name, the commands can take an array of floats.
OpenGL ES Shading Language attribute variables are allowed
to be of type mat2, mat3, or mat4. Attributes of these types
may be loaded using the glVertexAttrib
entry points.
Matrices must be loaded into successive generic attribute
slots in column major order, with one column of the matrix
in each generic attribute slot.
A user-defined attribute variable declared in a vertex shader
can be bound to a generic attribute index by
calling glBindAttribLocation
. This allows an application to
use descriptive variable names in a vertex shader.
A subsequent change to the specified generic vertex attribute
will be immediately reflected as a change to the corresponding
attribute variable in the vertex shader.
The binding between a generic vertex attribute index and a user-defined attribute variable in a vertex shader is part of the state of a program object, but the current value of the generic vertex attribute is not. The value of each generic vertex attribute is part of current state and it is maintained even if a different program object is used.
An application may freely modify generic vertex attributes that are not bound to a named vertex shader attribute variable. These values are simply maintained as part of current state and will not be accessed by the vertex shader. If a generic vertex attribute bound to an attribute variable in a vertex shader is not updated while the vertex shader is executing, the vertex shader will repeatedly use the current value for the generic vertex attribute.
It is possible for an application to bind more than one attribute name to the same generic vertex attribute index. This is referred to as aliasing, and it is allowed only if just one of the aliased attribute variables is active in the vertex shader, or if no path through the vertex shader consumes more than one of the attributes aliased to the same location. OpenGL implementations are not required to do error checking to detect aliasing, they are allowed to assume that aliasing will not occur, and they are allowed to employ optimizations that work only in the absence of aliasing.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
glGetIntegerv
/glGetIntegerv
with the argument GL_CURRENT_PROGRAM
glGetActiveAttrib
with argument program
and the index of an active attribute variable
glGetAttribLocation
with argument program
and an attribute variable name
glGetVertexAttribfv
/
glGetVertexAttribfv
/
glGetVertexAttribiv
/
glGetVertexAttribiv
with arguments GL_CURRENT_VERTEX_ATTRIB
and index
index
- Specifies the index of the generic vertex attribute to be modified.x
- Specifies the new value to be used for the specified vertex attribute.GL20.glBindAttribLocation(int, int, String)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
,
GL20.glVertexAttribPointer(int, int, int, boolean, int, int)
void glVertexAttrib1fv(int index, float[] values, int offset)
glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.offset
- The starting offset within the values
array.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If values.length - offset
is smaller than 1.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib1fv(int index, FloatBuffer values)
Buffer
version of glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If values.remaining()
is smaller than 1.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib2f(int index, float x, float y)
glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.x
- Specifies the new value to be used for the specified vertex attribute.y
- Specifies the new value to be used for the specified vertex attribute.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib2fv(int index, float[] values, int offset)
glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.offset
- The starting offset within the values
array.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If values.length - offset
is smaller than 2.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib2fv(int index, FloatBuffer values)
Buffer
version of glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If values.remaining()
is smaller than 2.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib3f(int index, float x, float y, float z)
glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.x
- Specifies the new value to be used for the specified vertex attribute.y
- Specifies the new value to be used for the specified vertex attribute.z
- Specifies the new value to be used for the specified vertex attribute.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib3fv(int index, float[] values, int offset)
glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.offset
- The starting offset within the values
array.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If values.length - offset
is smaller than 3.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib3fv(int index, FloatBuffer values)
Buffer
version of glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If values.remaining()
is smaller than 3.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib4f(int index, float x, float y, float z, float w)
glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.x
- Specifies the new value to be used for the specified vertex attribute.y
- Specifies the new value to be used for the specified vertex attribute.z
- Specifies the new value to be used for the specified vertex attribute.w
- Specifies the new value to be used for the specified vertex attribute.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib4fv(int index, float[] values, int offset)
glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.offset
- The starting offset within the values
array.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If offset
is less than 0.
IllegalArgumentException
- If values.length - offset
is smaller than 4.GL20.glVertexAttrib1f(int, float)
void glVertexAttrib4fv(int index, FloatBuffer values)
Buffer
version of glVertexAttrib1f
.
See glVertexAttrib1f
for documentation.
GL_INVALID_VALUE
is generated if index
is
greater than or equal to GL_MAX_VERTEX_ATTRIBS
.
index
- Specifies the index of the generic vertex attribute to be modified.values
- Specifies an array of values to be used for the generic vertex attribute.
IllegalArgumentException
- If values
is null
.
IllegalArgumentException
- If values.remaining()
is smaller than 4.GL20.glVertexAttrib1f(int, float)
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, Buffer data)
glVertexAttribPointer
specifies the location and data format of the
array of generic vertex attributes at index index
to use when rendering.
size
specifies the number of components per attribute and must
be 1, 2, 3, or 4. type
specifies the data type of each component,
and stride
specifies the byte stride from one attribute to the next,
allowing vertices and attributes to be packed into a single array or
stored in separate arrays. If set to true
, normalized
indicates
that values stored in an integer format are to be mapped to the
range [-1, 1]
(for signed values) or [0, 1]
(for unsigned values)
when they are accessed and converted to floating point. Otherwise,
values will be converted to floats directly without normalization.
When a generic vertex attribute array is specified, size
,
type
, normalized
, stride
, and
data
are saved as client-side
state, in addition to the current vertex array buffer object binding.
To enable and disable a generic vertex attribute array,
call glEnableVertexAttribArray
and
glDisableVertexAttribArray
with index
. If enabled, the generic vertex attribute array is
used when glDrawArrays
or
glDrawElements
/
glDrawElements
is called.
Each generic vertex attribute array is initially disabled and
isn't accessed when glDrawElements
/
glDrawElements
or
glDrawArrays
is called.
glVertexAttribPointer
is typically implemented on the client side.
GL_INVALID_ENUM
is generated if type
is not an accepted value.
GL_INVALID_VALUE
is generated if index
is greater than or
equal to GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_VALUE
is generated if size
is not 1, 2, 3, or 4.
GL_INVALID_VALUE
is generated if stride
is negative.
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VERTEX_ATTRIBS
glGetVertexAttribfv
/
glGetVertexAttribfv
/
glGetVertexAttribiv
/
glGetVertexAttribiv
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_ENABLED
glGetVertexAttribfv
/
glGetVertexAttribfv
/
glGetVertexAttribiv
/
glGetVertexAttribiv
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_SIZE
glGetVertexAttribfv
/
glGetVertexAttribfv
/
glGetVertexAttribiv
/
glGetVertexAttribiv
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_TYPE
glGetVertexAttribfv
/
glGetVertexAttribfv
/
glGetVertexAttribiv
/
glGetVertexAttribiv
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_NORMALIZED
glGetVertexAttribfv
/
glGetVertexAttribfv
/
glGetVertexAttribiv
/
glGetVertexAttribiv
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_STRIDE
glGetVertexAttribfv
/
glGetVertexAttribfv
/
glGetVertexAttribiv
/
glGetVertexAttribiv
with arguments index
and GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
glGetIntegerv
/glGetIntegerv
with argument GL_ARRAY_BUFFER_BINDING
index
- Specifies the index of the generic vertex attribute to be modified.size
- Specifies the number of components per generic vertex attribute.
Must be 1, 2, 3, or 4. The initial value is 4.type
- Specifies the data type of each component in the array.
Symbolic constants GL_BYTE
, GL_UNSIGNED_BYTE
, GL_SHORT
, GL_UNSIGNED_SHORT
,
GL_FIXED
, or GL_FLOAT
are accepted. The initial value is GL_FLOAT
.normalized
- Specifies whether fixed-point data values should be
normalized (GL_TRUE
) or converted directly as fixed-point values (GL_FALSE
)
when they are accessed.stride
- Specifies the byte offset between consecutive generic vertex
attributes. If stride
is 0, the generic vertex attributes are understood
to be tightly packed in the array. The initial value is 0.data
- Specifies the generic vertex attribute data as a buffer.
IllegalArgumentException
- if data
is null
.
IllegalArgumentException
- if data
is not a direct buffer.GL20.glBindAttribLocation(int, int, String)
,
GL20.glBindBuffer(int, int)
,
GL20.glDisableVertexAttribArray(int)
,
GL20.glDrawArrays(int, int, int)
,
GL20.glDrawElements(int, int, int, Buffer)
,
GL20.glDrawElements(int, int, int, int)
,
GL20.glEnableVertexAttribArray(int)
,
GL20.glVertexAttrib1f(int, float)
,
GL20.glVertexAttrib1fv(int, FloatBuffer)
,
GL20.glVertexAttrib1fv(int, float[], int)
,
GL20.glVertexAttrib2f(int, float, float)
,
GL20.glVertexAttrib2fv(int, FloatBuffer)
,
GL20.glVertexAttrib2fv(int, float[], int)
,
GL20.glVertexAttrib3f(int, float, float, float)
,
GL20.glVertexAttrib3fv(int, FloatBuffer)
,
GL20.glVertexAttrib3fv(int, float[], int)
,
GL20.glVertexAttrib4f(int, float, float, float, float)
,
GL20.glVertexAttrib4fv(int, FloatBuffer)
,
GL20.glVertexAttrib4fv(int, float[], int)
void glVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, int offset)
glVertexAttribPointer
.
Note: offset
specifies a byte offset into the currently bound buffer object's data
store where the generic vertex attributes are stored (a non-zero named buffer object must be bound to
the GL_ARRAY_BUFFER
target (see glBindBuffer
)).
Also, the buffer object binding (GL_ARRAY_BUFFER_BINDING
) is saved as generic vertex attribute
array client-side state (GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
)
for index index
.
GL_INVALID_ENUM
is generated if type
is not an accepted value.
GL_INVALID_VALUE
is generated if index
is greater than or
equal to GL_MAX_VERTEX_ATTRIBS
.
GL_INVALID_VALUE
is generated if size
is not 1, 2, 3, or 4.
GL_INVALID_VALUE
is generated if stride
is negative.
index
- Specifies the index of the generic vertex attribute to be modified.size
- Specifies the number of components per generic vertex attribute.
Must be 1, 2, 3, or 4. The initial value is 4.type
- Specifies the data type of each component in the array.
Symbolic constants GL_BYTE
, GL_UNSIGNED_BYTE
, GL_SHORT
, GL_UNSIGNED_SHORT
,
GL_FIXED
, or GL_FLOAT
are accepted. The initial value is GL_FLOAT
.normalized
- Specifies whether fixed-point data values should be
normalized (GL_TRUE
) or converted directly as fixed-point values (GL_FALSE
)
when they are accessed.stride
- Specifies the byte offset between consecutive generic vertex
attributes. If stride
is 0, the generic vertex attributes are understood
to be tightly packed in the array. The initial value is 0.offset
- Specifies the byte offset into the currently bound buffer object's data store.
IllegalStateException
- If VBOs are not enabled.
ArrayIndexOutOfBoundsException
- If
offset
is less than 0 or greater than
or equal to the length of the currently bound buffer.GL20.glVertexAttribPointer(int, int, int, boolean, int, Buffer)
void glViewport(int x, int y, int width, int height)
glViewport
specifies the affine transformation of x and y from normalized device
coordinates to window coordinates. Let (x_nd, y_nd)
be normalized device coordinates.
Then the window coordinates (x_w, y_w)
are computed as follows:
x_w = (x_nd + 1)(width/2) + x
y_w = (y_nd + 1)(height/2) + y
Viewport width and height are silently clamped to a range that
depends on the implementation. To query this range,
call glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VIEWPORT_DIMS
.
GL_INVALID_VALUE
is generated if either width
or height
is negative.
glGetIntegerv
/glGetIntegerv
with argument GL_VIEWPORT
glGetIntegerv
/glGetIntegerv
with argument GL_MAX_VIEWPORT_DIMS
x
- Specifies the x coordinate of the lower left corner of the viewport rectangle, in pixels.
The initial value is 0.y
- Specifies the y coordinate of the lower left corner of the viewport rectangle, in pixels.
The initial value is 0.width
- Specifies the width of the viewport.
When a GL context is first attached to a window, width
is set to the width of that window.height
- Specifies the height of the viewport.
When a GL context is first attached to a window, height
is set to the height of that window.GL20.glDepthRangef(float, float)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal