All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.korlibs.kgl.KmlGl.kt Maven / Gradle / Ivy

There is a newer version: 4.0.10
Show newest version
// WARNING: File autogenerated DO NOT modify
// https://www.khronos.org/registry/OpenGL/api/GLES2/gl2.h
@file:Suppress("unused", "RedundantUnitReturnType", "PropertyName")

package korlibs.kgl

import korlibs.datastructure.*
import korlibs.graphics.*
import korlibs.graphics.shader.gl.*

abstract class KmlGl : Extra by Extra.Mixin(), IKmlGl, AGFeatures {
    @Deprecated("Replace with variant")
    open val gles: Boolean get() = false

    abstract val variant: GLVariant

    open val root: KmlGl get() = this
    open var info: ContextInfo = ContextInfo()

    open class ContextInfo {
        var current: () -> Any? = { null }

        override fun toString(): String = "current=${current()}"
    }

    inline val DEPTH_BUFFER_BIT: Int get() = KmlGl.DEPTH_BUFFER_BIT
    inline val STENCIL_BUFFER_BIT: Int get() = KmlGl.STENCIL_BUFFER_BIT
    inline val COLOR_BUFFER_BIT: Int get() = KmlGl.COLOR_BUFFER_BIT
    inline val GFALSE: Int get() = KmlGl.GFALSE
    inline val GTRUE: Int get() = KmlGl.GTRUE
    inline val POINTS: Int get() = KmlGl.POINTS
    inline val LINES: Int get() = KmlGl.LINES
    inline val LINE_LOOP: Int get() = KmlGl.LINE_LOOP
    inline val LINE_STRIP: Int get() = KmlGl.LINE_STRIP
    inline val TRIANGLES: Int get() = KmlGl.TRIANGLES
    inline val TRIANGLE_STRIP: Int get() = KmlGl.TRIANGLE_STRIP
    inline val TRIANGLE_FAN: Int get() = KmlGl.TRIANGLE_FAN
    inline val ZERO: Int get() = KmlGl.ZERO
    inline val ONE: Int get() = KmlGl.ONE
    inline val SRC_COLOR: Int get() = KmlGl.SRC_COLOR
    inline val ONE_MINUS_SRC_COLOR: Int get() = KmlGl.ONE_MINUS_SRC_COLOR
    inline val SRC_ALPHA: Int get() = KmlGl.SRC_ALPHA
    inline val ONE_MINUS_SRC_ALPHA: Int get() = KmlGl.ONE_MINUS_SRC_ALPHA
    inline val DST_ALPHA: Int get() = KmlGl.DST_ALPHA
    inline val ONE_MINUS_DST_ALPHA: Int get() = KmlGl.ONE_MINUS_DST_ALPHA
    inline val DST_COLOR: Int get() = KmlGl.DST_COLOR
    inline val ONE_MINUS_DST_COLOR: Int get() = KmlGl.ONE_MINUS_DST_COLOR
    inline val SRC_ALPHA_SATURATE: Int get() = KmlGl.SRC_ALPHA_SATURATE
    inline val FUNC_ADD: Int get() = KmlGl.FUNC_ADD
    inline val BLEND_EQUATION: Int get() = KmlGl.BLEND_EQUATION
    inline val BLEND_EQUATION_RGB: Int get() = KmlGl.BLEND_EQUATION_RGB
    inline val BLEND_EQUATION_ALPHA: Int get() = KmlGl.BLEND_EQUATION_ALPHA
    inline val FUNC_SUBTRACT: Int get() = KmlGl.FUNC_SUBTRACT
    inline val FUNC_REVERSE_SUBTRACT: Int get() = KmlGl.FUNC_REVERSE_SUBTRACT
    inline val BLEND_DST_RGB: Int get() = KmlGl.BLEND_DST_RGB
    inline val BLEND_SRC_RGB: Int get() = KmlGl.BLEND_SRC_RGB
    inline val BLEND_DST_ALPHA: Int get() = KmlGl.BLEND_DST_ALPHA
    inline val BLEND_SRC_ALPHA: Int get() = KmlGl.BLEND_SRC_ALPHA
    inline val CONSTANT_COLOR: Int get() = KmlGl.CONSTANT_COLOR
    inline val ONE_MINUS_CONSTANT_COLOR: Int get() = KmlGl.ONE_MINUS_CONSTANT_COLOR
    inline val CONSTANT_ALPHA: Int get() = KmlGl.CONSTANT_ALPHA
    inline val ONE_MINUS_CONSTANT_ALPHA: Int get() = KmlGl.ONE_MINUS_CONSTANT_ALPHA
    inline val BLEND_COLOR: Int get() = KmlGl.BLEND_COLOR
    inline val ARRAY_BUFFER: Int get() = KmlGl.ARRAY_BUFFER
    inline val ELEMENT_ARRAY_BUFFER: Int get() = KmlGl.ELEMENT_ARRAY_BUFFER
    inline val ARRAY_BUFFER_BINDING: Int get() = KmlGl.ARRAY_BUFFER_BINDING
    inline val ELEMENT_ARRAY_BUFFER_BINDING: Int get() = KmlGl.ELEMENT_ARRAY_BUFFER_BINDING
    inline val STREAM_DRAW: Int get() = KmlGl.STREAM_DRAW
    inline val STATIC_DRAW: Int get() = KmlGl.STATIC_DRAW
    inline val DYNAMIC_DRAW: Int get() = KmlGl.DYNAMIC_DRAW
    inline val BUFFER_SIZE: Int get() = KmlGl.BUFFER_SIZE
    inline val BUFFER_USAGE: Int get() = KmlGl.BUFFER_USAGE
    inline val CURRENT_VERTEX_ATTRIB: Int get() = KmlGl.CURRENT_VERTEX_ATTRIB
    inline val FRONT: Int get() = KmlGl.FRONT
    inline val BACK: Int get() = KmlGl.BACK
    inline val FRONT_AND_BACK: Int get() = KmlGl.FRONT_AND_BACK
    inline val TEXTURE_2D: Int get() = KmlGl.TEXTURE_2D
    inline val TEXTURE_3D: Int get() = KmlGl.TEXTURE_3D
    inline val CULL_FACE: Int get() = KmlGl.CULL_FACE
    inline val BLEND: Int get() = KmlGl.BLEND
    inline val DITHER: Int get() = KmlGl.DITHER
    inline val STENCIL_TEST: Int get() = KmlGl.STENCIL_TEST
    inline val DEPTH_TEST: Int get() = KmlGl.DEPTH_TEST
    inline val SCISSOR_TEST: Int get() = KmlGl.SCISSOR_TEST
    inline val POLYGON_OFFSET_FILL: Int get() = KmlGl.POLYGON_OFFSET_FILL
    inline val SAMPLE_ALPHA_TO_COVERAGE: Int get() = KmlGl.SAMPLE_ALPHA_TO_COVERAGE
    inline val SAMPLE_COVERAGE: Int get() = KmlGl.SAMPLE_COVERAGE
    inline val NO_ERROR: Int get() = KmlGl.NO_ERROR
    inline val INVALID_ENUM: Int get() = KmlGl.INVALID_ENUM
    inline val INVALID_VALUE: Int get() = KmlGl.INVALID_VALUE
    inline val INVALID_OPERATION: Int get() = KmlGl.INVALID_OPERATION
    inline val OUT_OF_MEMORY: Int get() = KmlGl.OUT_OF_MEMORY
    inline val CW: Int get() = KmlGl.CW
    inline val CCW: Int get() = KmlGl.CCW
    inline val LINE_WIDTH: Int get() = KmlGl.LINE_WIDTH
    inline val ALIASED_POINT_SIZE_RANGE: Int get() = KmlGl.ALIASED_POINT_SIZE_RANGE
    inline val ALIASED_LINE_WIDTH_RANGE: Int get() = KmlGl.ALIASED_LINE_WIDTH_RANGE
    inline val CULL_FACE_MODE: Int get() = KmlGl.CULL_FACE_MODE
    inline val FRONT_FACE: Int get() = KmlGl.FRONT_FACE
    inline val DEPTH_RANGE: Int get() = KmlGl.DEPTH_RANGE
    inline val DEPTH_WRITEMASK: Int get() = KmlGl.DEPTH_WRITEMASK
    inline val DEPTH_CLEAR_VALUE: Int get() = KmlGl.DEPTH_CLEAR_VALUE
    inline val DEPTH_FUNC: Int get() = KmlGl.DEPTH_FUNC
    inline val STENCIL_CLEAR_VALUE: Int get() = KmlGl.STENCIL_CLEAR_VALUE
    inline val STENCIL_FUNC: Int get() = KmlGl.STENCIL_FUNC
    inline val STENCIL_FAIL: Int get() = KmlGl.STENCIL_FAIL
    inline val STENCIL_PASS_DEPTH_FAIL: Int get() = KmlGl.STENCIL_PASS_DEPTH_FAIL
    inline val STENCIL_PASS_DEPTH_PASS: Int get() = KmlGl.STENCIL_PASS_DEPTH_PASS
    inline val STENCIL_REF: Int get() = KmlGl.STENCIL_REF
    inline val STENCIL_VALUE_MASK: Int get() = KmlGl.STENCIL_VALUE_MASK
    inline val STENCIL_WRITEMASK: Int get() = KmlGl.STENCIL_WRITEMASK
    inline val STENCIL_BACK_FUNC: Int get() = KmlGl.STENCIL_BACK_FUNC
    inline val STENCIL_BACK_FAIL: Int get() = KmlGl.STENCIL_BACK_FAIL
    inline val STENCIL_BACK_PASS_DEPTH_FAIL: Int get() = KmlGl.STENCIL_BACK_PASS_DEPTH_FAIL
    inline val STENCIL_BACK_PASS_DEPTH_PASS: Int get() = KmlGl.STENCIL_BACK_PASS_DEPTH_PASS
    inline val STENCIL_BACK_REF: Int get() = KmlGl.STENCIL_BACK_REF
    inline val STENCIL_BACK_VALUE_MASK: Int get() = KmlGl.STENCIL_BACK_VALUE_MASK
    inline val STENCIL_BACK_WRITEMASK: Int get() = KmlGl.STENCIL_BACK_WRITEMASK
    inline val VIEWPORT: Int get() = KmlGl.VIEWPORT
    inline val SCISSOR_BOX: Int get() = KmlGl.SCISSOR_BOX
    inline val COLOR_CLEAR_VALUE: Int get() = KmlGl.COLOR_CLEAR_VALUE
    inline val COLOR_WRITEMASK: Int get() = KmlGl.COLOR_WRITEMASK
    inline val UNPACK_ALIGNMENT: Int get() = KmlGl.UNPACK_ALIGNMENT
    inline val PACK_ALIGNMENT: Int get() = KmlGl.PACK_ALIGNMENT
    inline val MAX_TEXTURE_SIZE: Int get() = KmlGl.MAX_TEXTURE_SIZE
    inline val MAX_VIEWPORT_DIMS: Int get() = KmlGl.MAX_VIEWPORT_DIMS
    inline val SUBPIXEL_BITS: Int get() = KmlGl.SUBPIXEL_BITS
    inline val RED_BITS: Int get() = KmlGl.RED_BITS
    inline val GREEN_BITS: Int get() = KmlGl.GREEN_BITS
    inline val BLUE_BITS: Int get() = KmlGl.BLUE_BITS
    inline val ALPHA_BITS: Int get() = KmlGl.ALPHA_BITS
    inline val DEPTH_BITS: Int get() = KmlGl.DEPTH_BITS
    inline val STENCIL_BITS: Int get() = KmlGl.STENCIL_BITS
    inline val POLYGON_OFFSET_UNITS: Int get() = KmlGl.POLYGON_OFFSET_UNITS
    inline val POLYGON_OFFSET_FACTOR: Int get() = KmlGl.POLYGON_OFFSET_FACTOR
    inline val TEXTURE_BINDING_2D: Int get() = KmlGl.TEXTURE_BINDING_2D
    inline val SAMPLE_BUFFERS: Int get() = KmlGl.SAMPLE_BUFFERS
    inline val SAMPLES: Int get() = KmlGl.SAMPLES
    inline val SAMPLE_COVERAGE_VALUE: Int get() = KmlGl.SAMPLE_COVERAGE_VALUE
    inline val SAMPLE_COVERAGE_INVERT: Int get() = KmlGl.SAMPLE_COVERAGE_INVERT
    inline val NUM_COMPRESSED_TEXTURE_FORMATS: Int get() = KmlGl.NUM_COMPRESSED_TEXTURE_FORMATS
    inline val COMPRESSED_TEXTURE_FORMATS: Int get() = KmlGl.COMPRESSED_TEXTURE_FORMATS
    inline val DONT_CARE: Int get() = KmlGl.DONT_CARE
    inline val FASTEST: Int get() = KmlGl.FASTEST
    inline val NICEST: Int get() = KmlGl.NICEST
    inline val GENERATE_MIPMAP_HINT: Int get() = KmlGl.GENERATE_MIPMAP_HINT
    inline val BYTE: Int get() = KmlGl.BYTE
    inline val UNSIGNED_BYTE: Int get() = KmlGl.UNSIGNED_BYTE
    inline val SHORT: Int get() = KmlGl.SHORT
    inline val UNSIGNED_SHORT: Int get() = KmlGl.UNSIGNED_SHORT
    inline val INT: Int get() = KmlGl.INT
    inline val UNSIGNED_INT: Int get() = KmlGl.UNSIGNED_INT
    inline val FLOAT: Int get() = KmlGl.FLOAT
    inline val FIXED: Int get() = KmlGl.FIXED
    inline val DEPTH_COMPONENT: Int get() = KmlGl.DEPTH_COMPONENT
    inline val ALPHA: Int get() = KmlGl.ALPHA
    inline val RGB: Int get() = KmlGl.RGB
    inline val RGBA: Int get() = KmlGl.RGBA
    inline val LUMINANCE: Int get() = KmlGl.LUMINANCE
    inline val LUMINANCE_ALPHA: Int get() = KmlGl.LUMINANCE_ALPHA
    inline val UNSIGNED_SHORT_4_4_4_4: Int get() = KmlGl.UNSIGNED_SHORT_4_4_4_4
    inline val UNSIGNED_SHORT_5_5_5_1: Int get() = KmlGl.UNSIGNED_SHORT_5_5_5_1
    inline val UNSIGNED_SHORT_5_6_5: Int get() = KmlGl.UNSIGNED_SHORT_5_6_5
    inline val FRAGMENT_SHADER: Int get() = KmlGl.FRAGMENT_SHADER
    inline val VERTEX_SHADER: Int get() = KmlGl.VERTEX_SHADER
    inline val MAX_VERTEX_ATTRIBS: Int get() = KmlGl.MAX_VERTEX_ATTRIBS
    inline val MAX_VERTEX_UNIFORM_VECTORS: Int get() = KmlGl.MAX_VERTEX_UNIFORM_VECTORS
    inline val MAX_VARYING_VECTORS: Int get() = KmlGl.MAX_VARYING_VECTORS
    inline val MAX_COMBINED_TEXTURE_IMAGE_UNITS: Int get() = KmlGl.MAX_COMBINED_TEXTURE_IMAGE_UNITS
    inline val MAX_VERTEX_TEXTURE_IMAGE_UNITS: Int get() = KmlGl.MAX_VERTEX_TEXTURE_IMAGE_UNITS
    inline val MAX_TEXTURE_IMAGE_UNITS: Int get() = KmlGl.MAX_TEXTURE_IMAGE_UNITS
    inline val MAX_FRAGMENT_UNIFORM_VECTORS: Int get() = KmlGl.MAX_FRAGMENT_UNIFORM_VECTORS
    inline val SHADER_TYPE: Int get() = KmlGl.SHADER_TYPE
    inline val DELETE_STATUS: Int get() = KmlGl.DELETE_STATUS
    inline val LINK_STATUS: Int get() = KmlGl.LINK_STATUS
    inline val VALIDATE_STATUS: Int get() = KmlGl.VALIDATE_STATUS
    inline val ATTACHED_SHADERS: Int get() = KmlGl.ATTACHED_SHADERS
    inline val ACTIVE_UNIFORMS: Int get() = KmlGl.ACTIVE_UNIFORMS
    inline val ACTIVE_UNIFORM_MAX_LENGTH: Int get() = KmlGl.ACTIVE_UNIFORM_MAX_LENGTH
    inline val ACTIVE_ATTRIBUTES: Int get() = KmlGl.ACTIVE_ATTRIBUTES
    inline val ACTIVE_ATTRIBUTE_MAX_LENGTH: Int get() = KmlGl.ACTIVE_ATTRIBUTE_MAX_LENGTH
    inline val SHADING_LANGUAGE_VERSION: Int get() = KmlGl.SHADING_LANGUAGE_VERSION
    inline val CURRENT_PROGRAM: Int get() = KmlGl.CURRENT_PROGRAM
    inline val NEVER: Int get() = KmlGl.NEVER
    inline val LESS: Int get() = KmlGl.LESS
    inline val EQUAL: Int get() = KmlGl.EQUAL
    inline val LEQUAL: Int get() = KmlGl.LEQUAL
    inline val GREATER: Int get() = KmlGl.GREATER
    inline val NOTEQUAL: Int get() = KmlGl.NOTEQUAL
    inline val GEQUAL: Int get() = KmlGl.GEQUAL
    inline val ALWAYS: Int get() = KmlGl.ALWAYS
    inline val KEEP: Int get() = KmlGl.KEEP
    inline val REPLACE: Int get() = KmlGl.REPLACE
    inline val INCR: Int get() = KmlGl.INCR
    inline val DECR: Int get() = KmlGl.DECR
    inline val INVERT: Int get() = KmlGl.INVERT
    inline val INCR_WRAP: Int get() = KmlGl.INCR_WRAP
    inline val DECR_WRAP: Int get() = KmlGl.DECR_WRAP
    inline val VENDOR: Int get() = KmlGl.VENDOR
    inline val RENDERER: Int get() = KmlGl.RENDERER
    inline val VERSION: Int get() = KmlGl.VERSION
    inline val EXTENSIONS: Int get() = KmlGl.EXTENSIONS
    inline val NEAREST: Int get() = KmlGl.NEAREST
    inline val LINEAR: Int get() = KmlGl.LINEAR
    inline val NEAREST_MIPMAP_NEAREST: Int get() = KmlGl.NEAREST_MIPMAP_NEAREST
    inline val LINEAR_MIPMAP_NEAREST: Int get() = KmlGl.LINEAR_MIPMAP_NEAREST
    inline val NEAREST_MIPMAP_LINEAR: Int get() = KmlGl.NEAREST_MIPMAP_LINEAR
    inline val LINEAR_MIPMAP_LINEAR: Int get() = KmlGl.LINEAR_MIPMAP_LINEAR
    inline val TEXTURE_MAG_FILTER: Int get() = KmlGl.TEXTURE_MAG_FILTER
    inline val TEXTURE_MIN_FILTER: Int get() = KmlGl.TEXTURE_MIN_FILTER
    inline val TEXTURE_WRAP_S: Int get() = KmlGl.TEXTURE_WRAP_S
    inline val TEXTURE_WRAP_T: Int get() = KmlGl.TEXTURE_WRAP_T
    inline val TEXTURE_WRAP_R: Int get() = KmlGl.TEXTURE_WRAP_R
    inline val TEXTURE: Int get() = KmlGl.TEXTURE
    inline val TEXTURE_CUBE_MAP: Int get() = KmlGl.TEXTURE_CUBE_MAP
    inline val TEXTURE_BINDING_CUBE_MAP: Int get() = KmlGl.TEXTURE_BINDING_CUBE_MAP
    inline val TEXTURE_CUBE_MAP_POSITIVE_X: Int get() = KmlGl.TEXTURE_CUBE_MAP_POSITIVE_X
    inline val TEXTURE_CUBE_MAP_NEGATIVE_X: Int get() = KmlGl.TEXTURE_CUBE_MAP_NEGATIVE_X
    inline val TEXTURE_CUBE_MAP_POSITIVE_Y: Int get() = KmlGl.TEXTURE_CUBE_MAP_POSITIVE_Y
    inline val TEXTURE_CUBE_MAP_NEGATIVE_Y: Int get() = KmlGl.TEXTURE_CUBE_MAP_NEGATIVE_Y
    inline val TEXTURE_CUBE_MAP_POSITIVE_Z: Int get() = KmlGl.TEXTURE_CUBE_MAP_POSITIVE_Z
    inline val TEXTURE_CUBE_MAP_NEGATIVE_Z: Int get() = KmlGl.TEXTURE_CUBE_MAP_NEGATIVE_Z
    inline val MAX_CUBE_MAP_TEXTURE_SIZE: Int get() = KmlGl.MAX_CUBE_MAP_TEXTURE_SIZE
    inline val TEXTURE0: Int get() = KmlGl.TEXTURE0
    inline val TEXTURE1: Int get() = KmlGl.TEXTURE1
    inline val TEXTURE2: Int get() = KmlGl.TEXTURE2
    inline val TEXTURE3: Int get() = KmlGl.TEXTURE3
    inline val TEXTURE4: Int get() = KmlGl.TEXTURE4
    inline val TEXTURE5: Int get() = KmlGl.TEXTURE5
    inline val TEXTURE6: Int get() = KmlGl.TEXTURE6
    inline val TEXTURE7: Int get() = KmlGl.TEXTURE7
    inline val TEXTURE8: Int get() = KmlGl.TEXTURE8
    inline val TEXTURE9: Int get() = KmlGl.TEXTURE9
    inline val TEXTURE10: Int get() = KmlGl.TEXTURE10
    inline val TEXTURE11: Int get() = KmlGl.TEXTURE11
    inline val TEXTURE12: Int get() = KmlGl.TEXTURE12
    inline val TEXTURE13: Int get() = KmlGl.TEXTURE13
    inline val TEXTURE14: Int get() = KmlGl.TEXTURE14
    inline val TEXTURE15: Int get() = KmlGl.TEXTURE15
    inline val TEXTURE16: Int get() = KmlGl.TEXTURE16
    inline val TEXTURE17: Int get() = KmlGl.TEXTURE17
    inline val TEXTURE18: Int get() = KmlGl.TEXTURE18
    inline val TEXTURE19: Int get() = KmlGl.TEXTURE19
    inline val TEXTURE20: Int get() = KmlGl.TEXTURE20
    inline val TEXTURE21: Int get() = KmlGl.TEXTURE21
    inline val TEXTURE22: Int get() = KmlGl.TEXTURE22
    inline val TEXTURE23: Int get() = KmlGl.TEXTURE23
    inline val TEXTURE24: Int get() = KmlGl.TEXTURE24
    inline val TEXTURE25: Int get() = KmlGl.TEXTURE25
    inline val TEXTURE26: Int get() = KmlGl.TEXTURE26
    inline val TEXTURE27: Int get() = KmlGl.TEXTURE27
    inline val TEXTURE28: Int get() = KmlGl.TEXTURE28
    inline val TEXTURE29: Int get() = KmlGl.TEXTURE29
    inline val TEXTURE30: Int get() = KmlGl.TEXTURE30
    inline val TEXTURE31: Int get() = KmlGl.TEXTURE31
    inline val ACTIVE_TEXTURE: Int get() = KmlGl.ACTIVE_TEXTURE
    inline val REPEAT: Int get() = KmlGl.REPEAT
    inline val CLAMP_TO_EDGE: Int get() = KmlGl.CLAMP_TO_EDGE
    inline val MIRRORED_REPEAT: Int get() = KmlGl.MIRRORED_REPEAT
    inline val FLOAT_VEC2: Int get() = KmlGl.FLOAT_VEC2
    inline val FLOAT_VEC3: Int get() = KmlGl.FLOAT_VEC3
    inline val FLOAT_VEC4: Int get() = KmlGl.FLOAT_VEC4
    inline val INT_VEC2: Int get() = KmlGl.INT_VEC2
    inline val INT_VEC3: Int get() = KmlGl.INT_VEC3
    inline val INT_VEC4: Int get() = KmlGl.INT_VEC4
    inline val BOOL: Int get() = KmlGl.BOOL
    inline val BOOL_VEC2: Int get() = KmlGl.BOOL_VEC2
    inline val BOOL_VEC3: Int get() = KmlGl.BOOL_VEC3
    inline val BOOL_VEC4: Int get() = KmlGl.BOOL_VEC4
    inline val FLOAT_MAT2: Int get() = KmlGl.FLOAT_MAT2
    inline val FLOAT_MAT3: Int get() = KmlGl.FLOAT_MAT3
    inline val FLOAT_MAT4: Int get() = KmlGl.FLOAT_MAT4
    inline val SAMPLER_2D: Int get() = KmlGl.SAMPLER_2D
    inline val SAMPLER_CUBE: Int get() = KmlGl.SAMPLER_CUBE
    inline val VERTEX_ATTRIB_ARRAY_ENABLED: Int get() = KmlGl.VERTEX_ATTRIB_ARRAY_ENABLED
    inline val VERTEX_ATTRIB_ARRAY_SIZE: Int get() = KmlGl.VERTEX_ATTRIB_ARRAY_SIZE
    inline val VERTEX_ATTRIB_ARRAY_STRIDE: Int get() = KmlGl.VERTEX_ATTRIB_ARRAY_STRIDE
    inline val VERTEX_ATTRIB_ARRAY_TYPE: Int get() = KmlGl.VERTEX_ATTRIB_ARRAY_TYPE
    inline val VERTEX_ATTRIB_ARRAY_NORMALIZED: Int get() = KmlGl.VERTEX_ATTRIB_ARRAY_NORMALIZED
    inline val VERTEX_ATTRIB_ARRAY_POINTER: Int get() = KmlGl.VERTEX_ATTRIB_ARRAY_POINTER
    inline val VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: Int get() = KmlGl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
    inline val IMPLEMENTATION_COLOR_READ_TYPE: Int get() = KmlGl.IMPLEMENTATION_COLOR_READ_TYPE
    inline val IMPLEMENTATION_COLOR_READ_FORMAT: Int get() = KmlGl.IMPLEMENTATION_COLOR_READ_FORMAT
    inline val COMPILE_STATUS: Int get() = KmlGl.COMPILE_STATUS
    inline val INFO_LOG_LENGTH: Int get() = KmlGl.INFO_LOG_LENGTH
    inline val SHADER_SOURCE_LENGTH: Int get() = KmlGl.SHADER_SOURCE_LENGTH
    inline val SHADER_COMPILER: Int get() = KmlGl.SHADER_COMPILER
    inline val SHADER_BINARY_FORMATS: Int get() = KmlGl.SHADER_BINARY_FORMATS
    inline val NUM_SHADER_BINARY_FORMATS: Int get() = KmlGl.NUM_SHADER_BINARY_FORMATS
    inline val LOW_FLOAT: Int get() = KmlGl.LOW_FLOAT
    inline val MEDIUM_FLOAT: Int get() = KmlGl.MEDIUM_FLOAT
    inline val HIGH_FLOAT: Int get() = KmlGl.HIGH_FLOAT
    inline val LOW_INT: Int get() = KmlGl.LOW_INT
    inline val MEDIUM_INT: Int get() = KmlGl.MEDIUM_INT
    inline val HIGH_INT: Int get() = KmlGl.HIGH_INT
    inline val FRAMEBUFFER: Int get() = KmlGl.FRAMEBUFFER
    inline val RENDERBUFFER: Int get() = KmlGl.RENDERBUFFER
    inline val RGBA4: Int get() = KmlGl.RGBA4
    inline val RGB5_A1: Int get() = KmlGl.RGB5_A1
    inline val RGB565: Int get() = KmlGl.RGB565
    inline val DEPTH_COMPONENT16: Int get() = KmlGl.DEPTH_COMPONENT16
    inline val STENCIL_INDEX: Int get() = KmlGl.STENCIL_INDEX
    inline val STENCIL_INDEX8: Int get() = KmlGl.STENCIL_INDEX8
    inline val RENDERBUFFER_WIDTH: Int get() = KmlGl.RENDERBUFFER_WIDTH
    inline val RENDERBUFFER_HEIGHT: Int get() = KmlGl.RENDERBUFFER_HEIGHT
    inline val RENDERBUFFER_INTERNAL_FORMAT: Int get() = KmlGl.RENDERBUFFER_INTERNAL_FORMAT
    inline val RENDERBUFFER_RED_SIZE: Int get() = KmlGl.RENDERBUFFER_RED_SIZE
    inline val RENDERBUFFER_GREEN_SIZE: Int get() = KmlGl.RENDERBUFFER_GREEN_SIZE
    inline val RENDERBUFFER_BLUE_SIZE: Int get() = KmlGl.RENDERBUFFER_BLUE_SIZE
    inline val RENDERBUFFER_ALPHA_SIZE: Int get() = KmlGl.RENDERBUFFER_ALPHA_SIZE
    inline val RENDERBUFFER_DEPTH_SIZE: Int get() = KmlGl.RENDERBUFFER_DEPTH_SIZE
    inline val RENDERBUFFER_STENCIL_SIZE: Int get() = KmlGl.RENDERBUFFER_STENCIL_SIZE
    inline val FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: Int get() = KmlGl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
    inline val FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: Int get() = KmlGl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
    inline val FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: Int get() = KmlGl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
    inline val FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: Int get() = KmlGl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
    inline val COLOR_ATTACHMENT0: Int get() = KmlGl.COLOR_ATTACHMENT0
    inline val DEPTH_ATTACHMENT: Int get() = KmlGl.DEPTH_ATTACHMENT
    inline val DEPTH_STENCIL_ATTACHMENT get() = KmlGl.DEPTH_STENCIL_ATTACHMENT
    inline val DEPTH_STENCIL         get() = KmlGl.DEPTH_STENCIL
    inline val STENCIL_ATTACHMENT: Int get() = KmlGl.STENCIL_ATTACHMENT
    inline val NONE: Int get() = KmlGl.NONE
    inline val FRAMEBUFFER_COMPLETE: Int get() = KmlGl.FRAMEBUFFER_COMPLETE
    inline val FRAMEBUFFER_INCOMPLETE_ATTACHMENT: Int get() = KmlGl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT
    inline val FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: Int get() = KmlGl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
    inline val FRAMEBUFFER_INCOMPLETE_DIMENSIONS: Int get() = KmlGl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS
    inline val FRAMEBUFFER_UNSUPPORTED: Int get() = KmlGl.FRAMEBUFFER_UNSUPPORTED
    inline val FRAMEBUFFER_BINDING: Int get() = KmlGl.FRAMEBUFFER_BINDING
    inline val RENDERBUFFER_BINDING: Int get() = KmlGl.RENDERBUFFER_BINDING
    inline val MAX_RENDERBUFFER_SIZE: Int get() = KmlGl.MAX_RENDERBUFFER_SIZE
    inline val INVALID_FRAMEBUFFER_OPERATION: Int get() = KmlGl.INVALID_FRAMEBUFFER_OPERATION
    inline val TEXTURE_2D_MULTISAMPLE: Int get() = KmlGl.TEXTURE_2D_MULTISAMPLE

    companion object {
        fun errorString(error: Int): String {
            return when (error) {
                NO_ERROR -> "NO_ERROR"
                INVALID_ENUM -> "INVALID_ENUM"
                INVALID_VALUE -> "INVALID_VALUE"
                INVALID_OPERATION -> "INVALID_OPERATION"
                OUT_OF_MEMORY -> "OUT_OF_MEMORY"
                INVALID_FRAMEBUFFER_OPERATION -> "INVALID_FRAMEBUFFER_OPERATION"
                else -> "ERROR($error)"
            }
        }

        const val TEXTURE_BASE_LEVEL = 0x813C
        const val TEXTURE_MAX_LEVEL = 0x813D

        const val DEPTH_BUFFER_BIT: Int = 0x0100
        const val STENCIL_BUFFER_BIT: Int = 0x0400
        const val COLOR_BUFFER_BIT: Int = 0x4000
        const val GFALSE: Int = 0x0000
        const val GTRUE: Int = 0x0001
        const val POINTS: Int = 0x0000
        const val LINES: Int = 0x0001
        const val LINE_LOOP: Int = 0x0002
        const val LINE_STRIP: Int = 0x0003
        const val TRIANGLES: Int = 0x0004
        const val TRIANGLE_STRIP: Int = 0x0005
        const val TRIANGLE_FAN: Int = 0x0006
        const val ZERO: Int = 0x0000
        const val ONE: Int = 0x0001
        const val SRC_COLOR: Int = 0x0300
        const val ONE_MINUS_SRC_COLOR: Int = 0x0301
        const val SRC_ALPHA: Int = 0x0302
        const val ONE_MINUS_SRC_ALPHA: Int = 0x0303
        const val DST_ALPHA: Int = 0x0304
        const val ONE_MINUS_DST_ALPHA: Int = 0x0305
        const val DST_COLOR: Int = 0x0306
        const val ONE_MINUS_DST_COLOR: Int = 0x0307
        const val SRC_ALPHA_SATURATE: Int = 0x0308
        const val FUNC_ADD: Int = 0x8006
        const val BLEND_EQUATION: Int = 0x8009
        const val BLEND_EQUATION_RGB: Int = 0x8009
        const val BLEND_EQUATION_ALPHA: Int = 0x883D
        const val FUNC_SUBTRACT: Int = 0x800A
        const val FUNC_REVERSE_SUBTRACT: Int = 0x800B
        const val BLEND_DST_RGB: Int = 0x80C8
        const val BLEND_SRC_RGB: Int = 0x80C9
        const val BLEND_DST_ALPHA: Int = 0x80CA
        const val BLEND_SRC_ALPHA: Int = 0x80CB
        const val CONSTANT_COLOR: Int = 0x8001
        const val ONE_MINUS_CONSTANT_COLOR: Int = 0x8002
        const val CONSTANT_ALPHA: Int = 0x8003
        const val ONE_MINUS_CONSTANT_ALPHA: Int = 0x8004
        const val BLEND_COLOR: Int = 0x8005
        const val ARRAY_BUFFER: Int = 0x8892
        const val ELEMENT_ARRAY_BUFFER: Int = 0x8893
        const val ARRAY_BUFFER_BINDING: Int = 0x8894
        const val ELEMENT_ARRAY_BUFFER_BINDING: Int = 0x8895
        const val STREAM_DRAW: Int = 0x88E0
        const val STATIC_DRAW: Int = 0x88E4
        const val DYNAMIC_DRAW: Int = 0x88E8
        const val BUFFER_SIZE: Int = 0x8764
        const val BUFFER_USAGE: Int = 0x8765
        const val CURRENT_VERTEX_ATTRIB: Int = 0x8626
        const val FRONT: Int = 0x0404
        const val BACK: Int = 0x0405
        const val FRONT_AND_BACK: Int = 0x0408
        const val TEXTURE_2D: Int = 0x0DE1
        const val TEXTURE_3D: Int = 0x806F
        const val CULL_FACE: Int = 0x0B44
        const val BLEND: Int = 0x0BE2
        const val DITHER: Int = 0x0BD0
        const val STENCIL_TEST: Int = 0x0B90
        const val DEPTH_TEST: Int = 0x0B71
        const val SCISSOR_TEST: Int = 0x0C11
        const val POLYGON_OFFSET_FILL: Int = 0x8037
        const val SAMPLE_ALPHA_TO_COVERAGE: Int = 0x809E
        const val SAMPLE_COVERAGE: Int = 0x80A0
        const val NO_ERROR: Int = 0x0000 // 0
        const val INVALID_ENUM: Int = 0x0500 // 1280
        const val INVALID_VALUE: Int = 0x0501 // 1281
        const val INVALID_OPERATION: Int = 0x0502 // 1282
        const val OUT_OF_MEMORY: Int = 0x0505 // 1283
        const val CW: Int = 0x0900
        const val CCW: Int = 0x0901
        const val LINE_WIDTH: Int = 0x0B21
        const val ALIASED_POINT_SIZE_RANGE: Int = 0x846D
        const val ALIASED_LINE_WIDTH_RANGE: Int = 0x846E
        const val CULL_FACE_MODE: Int = 0x0B45
        const val FRONT_FACE: Int = 0x0B46
        const val DEPTH_RANGE: Int = 0x0B70
        const val DEPTH_WRITEMASK: Int = 0x0B72
        const val DEPTH_CLEAR_VALUE: Int = 0x0B73
        const val DEPTH_FUNC: Int = 0x0B74
        const val STENCIL_CLEAR_VALUE: Int = 0x0B91
        const val STENCIL_FUNC: Int = 0x0B92
        const val STENCIL_FAIL: Int = 0x0B94
        const val STENCIL_PASS_DEPTH_FAIL: Int = 0x0B95
        const val STENCIL_PASS_DEPTH_PASS: Int = 0x0B96
        const val STENCIL_REF: Int = 0x0B97
        const val STENCIL_VALUE_MASK: Int = 0x0B93
        const val STENCIL_WRITEMASK: Int = 0x0B98
        const val STENCIL_BACK_FUNC: Int = 0x8800
        const val STENCIL_BACK_FAIL: Int = 0x8801
        const val STENCIL_BACK_PASS_DEPTH_FAIL: Int = 0x8802
        const val STENCIL_BACK_PASS_DEPTH_PASS: Int = 0x8803
        const val STENCIL_BACK_REF: Int = 0x8CA3
        const val STENCIL_BACK_VALUE_MASK: Int = 0x8CA4
        const val STENCIL_BACK_WRITEMASK: Int = 0x8CA5
        const val VIEWPORT: Int = 0x0BA2
        const val SCISSOR_BOX: Int = 0x0C10
        const val COLOR_CLEAR_VALUE: Int = 0x0C22
        const val COLOR_WRITEMASK: Int = 0x0C23
        const val UNPACK_ALIGNMENT: Int = 0x0CF5
        const val PACK_ALIGNMENT: Int = 0x0D05
        const val MAX_TEXTURE_SIZE: Int = 0x0D33
        const val MAX_VIEWPORT_DIMS: Int = 0x0D3A
        const val SUBPIXEL_BITS: Int = 0x0D50
        const val RED_BITS: Int = 0x0D52
        const val GREEN_BITS: Int = 0x0D53
        const val BLUE_BITS: Int = 0x0D54
        const val ALPHA_BITS: Int = 0x0D55
        const val DEPTH_BITS: Int = 0x0D56
        const val STENCIL_BITS: Int = 0x0D57
        const val POLYGON_OFFSET_UNITS: Int = 0x2A00
        const val POLYGON_OFFSET_FACTOR: Int = 0x8038
        const val TEXTURE_BINDING_2D: Int = 0x8069
        const val SAMPLE_BUFFERS: Int = 0x80A8
        const val SAMPLES: Int = 0x80A9
        const val SAMPLE_COVERAGE_VALUE: Int = 0x80AA
        const val SAMPLE_COVERAGE_INVERT: Int = 0x80AB
        const val NUM_COMPRESSED_TEXTURE_FORMATS: Int = 0x86A2
        const val COMPRESSED_TEXTURE_FORMATS: Int = 0x86A3
        const val DONT_CARE: Int = 0x1100
        const val FASTEST: Int = 0x1101
        const val NICEST: Int = 0x1102
        const val GENERATE_MIPMAP_HINT: Int = 0x8192
        const val BYTE: Int = 0x1400
        const val UNSIGNED_BYTE: Int = 0x1401
        const val SHORT: Int = 0x1402
        const val UNSIGNED_SHORT: Int = 0x1403
        const val INT: Int = 0x1404
        const val UNSIGNED_INT: Int = 0x1405
        const val FLOAT: Int = 0x1406
        const val FIXED: Int = 0x140C
        const val DEPTH_COMPONENT: Int = 0x1902
        const val ALPHA: Int = 0x1906
        const val RGB: Int = 0x1907
        const val RGBA: Int = 0x1908
        const val LUMINANCE: Int = 0x1909
        const val LUMINANCE_ALPHA: Int = 0x190A
        const val UNSIGNED_SHORT_4_4_4_4: Int = 0x8033
        const val UNSIGNED_SHORT_5_5_5_1: Int = 0x8034
        const val UNSIGNED_SHORT_5_6_5: Int = 0x8363
        const val FRAGMENT_SHADER: Int = 0x8B30
        const val VERTEX_SHADER: Int = 0x8B31
        const val MAX_VERTEX_ATTRIBS: Int = 0x8869
        const val MAX_VERTEX_UNIFORM_VECTORS: Int = 0x8DFB
        const val MAX_VARYING_VECTORS: Int = 0x8DFC
        const val MAX_COMBINED_TEXTURE_IMAGE_UNITS: Int = 0x8B4D
        const val MAX_VERTEX_TEXTURE_IMAGE_UNITS: Int = 0x8B4C
        const val MAX_TEXTURE_IMAGE_UNITS: Int = 0x8872
        const val MAX_FRAGMENT_UNIFORM_VECTORS: Int = 0x8DFD
        const val SHADER_TYPE: Int = 0x8B4F
        const val DELETE_STATUS: Int = 0x8B80
        const val LINK_STATUS: Int = 0x8B82
        const val VALIDATE_STATUS: Int = 0x8B83
        const val ATTACHED_SHADERS: Int = 0x8B85
        const val ACTIVE_UNIFORMS: Int = 0x8B86
        const val ACTIVE_UNIFORM_MAX_LENGTH: Int = 0x8B87
        const val ACTIVE_ATTRIBUTES: Int = 0x8B89
        const val ACTIVE_ATTRIBUTE_MAX_LENGTH: Int = 0x8B8A
        const val SHADING_LANGUAGE_VERSION: Int = 0x8B8C
        const val CURRENT_PROGRAM: Int = 0x8B8D
        const val NEVER: Int = 0x0200
        const val LESS: Int = 0x0201
        const val EQUAL: Int = 0x0202
        const val LEQUAL: Int = 0x0203
        const val GREATER: Int = 0x0204
        const val NOTEQUAL: Int = 0x0205
        const val GEQUAL: Int = 0x0206
        const val ALWAYS: Int = 0x0207
        const val KEEP: Int = 0x1E00
        const val REPLACE: Int = 0x1E01
        const val INCR: Int = 0x1E02
        const val DECR: Int = 0x1E03
        const val INVERT: Int = 0x150A
        const val INCR_WRAP: Int = 0x8507
        const val DECR_WRAP: Int = 0x8508
        const val VENDOR: Int = 0x1F00
        const val RENDERER: Int = 0x1F01
        const val VERSION: Int = 0x1F02
        const val EXTENSIONS: Int = 0x1F03
        const val NEAREST: Int = 0x2600
        const val LINEAR: Int = 0x2601
        const val NEAREST_MIPMAP_NEAREST: Int = 0x2700
        const val LINEAR_MIPMAP_NEAREST: Int = 0x2701
        const val NEAREST_MIPMAP_LINEAR: Int = 0x2702
        const val LINEAR_MIPMAP_LINEAR: Int = 0x2703
        const val TEXTURE_MAG_FILTER: Int = 0x2800
        const val TEXTURE_MIN_FILTER: Int = 0x2801
        const val TEXTURE_WRAP_S: Int = 0x2802
        const val TEXTURE_WRAP_T: Int = 0x2803
        const val TEXTURE_WRAP_R: Int = 0x8072
        const val TEXTURE: Int = 0x1702
        const val TEXTURE_CUBE_MAP: Int = 0x8513
        const val TEXTURE_BINDING_CUBE_MAP: Int = 0x8514
        const val TEXTURE_CUBE_MAP_POSITIVE_X: Int = 0x8515
        const val TEXTURE_CUBE_MAP_NEGATIVE_X: Int = 0x8516
        const val TEXTURE_CUBE_MAP_POSITIVE_Y: Int = 0x8517
        const val TEXTURE_CUBE_MAP_NEGATIVE_Y: Int = 0x8518
        const val TEXTURE_CUBE_MAP_POSITIVE_Z: Int = 0x8519
        const val TEXTURE_CUBE_MAP_NEGATIVE_Z: Int = 0x851A
        const val MAX_CUBE_MAP_TEXTURE_SIZE: Int = 0x851C
        const val TEXTURE0: Int = 0x84C0
        const val TEXTURE1: Int = 0x84C1
        const val TEXTURE2: Int = 0x84C2
        const val TEXTURE3: Int = 0x84C3
        const val TEXTURE4: Int = 0x84C4
        const val TEXTURE5: Int = 0x84C5
        const val TEXTURE6: Int = 0x84C6
        const val TEXTURE7: Int = 0x84C7
        const val TEXTURE8: Int = 0x84C8
        const val TEXTURE9: Int = 0x84C9
        const val TEXTURE10: Int = 0x84CA
        const val TEXTURE11: Int = 0x84CB
        const val TEXTURE12: Int = 0x84CC
        const val TEXTURE13: Int = 0x84CD
        const val TEXTURE14: Int = 0x84CE
        const val TEXTURE15: Int = 0x84CF
        const val TEXTURE16: Int = 0x84D0
        const val TEXTURE17: Int = 0x84D1
        const val TEXTURE18: Int = 0x84D2
        const val TEXTURE19: Int = 0x84D3
        const val TEXTURE20: Int = 0x84D4
        const val TEXTURE21: Int = 0x84D5
        const val TEXTURE22: Int = 0x84D6
        const val TEXTURE23: Int = 0x84D7
        const val TEXTURE24: Int = 0x84D8
        const val TEXTURE25: Int = 0x84D9
        const val TEXTURE26: Int = 0x84DA
        const val TEXTURE27: Int = 0x84DB
        const val TEXTURE28: Int = 0x84DC
        const val TEXTURE29: Int = 0x84DD
        const val TEXTURE30: Int = 0x84DE
        const val TEXTURE31: Int = 0x84DF
        const val ACTIVE_TEXTURE: Int = 0x84E0
        const val REPEAT: Int = 0x2901
        const val CLAMP_TO_EDGE: Int = 0x812F
        const val MIRRORED_REPEAT: Int = 0x8370
        const val FLOAT_VEC2: Int = 0x8B50
        const val FLOAT_VEC3: Int = 0x8B51
        const val FLOAT_VEC4: Int = 0x8B52
        const val INT_VEC2: Int = 0x8B53
        const val INT_VEC3: Int = 0x8B54
        const val INT_VEC4: Int = 0x8B55
        const val BOOL: Int = 0x8B56
        const val BOOL_VEC2: Int = 0x8B57
        const val BOOL_VEC3: Int = 0x8B58
        const val BOOL_VEC4: Int = 0x8B59
        const val FLOAT_MAT2: Int = 0x8B5A
        const val FLOAT_MAT3: Int = 0x8B5B
        const val FLOAT_MAT4: Int = 0x8B5C
        const val SAMPLER_2D: Int = 0x8B5E
        const val SAMPLER_CUBE: Int = 0x8B60
        const val VERTEX_ATTRIB_ARRAY_ENABLED: Int = 0x8622
        const val VERTEX_ATTRIB_ARRAY_SIZE: Int = 0x8623
        const val VERTEX_ATTRIB_ARRAY_STRIDE: Int = 0x8624
        const val VERTEX_ATTRIB_ARRAY_TYPE: Int = 0x8625
        const val VERTEX_ATTRIB_ARRAY_NORMALIZED: Int = 0x886A
        const val VERTEX_ATTRIB_ARRAY_POINTER: Int = 0x8645
        const val VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: Int = 0x889F
        const val IMPLEMENTATION_COLOR_READ_TYPE: Int = 0x8B9A
        const val IMPLEMENTATION_COLOR_READ_FORMAT: Int = 0x8B9B
        const val COMPILE_STATUS: Int = 0x8B81
        const val INFO_LOG_LENGTH: Int = 0x8B84
        const val SHADER_SOURCE_LENGTH: Int = 0x8B88
        const val SHADER_COMPILER: Int = 0x8DFA
        const val SHADER_BINARY_FORMATS: Int = 0x8DF8
        const val NUM_SHADER_BINARY_FORMATS: Int = 0x8DF9
        const val LOW_FLOAT: Int = 0x8DF0
        const val MEDIUM_FLOAT: Int = 0x8DF1
        const val HIGH_FLOAT: Int = 0x8DF2
        const val LOW_INT: Int = 0x8DF3
        const val MEDIUM_INT: Int = 0x8DF4
        const val HIGH_INT: Int = 0x8DF5
        const val FRAMEBUFFER: Int = 0x8D40
        const val RENDERBUFFER: Int = 0x8D41
        const val RGBA4: Int = 0x8056
        const val RGB5_A1: Int = 0x8057
        const val RGB565: Int = 0x8D62
        const val DEPTH_COMPONENT16: Int = 0x81A5
        const val STENCIL_INDEX: Int = 0x1901
        const val STENCIL_INDEX8: Int = 0x8D48
        const val RENDERBUFFER_WIDTH: Int = 0x8D42
        const val RENDERBUFFER_HEIGHT: Int = 0x8D43
        const val RENDERBUFFER_INTERNAL_FORMAT: Int = 0x8D44
        const val RENDERBUFFER_RED_SIZE: Int = 0x8D50
        const val RENDERBUFFER_GREEN_SIZE: Int = 0x8D51
        const val RENDERBUFFER_BLUE_SIZE: Int = 0x8D52
        const val RENDERBUFFER_ALPHA_SIZE: Int = 0x8D53
        const val RENDERBUFFER_DEPTH_SIZE: Int = 0x8D54
        const val RENDERBUFFER_STENCIL_SIZE: Int = 0x8D55
        const val FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: Int = 0x8CD0
        const val FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: Int = 0x8CD1
        const val FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: Int = 0x8CD2
        const val FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: Int = 0x8CD3
        const val COLOR_ATTACHMENT0: Int = 0x8CE0
        const val DEPTH_ATTACHMENT: Int = 0x8D00
        const val DEPTH_STENCIL_ATTACHMENT = 0x821A
        const val DEPTH_STENCIL         = 0x84F9
        const val STENCIL_ATTACHMENT: Int = 0x8D20
        const val NONE: Int = 0x0000
        const val FRAMEBUFFER_COMPLETE: Int = 0x8CD5
        const val FRAMEBUFFER_INCOMPLETE_ATTACHMENT: Int = 0x8CD6
        const val FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: Int = 0x8CD7
        const val FRAMEBUFFER_INCOMPLETE_DIMENSIONS: Int = 0x8CD9
        const val FRAMEBUFFER_UNSUPPORTED: Int = 0x8CDD
        const val FRAMEBUFFER_BINDING: Int = 0x8CA6
        const val RENDERBUFFER_BINDING: Int = 0x8CA7
        const val MAX_RENDERBUFFER_SIZE: Int = 0x84E8
        const val INVALID_FRAMEBUFFER_OPERATION: Int = 0x0506 // 1286
        const val TEXTURE_2D_MULTISAMPLE: Int = 0x9100

        // EXTRA
        const val RGBA32F = 0x8814

        // https://download.blender.org/source/chest/blender_1.72_tree/glut-win/glut_bitmap.c
        //const val UNPACK_ALIGNMENT = 0x0CF5
        const val UNPACK_LSB_FIRST = 0x0CF1
        const val UNPACK_ROW_LENGTH = 0x0CF2
        const val UNPACK_SKIP_PIXELS = 0x0CF4
        const val UNPACK_SKIP_ROWS = 0x0CF3
        const val UNPACK_SWAP_BYTES = 0x0CF0

        // WEBGL
        const val UNPACK_PREMULTIPLY_ALPHA_WEBGL = 37441

        // ANDROID
        const val TEXTURE_EXTERNAL_OES           = 0x8D65

        // UNIFORM BUFFERS
        const val UNIFORM_BUFFER = 0x8A11
        const val UNIFORM_BUFFER_BINDING = 0x8A28
        const val UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34
    }

    open fun init() = Unit
    open fun handleContextLost() = Unit
    override fun startFrame(): Unit = Unit
    override fun endFrame(): Unit = Unit
    open fun beforeDoRender(contextVersion: Int): Unit = Unit

    // https://www.khronos.org/registry/OpenGL/extensions/OES/OES_texture_float.txt
    override val isFloatTextureSupported: Boolean get() = false
}

abstract class KmlGlWithExtensions : KmlGl() {
    open fun getStringi(name: Int, index: Int): String? = TODO()

    private var _extensions: Set? = null

    open val extensions: Set get() {
        if (_extensions == null) {
            _extensions = try {
                val numExtensions = getIntegerv(GL_NUM_EXTENSIONS)
                if (numExtensions <= 0) TODO()
                (0 until numExtensions).mapNotNull { getStringi(EXTENSIONS, it) }.toSet()
            } catch (e: Throwable) {
                getString(EXTENSIONS).split(" ").toSet()
            }
        }
        //println("GL_EXTENSIONS=$_extensions")
        return _extensions!!
    }

    override val graphicExtensions: Set get() = extensions

    // https://www.khronos.org/registry/OpenGL/extensions/OES/OES_texture_float.txt
    override val isFloatTextureSupported: Boolean by lazy {
        //println("extensions: $extensions")
        "GL_OES_texture_float" in extensions || "GL_ARB_texture_float" in extensions
    }

    companion object {
        const val GL_NUM_EXTENSIONS = 0x821D
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy