gl

package
v0.1.0-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gl is a software implementation of OpenGL ES 2.0/3.0 semantics as exposed by WebGL 1 and 2: GL state machine, texture sampling, a tile based parallel rasterizer and a GLSL ES interpreter (package glsl).

Code generated from the GL constant table; DO NOT EDIT.

Index

Constants

View Source
const (
	GL_DEPTH_BUFFER_BIT                              = 0x100
	GL_STENCIL_BUFFER_BIT                            = 0x400
	GL_COLOR_BUFFER_BIT                              = 0x4000
	GL_POINTS                                        = 0
	GL_LINES                                         = 1
	GL_LINE_LOOP                                     = 2
	GL_LINE_STRIP                                    = 3
	GL_TRIANGLES                                     = 4
	GL_TRIANGLE_STRIP                                = 5
	GL_TRIANGLE_FAN                                  = 6
	GL_ZERO                                          = 0
	GL_ONE                                           = 1
	GL_SRC_COLOR                                     = 0x300
	GL_ONE_MINUS_SRC_COLOR                           = 0x301
	GL_SRC_ALPHA                                     = 0x302
	GL_ONE_MINUS_SRC_ALPHA                           = 0x303
	GL_DST_ALPHA                                     = 0x304
	GL_ONE_MINUS_DST_ALPHA                           = 0x305
	GL_DST_COLOR                                     = 0x306
	GL_ONE_MINUS_DST_COLOR                           = 0x307
	GL_SRC_ALPHA_SATURATE                            = 0x308
	GL_FUNC_ADD                                      = 0x8006
	GL_BLEND_EQUATION                                = 0x8009
	GL_BLEND_EQUATION_RGB                            = 0x8009
	GL_BLEND_EQUATION_ALPHA                          = 0x883D
	GL_FUNC_SUBTRACT                                 = 0x800A
	GL_FUNC_REVERSE_SUBTRACT                         = 0x800B
	GL_BLEND_DST_RGB                                 = 0x80C8
	GL_BLEND_SRC_RGB                                 = 0x80C9
	GL_BLEND_DST_ALPHA                               = 0x80CA
	GL_BLEND_SRC_ALPHA                               = 0x80CB
	GL_CONSTANT_COLOR                                = 0x8001
	GL_ONE_MINUS_CONSTANT_COLOR                      = 0x8002
	GL_CONSTANT_ALPHA                                = 0x8003
	GL_ONE_MINUS_CONSTANT_ALPHA                      = 0x8004
	GL_BLEND_COLOR                                   = 0x8005
	GL_ARRAY_BUFFER                                  = 0x8892
	GL_ELEMENT_ARRAY_BUFFER                          = 0x8893
	GL_ARRAY_BUFFER_BINDING                          = 0x8894
	GL_ELEMENT_ARRAY_BUFFER_BINDING                  = 0x8895
	GL_STREAM_DRAW                                   = 0x88E0
	GL_STATIC_DRAW                                   = 0x88E4
	GL_DYNAMIC_DRAW                                  = 0x88E8
	GL_BUFFER_SIZE                                   = 0x8764
	GL_BUFFER_USAGE                                  = 0x8765
	GL_CURRENT_VERTEX_ATTRIB                         = 0x8626
	GL_FRONT                                         = 0x404
	GL_BACK                                          = 0x405
	GL_FRONT_AND_BACK                                = 0x408
	GL_TEXTURE_2D                                    = 0xDE1
	GL_CULL_FACE                                     = 0xB44
	GL_BLEND                                         = 0xBE2
	GL_DITHER                                        = 0xBD0
	GL_STENCIL_TEST                                  = 0xB90
	GL_DEPTH_TEST                                    = 0xB71
	GL_SCISSOR_TEST                                  = 0xC11
	GL_POLYGON_OFFSET_FILL                           = 0x8037
	GL_SAMPLE_ALPHA_TO_COVERAGE                      = 0x809E
	GL_SAMPLE_COVERAGE                               = 0x80A0
	GL_NO_ERROR                                      = 0
	GL_INVALID_ENUM                                  = 0x500
	GL_INVALID_VALUE                                 = 0x501
	GL_INVALID_OPERATION                             = 0x502
	GL_OUT_OF_MEMORY                                 = 0x505
	GL_CW                                            = 0x900
	GL_CCW                                           = 0x901
	GL_LINE_WIDTH                                    = 0xB21
	GL_ALIASED_POINT_SIZE_RANGE                      = 0x846D
	GL_ALIASED_LINE_WIDTH_RANGE                      = 0x846E
	GL_CULL_FACE_MODE                                = 0xB45
	GL_FRONT_FACE                                    = 0xB46
	GL_DEPTH_RANGE                                   = 0xB70
	GL_DEPTH_WRITEMASK                               = 0xB72
	GL_DEPTH_CLEAR_VALUE                             = 0xB73
	GL_DEPTH_FUNC                                    = 0xB74
	GL_STENCIL_CLEAR_VALUE                           = 0xB91
	GL_STENCIL_FUNC                                  = 0xB92
	GL_STENCIL_FAIL                                  = 0xB94
	GL_STENCIL_PASS_DEPTH_FAIL                       = 0xB95
	GL_STENCIL_PASS_DEPTH_PASS                       = 0xB96
	GL_STENCIL_REF                                   = 0xB97
	GL_STENCIL_VALUE_MASK                            = 0xB93
	GL_STENCIL_WRITEMASK                             = 0xB98
	GL_STENCIL_BACK_FUNC                             = 0x8800
	GL_STENCIL_BACK_FAIL                             = 0x8801
	GL_STENCIL_BACK_PASS_DEPTH_FAIL                  = 0x8802
	GL_STENCIL_BACK_PASS_DEPTH_PASS                  = 0x8803
	GL_STENCIL_BACK_REF                              = 0x8CA3
	GL_STENCIL_BACK_VALUE_MASK                       = 0x8CA4
	GL_STENCIL_BACK_WRITEMASK                        = 0x8CA5
	GL_VIEWPORT                                      = 0xBA2
	GL_SCISSOR_BOX                                   = 0xC10
	GL_COLOR_CLEAR_VALUE                             = 0xC22
	GL_COLOR_WRITEMASK                               = 0xC23
	GL_UNPACK_ALIGNMENT                              = 0xCF5
	GL_PACK_ALIGNMENT                                = 0xD05
	GL_MAX_TEXTURE_SIZE                              = 0xD33
	GL_MAX_VIEWPORT_DIMS                             = 0xD3A
	GL_SUBPIXEL_BITS                                 = 0xD50
	GL_RED_BITS                                      = 0xD52
	GL_GREEN_BITS                                    = 0xD53
	GL_BLUE_BITS                                     = 0xD54
	GL_ALPHA_BITS                                    = 0xD55
	GL_DEPTH_BITS                                    = 0xD56
	GL_STENCIL_BITS                                  = 0xD57
	GL_POLYGON_OFFSET_UNITS                          = 0x2A00
	GL_POLYGON_OFFSET_FACTOR                         = 0x8038
	GL_TEXTURE_BINDING_2D                            = 0x8069
	GL_SAMPLE_BUFFERS                                = 0x80A8
	GL_SAMPLES                                       = 0x80A9
	GL_SAMPLE_COVERAGE_VALUE                         = 0x80AA
	GL_SAMPLE_COVERAGE_INVERT                        = 0x80AB
	GL_COMPRESSED_TEXTURE_FORMATS                    = 0x86A3
	GL_DONT_CARE                                     = 0x1100
	GL_FASTEST                                       = 0x1101
	GL_NICEST                                        = 0x1102
	GL_GENERATE_MIPMAP_HINT                          = 0x8192
	GL_BYTE                                          = 0x1400
	GL_UNSIGNED_BYTE                                 = 0x1401
	GL_SHORT                                         = 0x1402
	GL_UNSIGNED_SHORT                                = 0x1403
	GL_INT                                           = 0x1404
	GL_UNSIGNED_INT                                  = 0x1405
	GL_FLOAT                                         = 0x1406
	GL_HALF_FLOAT                                    = 0x140B
	GL_FIXED                                         = 0x140C
	GL_DEPTH_COMPONENT                               = 0x1902
	GL_ALPHA                                         = 0x1906
	GL_RGB                                           = 0x1907
	GL_RGBA                                          = 0x1908
	GL_LUMINANCE                                     = 0x1909
	GL_LUMINANCE_ALPHA                               = 0x190A
	GL_UNSIGNED_SHORT_4_4_4_4                        = 0x8033
	GL_UNSIGNED_SHORT_5_5_5_1                        = 0x8034
	GL_UNSIGNED_SHORT_5_6_5                          = 0x8363
	GL_FRAGMENT_SHADER                               = 0x8B30
	GL_VERTEX_SHADER                                 = 0x8B31
	GL_MAX_VERTEX_ATTRIBS                            = 0x8869
	GL_MAX_VERTEX_UNIFORM_VECTORS                    = 0x8DFB
	GL_MAX_VARYING_VECTORS                           = 0x8DFC
	GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS              = 0x8B4D
	GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS                = 0x8B4C
	GL_MAX_TEXTURE_IMAGE_UNITS                       = 0x8872
	GL_MAX_FRAGMENT_UNIFORM_VECTORS                  = 0x8DFD
	GL_SHADER_TYPE                                   = 0x8B4F
	GL_DELETE_STATUS                                 = 0x8B80
	GL_LINK_STATUS                                   = 0x8B82
	GL_VALIDATE_STATUS                               = 0x8B83
	GL_ATTACHED_SHADERS                              = 0x8B85
	GL_ACTIVE_UNIFORMS                               = 0x8B86
	GL_ACTIVE_ATTRIBUTES                             = 0x8B89
	GL_SHADING_LANGUAGE_VERSION                      = 0x8B8C
	GL_CURRENT_PROGRAM                               = 0x8B8D
	GL_NEVER                                         = 0x200
	GL_LESS                                          = 0x201
	GL_EQUAL                                         = 0x202
	GL_LEQUAL                                        = 0x203
	GL_GREATER                                       = 0x204
	GL_NOTEQUAL                                      = 0x205
	GL_GEQUAL                                        = 0x206
	GL_ALWAYS                                        = 0x207
	GL_KEEP                                          = 0x1E00
	GL_REPLACE                                       = 0x1E01
	GL_INCR                                          = 0x1E02
	GL_DECR                                          = 0x1E03
	GL_INVERT                                        = 0x150A
	GL_INCR_WRAP                                     = 0x8507
	GL_DECR_WRAP                                     = 0x8508
	GL_VENDOR                                        = 0x1F00
	GL_RENDERER                                      = 0x1F01
	GL_VERSION                                       = 0x1F02
	GL_EXTENSIONS                                    = 0x1F03
	GL_NEAREST                                       = 0x2600
	GL_LINEAR                                        = 0x2601
	GL_NEAREST_MIPMAP_NEAREST                        = 0x2700
	GL_LINEAR_MIPMAP_NEAREST                         = 0x2701
	GL_NEAREST_MIPMAP_LINEAR                         = 0x2702
	GL_LINEAR_MIPMAP_LINEAR                          = 0x2703
	GL_TEXTURE_MAG_FILTER                            = 0x2800
	GL_TEXTURE_MIN_FILTER                            = 0x2801
	GL_TEXTURE_WRAP_S                                = 0x2802
	GL_TEXTURE_WRAP_T                                = 0x2803
	GL_TEXTURE                                       = 0x1702
	GL_TEXTURE_CUBE_MAP                              = 0x8513
	GL_TEXTURE_BINDING_CUBE_MAP                      = 0x8514
	GL_TEXTURE_CUBE_MAP_POSITIVE_X                   = 0x8515
	GL_TEXTURE_CUBE_MAP_NEGATIVE_X                   = 0x8516
	GL_TEXTURE_CUBE_MAP_POSITIVE_Y                   = 0x8517
	GL_TEXTURE_CUBE_MAP_NEGATIVE_Y                   = 0x8518
	GL_TEXTURE_CUBE_MAP_POSITIVE_Z                   = 0x8519
	GL_TEXTURE_CUBE_MAP_NEGATIVE_Z                   = 0x851A
	GL_MAX_CUBE_MAP_TEXTURE_SIZE                     = 0x851C
	GL_TEXTURE0                                      = 0x84C0
	GL_ACTIVE_TEXTURE                                = 0x84E0
	GL_REPEAT                                        = 0x2901
	GL_CLAMP_TO_EDGE                                 = 0x812F
	GL_MIRRORED_REPEAT                               = 0x8370
	GL_FLOAT_VEC2                                    = 0x8B50
	GL_FLOAT_VEC3                                    = 0x8B51
	GL_FLOAT_VEC4                                    = 0x8B52
	GL_INT_VEC2                                      = 0x8B53
	GL_INT_VEC3                                      = 0x8B54
	GL_INT_VEC4                                      = 0x8B55
	GL_BOOL                                          = 0x8B56
	GL_BOOL_VEC2                                     = 0x8B57
	GL_BOOL_VEC3                                     = 0x8B58
	GL_BOOL_VEC4                                     = 0x8B59
	GL_FLOAT_MAT2                                    = 0x8B5A
	GL_FLOAT_MAT3                                    = 0x8B5B
	GL_FLOAT_MAT4                                    = 0x8B5C
	GL_SAMPLER_2D                                    = 0x8B5E
	GL_SAMPLER_CUBE                                  = 0x8B60
	GL_VERTEX_ATTRIB_ARRAY_ENABLED                   = 0x8622
	GL_VERTEX_ATTRIB_ARRAY_SIZE                      = 0x8623
	GL_VERTEX_ATTRIB_ARRAY_STRIDE                    = 0x8624
	GL_VERTEX_ATTRIB_ARRAY_TYPE                      = 0x8625
	GL_VERTEX_ATTRIB_ARRAY_NORMALIZED                = 0x886A
	GL_VERTEX_ATTRIB_ARRAY_POINTER                   = 0x8645
	GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING            = 0x889F
	GL_IMPLEMENTATION_COLOR_READ_TYPE                = 0x8B9A
	GL_IMPLEMENTATION_COLOR_READ_FORMAT              = 0x8B9B
	GL_COMPILE_STATUS                                = 0x8B81
	GL_LOW_FLOAT                                     = 0x8DF0
	GL_MEDIUM_FLOAT                                  = 0x8DF1
	GL_HIGH_FLOAT                                    = 0x8DF2
	GL_LOW_INT                                       = 0x8DF3
	GL_MEDIUM_INT                                    = 0x8DF4
	GL_HIGH_INT                                      = 0x8DF5
	GL_FRAMEBUFFER                                   = 0x8D40
	GL_RENDERBUFFER                                  = 0x8D41
	GL_RGBA4                                         = 0x8056
	GL_RGB5_A1                                       = 0x8057
	GL_RGB565                                        = 0x8D62
	GL_DEPTH_COMPONENT16                             = 0x81A5
	GL_STENCIL_INDEX8                                = 0x8D48
	GL_DEPTH_STENCIL                                 = 0x84F9
	GL_RENDERBUFFER_WIDTH                            = 0x8D42
	GL_RENDERBUFFER_HEIGHT                           = 0x8D43
	GL_RENDERBUFFER_INTERNAL_FORMAT                  = 0x8D44
	GL_RENDERBUFFER_RED_SIZE                         = 0x8D50
	GL_RENDERBUFFER_GREEN_SIZE                       = 0x8D51
	GL_RENDERBUFFER_BLUE_SIZE                        = 0x8D52
	GL_RENDERBUFFER_ALPHA_SIZE                       = 0x8D53
	GL_RENDERBUFFER_DEPTH_SIZE                       = 0x8D54
	GL_RENDERBUFFER_STENCIL_SIZE                     = 0x8D55
	GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE            = 0x8CD0
	GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME            = 0x8CD1
	GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL          = 0x8CD2
	GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE  = 0x8CD3
	GL_COLOR_ATTACHMENT0                             = 0x8CE0
	GL_DEPTH_ATTACHMENT                              = 0x8D00
	GL_STENCIL_ATTACHMENT                            = 0x8D20
	GL_DEPTH_STENCIL_ATTACHMENT                      = 0x821A
	GL_NONE                                          = 0
	GL_FRAMEBUFFER_COMPLETE                          = 0x8CD5
	GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT             = 0x8CD6
	GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT     = 0x8CD7
	GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS             = 0x8CD9
	GL_FRAMEBUFFER_UNSUPPORTED                       = 0x8CDD
	GL_FRAMEBUFFER_BINDING                           = 0x8CA6
	GL_RENDERBUFFER_BINDING                          = 0x8CA7
	GL_MAX_RENDERBUFFER_SIZE                         = 0x84E8
	GL_INVALID_FRAMEBUFFER_OPERATION                 = 0x506
	GL_UNPACK_FLIP_Y_WEBGL                           = 0x9240
	GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL                = 0x9241
	GL_CONTEXT_LOST_WEBGL                            = 0x9242
	GL_UNPACK_COLORSPACE_CONVERSION_WEBGL            = 0x9243
	GL_BROWSER_DEFAULT_WEBGL                         = 0x9244
	GL_READ_BUFFER                                   = 0x0C02
	GL_UNPACK_ROW_LENGTH                             = 0x0CF2
	GL_UNPACK_SKIP_ROWS                              = 0x0CF3
	GL_UNPACK_SKIP_PIXELS                            = 0x0CF4
	GL_PACK_ROW_LENGTH                               = 0x0D02
	GL_PACK_SKIP_ROWS                                = 0x0D03
	GL_PACK_SKIP_PIXELS                              = 0x0D04
	GL_COLOR                                         = 0x1800
	GL_DEPTH                                         = 0x1801
	GL_STENCIL                                       = 0x1802
	GL_RED                                           = 0x1903
	GL_RGB8                                          = 0x8051
	GL_RGBA8                                         = 0x8058
	GL_RGB10_A2                                      = 0x8059
	GL_TEXTURE_BINDING_3D                            = 0x806A
	GL_UNPACK_SKIP_IMAGES                            = 0x806D
	GL_UNPACK_IMAGE_HEIGHT                           = 0x806E
	GL_TEXTURE_3D                                    = 0x806F
	GL_TEXTURE_WRAP_R                                = 0x8072
	GL_MAX_3D_TEXTURE_SIZE                           = 0x8073
	GL_UNSIGNED_INT_2_10_10_10_REV                   = 0x8368
	GL_MAX_ELEMENTS_VERTICES                         = 0x80E8
	GL_MAX_ELEMENTS_INDICES                          = 0x80E9
	GL_TEXTURE_MIN_LOD                               = 0x813A
	GL_TEXTURE_MAX_LOD                               = 0x813B
	GL_TEXTURE_BASE_LEVEL                            = 0x813C
	GL_TEXTURE_MAX_LEVEL                             = 0x813D
	GL_MIN                                           = 0x8007
	GL_MAX                                           = 0x8008
	GL_DEPTH_COMPONENT24                             = 0x81A6
	GL_MAX_TEXTURE_LOD_BIAS                          = 0x84FD
	GL_TEXTURE_COMPARE_MODE                          = 0x884C
	GL_TEXTURE_COMPARE_FUNC                          = 0x884D
	GL_CURRENT_QUERY                                 = 0x8865
	GL_QUERY_RESULT                                  = 0x8866
	GL_QUERY_RESULT_AVAILABLE                        = 0x8867
	GL_STREAM_READ                                   = 0x88E1
	GL_STREAM_COPY                                   = 0x88E2
	GL_STATIC_READ                                   = 0x88E5
	GL_STATIC_COPY                                   = 0x88E6
	GL_DYNAMIC_READ                                  = 0x88E9
	GL_DYNAMIC_COPY                                  = 0x88EA
	GL_MAX_DRAW_BUFFERS                              = 0x8824
	GL_DRAW_BUFFER0                                  = 0x8825
	GL_MAX_FRAGMENT_UNIFORM_COMPONENTS               = 0x8B49
	GL_MAX_VERTEX_UNIFORM_COMPONENTS                 = 0x8B4A
	GL_SAMPLER_3D                                    = 0x8B5F
	GL_SAMPLER_2D_SHADOW                             = 0x8B62
	GL_FRAGMENT_SHADER_DERIVATIVE_HINT               = 0x8B8B
	GL_PIXEL_PACK_BUFFER                             = 0x88EB
	GL_PIXEL_UNPACK_BUFFER                           = 0x88EC
	GL_PIXEL_PACK_BUFFER_BINDING                     = 0x88ED
	GL_PIXEL_UNPACK_BUFFER_BINDING                   = 0x88EF
	GL_FLOAT_MAT2x3                                  = 0x8B65
	GL_FLOAT_MAT2x4                                  = 0x8B66
	GL_FLOAT_MAT3x2                                  = 0x8B67
	GL_FLOAT_MAT3x4                                  = 0x8B68
	GL_FLOAT_MAT4x2                                  = 0x8B69
	GL_FLOAT_MAT4x3                                  = 0x8B6A
	GL_SRGB                                          = 0x8C40
	GL_SRGB8                                         = 0x8C41
	GL_SRGB8_ALPHA8                                  = 0x8C43
	GL_COMPARE_REF_TO_TEXTURE                        = 0x884E
	GL_RGBA32F                                       = 0x8814
	GL_RGB32F                                        = 0x8815
	GL_RGBA16F                                       = 0x881A
	GL_RGB16F                                        = 0x881B
	GL_VERTEX_ATTRIB_ARRAY_INTEGER                   = 0x88FD
	GL_MAX_ARRAY_TEXTURE_LAYERS                      = 0x88FF
	GL_MIN_PROGRAM_TEXEL_OFFSET                      = 0x8904
	GL_MAX_PROGRAM_TEXEL_OFFSET                      = 0x8905
	GL_MAX_VARYING_COMPONENTS                        = 0x8B4B
	GL_TEXTURE_2D_ARRAY                              = 0x8C1A
	GL_TEXTURE_BINDING_2D_ARRAY                      = 0x8C1D
	GL_R11F_G11F_B10F                                = 0x8C3A
	GL_UNSIGNED_INT_10F_11F_11F_REV                  = 0x8C3B
	GL_RGB9_E5                                       = 0x8C3D
	GL_UNSIGNED_INT_5_9_9_9_REV                      = 0x8C3E
	GL_TRANSFORM_FEEDBACK_BUFFER_MODE                = 0x8C7F
	GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS    = 0x8C80
	GL_TRANSFORM_FEEDBACK_VARYINGS                   = 0x8C83
	GL_TRANSFORM_FEEDBACK_BUFFER_START               = 0x8C84
	GL_TRANSFORM_FEEDBACK_BUFFER_SIZE                = 0x8C85
	GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN         = 0x8C88
	GL_RASTERIZER_DISCARD                            = 0x8C89
	GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A
	GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS       = 0x8C8B
	GL_INTERLEAVED_ATTRIBS                           = 0x8C8C
	GL_SEPARATE_ATTRIBS                              = 0x8C8D
	GL_TRANSFORM_FEEDBACK_BUFFER                     = 0x8C8E
	GL_TRANSFORM_FEEDBACK_BUFFER_BINDING             = 0x8C8F
	GL_TRANSFORM_FEEDBACK                            = 0x8E22
	GL_TRANSFORM_FEEDBACK_PAUSED                     = 0x8E23
	GL_TRANSFORM_FEEDBACK_ACTIVE                     = 0x8E24
	GL_TRANSFORM_FEEDBACK_BINDING                    = 0x8E25
	GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING         = 0x8210
	GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE         = 0x8211
	GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE               = 0x8212
	GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE             = 0x8213
	GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE              = 0x8214
	GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE             = 0x8215
	GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE             = 0x8216
	GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE           = 0x8217
	GL_FRAMEBUFFER_DEFAULT                           = 0x8218
	GL_DEPTH24_STENCIL8                              = 0x88F0
	GL_UNSIGNED_NORMALIZED                           = 0x8C17
	GL_DRAW_FRAMEBUFFER_BINDING                      = 0x8CA6
	GL_READ_FRAMEBUFFER                              = 0x8CA8
	GL_DRAW_FRAMEBUFFER                              = 0x8CA9
	GL_READ_FRAMEBUFFER_BINDING                      = 0x8CAA
	GL_RENDERBUFFER_SAMPLES                          = 0x8CAB
	GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER          = 0x8CD4
	GL_MAX_COLOR_ATTACHMENTS                         = 0x8CDF
	GL_COLOR_ATTACHMENT1                             = 0x8CE1
	GL_COLOR_ATTACHMENT2                             = 0x8CE2
	GL_COLOR_ATTACHMENT3                             = 0x8CE3
	GL_COLOR_ATTACHMENT4                             = 0x8CE4
	GL_COLOR_ATTACHMENT5                             = 0x8CE5
	GL_COLOR_ATTACHMENT6                             = 0x8CE6
	GL_COLOR_ATTACHMENT7                             = 0x8CE7
	GL_COLOR_ATTACHMENT8                             = 0x8CE8
	GL_COLOR_ATTACHMENT9                             = 0x8CE9
	GL_COLOR_ATTACHMENT10                            = 0x8CEA
	GL_COLOR_ATTACHMENT11                            = 0x8CEB
	GL_COLOR_ATTACHMENT12                            = 0x8CEC
	GL_COLOR_ATTACHMENT13                            = 0x8CED
	GL_COLOR_ATTACHMENT14                            = 0x8CEE
	GL_COLOR_ATTACHMENT15                            = 0x8CEF
	GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE            = 0x8D56
	GL_MAX_SAMPLES                                   = 0x8D57
	GL_HALF_FLOAT_OES                                = 0x8D61
	GL_RG                                            = 0x8227
	GL_RG_INTEGER                                    = 0x8228
	GL_R8                                            = 0x8229
	GL_RG8                                           = 0x822B
	GL_R16F                                          = 0x822D
	GL_R32F                                          = 0x822E
	GL_RG16F                                         = 0x822F
	GL_RG32F                                         = 0x8230
	GL_R8I                                           = 0x8231
	GL_R8UI                                          = 0x8232
	GL_R16I                                          = 0x8233
	GL_R16UI                                         = 0x8234
	GL_R32I                                          = 0x8235
	GL_R32UI                                         = 0x8236
	GL_RG8I                                          = 0x8237
	GL_RG8UI                                         = 0x8238
	GL_RG16I                                         = 0x8239
	GL_RG16UI                                        = 0x823A
	GL_RG32I                                         = 0x823B
	GL_RG32UI                                        = 0x823C
	GL_VERTEX_ARRAY_BINDING                          = 0x85B5
	GL_R8_SNORM                                      = 0x8F94
	GL_RG8_SNORM                                     = 0x8F95
	GL_RGB8_SNORM                                    = 0x8F96
	GL_RGBA8_SNORM                                   = 0x8F97
	GL_SIGNED_NORMALIZED                             = 0x8F9C
	GL_COPY_READ_BUFFER                              = 0x8F36
	GL_COPY_WRITE_BUFFER                             = 0x8F37
	GL_COPY_READ_BUFFER_BINDING                      = 0x8F36
	GL_COPY_WRITE_BUFFER_BINDING                     = 0x8F37
	GL_UNIFORM_BUFFER                                = 0x8A11
	GL_UNIFORM_BUFFER_BINDING                        = 0x8A28
	GL_UNIFORM_BUFFER_START                          = 0x8A29
	GL_UNIFORM_BUFFER_SIZE                           = 0x8A2A
	GL_MAX_VERTEX_UNIFORM_BLOCKS                     = 0x8A2B
	GL_MAX_FRAGMENT_UNIFORM_BLOCKS                   = 0x8A2D
	GL_MAX_COMBINED_UNIFORM_BLOCKS                   = 0x8A2E
	GL_MAX_UNIFORM_BUFFER_BINDINGS                   = 0x8A2F
	GL_MAX_UNIFORM_BLOCK_SIZE                        = 0x8A30
	GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS        = 0x8A31
	GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS      = 0x8A33
	GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT               = 0x8A34
	GL_ACTIVE_UNIFORM_BLOCKS                         = 0x8A36
	GL_UNIFORM_TYPE                                  = 0x8A37
	GL_UNIFORM_SIZE                                  = 0x8A38
	GL_UNIFORM_BLOCK_INDEX                           = 0x8A3A
	GL_UNIFORM_OFFSET                                = 0x8A3B
	GL_UNIFORM_ARRAY_STRIDE                          = 0x8A3C
	GL_UNIFORM_MATRIX_STRIDE                         = 0x8A3D
	GL_UNIFORM_IS_ROW_MAJOR                          = 0x8A3E
	GL_UNIFORM_BLOCK_BINDING                         = 0x8A3F
	GL_UNIFORM_BLOCK_DATA_SIZE                       = 0x8A40
	GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS                 = 0x8A42
	GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES          = 0x8A43
	GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER     = 0x8A44
	GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER   = 0x8A46
	GL_INVALID_INDEX                                 = 0xFFFFFFFF
	GL_MAX_VERTEX_OUTPUT_COMPONENTS                  = 0x9122
	GL_MAX_FRAGMENT_INPUT_COMPONENTS                 = 0x9125
	GL_MAX_SERVER_WAIT_TIMEOUT                       = 0x9111
	GL_OBJECT_TYPE                                   = 0x9112
	GL_SYNC_CONDITION                                = 0x9113
	GL_SYNC_STATUS                                   = 0x9114
	GL_SYNC_FLAGS                                    = 0x9115
	GL_SYNC_FENCE                                    = 0x9116
	GL_SYNC_GPU_COMMANDS_COMPLETE                    = 0x9117
	GL_UNSIGNALED                                    = 0x9118
	GL_SIGNALED                                      = 0x9119
	GL_ALREADY_SIGNALED                              = 0x911A
	GL_TIMEOUT_EXPIRED                               = 0x911B
	GL_CONDITION_SATISFIED                           = 0x911C
	GL_WAIT_FAILED                                   = 0x911D
	GL_SYNC_FLUSH_COMMANDS_BIT                       = 0x1
	GL_VERTEX_ATTRIB_ARRAY_DIVISOR                   = 0x88FE
	GL_ANY_SAMPLES_PASSED                            = 0x8C2F
	GL_ANY_SAMPLES_PASSED_CONSERVATIVE               = 0x8D6A
	GL_SAMPLER_BINDING                               = 0x8919
	GL_RGB10_A2UI                                    = 0x906F
	GL_INT_2_10_10_10_REV                            = 0x8D9F
	GL_RGBA32UI                                      = 0x8D70
	GL_RGB32UI                                       = 0x8D71
	GL_RGBA16UI                                      = 0x8D76
	GL_RGB16UI                                       = 0x8D77
	GL_RGBA8UI                                       = 0x8D7C
	GL_RGB8UI                                        = 0x8D7D
	GL_RGBA32I                                       = 0x8D82
	GL_RGB32I                                        = 0x8D83
	GL_RGBA16I                                       = 0x8D88
	GL_RGB16I                                        = 0x8D89
	GL_RGBA8I                                        = 0x8D8E
	GL_RGB8I                                         = 0x8D8F
	GL_RED_INTEGER                                   = 0x8D94
	GL_RGB_INTEGER                                   = 0x8D98
	GL_RGBA_INTEGER                                  = 0x8D99
	GL_SAMPLER_2D_ARRAY                              = 0x8DC1
	GL_SAMPLER_2D_ARRAY_SHADOW                       = 0x8DC4
	GL_SAMPLER_CUBE_SHADOW                           = 0x8DC5
	GL_UNSIGNED_INT_VEC2                             = 0x8DC6
	GL_UNSIGNED_INT_VEC3                             = 0x8DC7
	GL_UNSIGNED_INT_VEC4                             = 0x8DC8
	GL_INT_SAMPLER_2D                                = 0x8DCA
	GL_INT_SAMPLER_3D                                = 0x8DCB
	GL_INT_SAMPLER_CUBE                              = 0x8DCC
	GL_INT_SAMPLER_2D_ARRAY                          = 0x8DCF
	GL_UNSIGNED_INT_SAMPLER_2D                       = 0x8DD2
	GL_UNSIGNED_INT_SAMPLER_3D                       = 0x8DD3
	GL_UNSIGNED_INT_SAMPLER_CUBE                     = 0x8DD4
	GL_UNSIGNED_INT_SAMPLER_2D_ARRAY                 = 0x8DD7
	GL_DEPTH_COMPONENT32F                            = 0x8CAC
	GL_DEPTH32F_STENCIL8                             = 0x8CAD
	GL_FLOAT_32_UNSIGNED_INT_24_8_REV                = 0x8DAD
	GL_UNSIGNED_INT_24_8                             = 0x84FA
	GL_DEPTH_STENCIL_UNSIGNED_INT_24_8_WEBGL         = 0x84FA
	GL_TEXTURE_IMMUTABLE_FORMAT                      = 0x912F
	GL_TEXTURE_IMMUTABLE_LEVELS                      = 0x82DF
	GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL                 = 0x9247
	GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT                = 0x84FF
	GL_TEXTURE_MAX_ANISOTROPY_EXT                    = 0x84FE
	GL_UNMASKED_VENDOR_WEBGL                         = 0x9245
	GL_UNMASKED_RENDERER_WEBGL                       = 0x9246
	GL_MAX_DRAW_BUFFERS_WEBGL                        = 0x8824
	GL_VERTEX_ARRAY_BINDING_OES                      = 0x85B5
	GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE             = 0x88FE
	GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES           = 0x8B8B
	GL_MIN_EXT                                       = 0x8007
	GL_MAX_EXT                                       = 0x8008
	GL_SRGB_EXT                                      = 0x8C40
	GL_SRGB_ALPHA_EXT                                = 0x8C42
	GL_SRGB8_ALPHA8_EXT                              = 0x8C43
	GL_RGBA32F_EXT                                   = 0x8814
	GL_RGB32F_EXT                                    = 0x8815
	GL_RGBA16F_EXT                                   = 0x881A
	GL_RGB16F_EXT                                    = 0x881B
	GL_UNSIGNED_NORMALIZED_EXT                       = 0x8C17
	GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT     = 0x8211
	GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT     = 0x8210
	GL_UNSIGNED_INT_24_8_WEBGL                       = 0x84FA
	GL_QUERY_COUNTER_BITS_EXT                        = 0x8864
	GL_TIME_ELAPSED_EXT                              = 0x88BF
	GL_TIMESTAMP_EXT                                 = 0x8E28
	GL_GPU_DISJOINT_EXT                              = 0x8FBB
	GL_COMPLETION_STATUS_KHR                         = 0x91B1
)

Variables

View Source
var Constants1 = map[string]uint32{}/* 268 elements not displayed */

Constants1 lists constant names and values.

View Source
var Constants2 = map[string]uint32{}/* 245 elements not displayed */

Constants2 lists constant names and values.

View Source
var ExtConstants = map[string]uint32{
	"HALF_FLOAT_OES":                            0x8D61,
	"DEPTH_STENCIL_UNSIGNED_INT_24_8_WEBGL":     0x84FA,
	"MAX_TEXTURE_MAX_ANISOTROPY_EXT":            0x84FF,
	"TEXTURE_MAX_ANISOTROPY_EXT":                0x84FE,
	"UNMASKED_VENDOR_WEBGL":                     0x9245,
	"UNMASKED_RENDERER_WEBGL":                   0x9246,
	"MAX_DRAW_BUFFERS_WEBGL":                    0x8824,
	"VERTEX_ARRAY_BINDING_OES":                  0x85B5,
	"VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE":         0x88FE,
	"FRAGMENT_SHADER_DERIVATIVE_HINT_OES":       0x8B8B,
	"MIN_EXT":                                   0x8007,
	"MAX_EXT":                                   0x8008,
	"SRGB_EXT":                                  0x8C40,
	"SRGB_ALPHA_EXT":                            0x8C42,
	"SRGB8_ALPHA8_EXT":                          0x8C43,
	"RGBA32F_EXT":                               0x8814,
	"RGB32F_EXT":                                0x8815,
	"RGBA16F_EXT":                               0x881A,
	"RGB16F_EXT":                                0x881B,
	"UNSIGNED_NORMALIZED_EXT":                   0x8C17,
	"FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT": 0x8211,
	"FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT": 0x8210,
	"UNSIGNED_INT_24_8_WEBGL":                   0x84FA,
	"QUERY_COUNTER_BITS_EXT":                    0x8864,
	"TIME_ELAPSED_EXT":                          0x88BF,
	"TIMESTAMP_EXT":                             0x8E28,
	"GPU_DISJOINT_EXT":                          0x8FBB,
	"COMPLETION_STATUS_KHR":                     0x91B1,
}

ExtConstants lists constant names and values.

Functions

func UniformKind

func UniformKind(glType uint32) string

UniformInfo describes how to interpret GetUniform data.

Types

type ActiveAttrib

type ActiveAttrib struct {
	Name   string
	GLType uint32
	Size   int
	Loc    int
	Off    int
	Kind   Kind
	Lanes  int
	Cols   int
}

ActiveAttrib describes an active vertex attribute.

type Attach

type Attach struct {
	Kind  uint8 // 0 none, 1 texture, 2 renderbuffer
	Tex   *Texture
	Face  int
	Level int
	Layer int
	RB    *Renderbuffer
}

Attach is a framebuffer attachment.

type Attrib

type Attrib struct {
	Enabled    bool
	Size       int
	Type       uint32
	Normalized bool
	Integer    bool
	Stride     int
	Offset     int
	Buf        *Buffer
	Divisor    int
}

Attrib is one vertex attribute array state.

type Attrs

type Attrs struct {
	Alpha                 bool
	Depth                 bool
	Stencil               bool
	Antialias             bool
	PremultipliedAlpha    bool
	PreserveDrawingBuffer bool
}

Attrs are the WebGLContextAttributes.

type Buffer

type Buffer struct {
	ID     uint32
	Data   []byte
	Usage  uint32
	Target uint32 // first bound target (WebGL1 type rules)
	// contains filtered or unexported fields
}

Buffer is a GL buffer object.

type Class

type Class uint8

Class is the storage class of an image.

const (
	ClsU8  Class = iota // 4 bytes per texel (RGBA, normalized)
	ClsF32              // 4 float32 per texel
	ClsInt              // 4 int32 per texel (signed or unsigned bit patterns)
)

type Context

type Context struct {
	Version int
	Attrs   Attrs
	W, H    int

	// extensions enabled by the page
	Ext map[string]bool

	// limits
	Lim Limits

	// info for debug
	Stats struct{ Draws, Tris int }
	// contains filtered or unexported fields
}

Context is a WebGL rendering context.

func New

func New(version int, attrs Attrs, w, h int) *Context

New creates a context with a drawing buffer of w x h pixels.

func (*Context) ActiveTexture

func (c *Context) ActiveTexture(e uint32)

func (*Context) AttachShader

func (c *Context) AttachShader(pid, sid uint32)

func (*Context) BeginQuery

func (c *Context) BeginQuery(target, id uint32)

func (*Context) BeginTransformFeedback

func (c *Context) BeginTransformFeedback(mode uint32)

func (*Context) BindAttribLocation

func (c *Context) BindAttribLocation(pid uint32, loc int, name string)

func (*Context) BindBuffer

func (c *Context) BindBuffer(target, id uint32)

func (*Context) BindBufferBase

func (c *Context) BindBufferBase(target uint32, index int, id uint32)

func (*Context) BindBufferRange

func (c *Context) BindBufferRange(target uint32, index int, id uint32, off, size int)

BindBufferRange binds an indexed buffer target (UNIFORM_BUFFER or TRANSFORM_FEEDBACK_BUFFER).

func (*Context) BindFramebuffer

func (c *Context) BindFramebuffer(target, id uint32)

func (*Context) BindRenderbuffer

func (c *Context) BindRenderbuffer(target, id uint32)

func (*Context) BindSampler

func (c *Context) BindSampler(unit int, id uint32)

func (*Context) BindTexture

func (c *Context) BindTexture(target, id uint32)

func (*Context) BindTransformFeedback

func (c *Context) BindTransformFeedback(id uint32)

func (*Context) BindVertexArray

func (c *Context) BindVertexArray(id uint32)

func (*Context) Bitmap

func (c *Context) Bitmap() *image.RGBA

Bitmap returns the current picture for screenshots and drawImage.

func (*Context) BlendColor

func (c *Context) BlendColor(r, g, b, a float32)

func (*Context) BlendEquationSeparate

func (c *Context) BlendEquationSeparate(rgb, a uint32)

func (*Context) BlendFuncSeparate

func (c *Context) BlendFuncSeparate(sr, dr, sa, da uint32)

func (*Context) BlitFramebuffer

func (c *Context) BlitFramebuffer(sx0, sy0, sx1, sy1, dx0, dy0, dx1, dy1 int, mask uint32, filter uint32)

func (*Context) BufferData

func (c *Context) BufferData(target uint32, size int, data []byte, usage uint32)

func (*Context) BufferSubData

func (c *Context) BufferSubData(target uint32, off int, data []byte)

func (*Context) CheckFramebufferStatus

func (c *Context) CheckFramebufferStatus(target uint32) uint32

func (*Context) Clear

func (c *Context) Clear(mask uint32)

func (*Context) ClearBuffer

func (c *Context) ClearBuffer(buffer uint32, drawbuffer int, kind byte, f [4]float32, iv [4]int32)

ClearBuffer implements clearBufferfv/iv/uiv/fi. kind: 'f','i','u'.

func (*Context) ClearColor

func (c *Context) ClearColor(r, g, b, a float32)

func (*Context) ClearDepth

func (c *Context) ClearDepth(d float32)

func (*Context) ClearStencil

func (c *Context) ClearStencil(s int32)

func (*Context) ClientWaitSync

func (c *Context) ClientWaitSync(id uint32) uint32

func (*Context) ColorMask

func (c *Context) ColorMask(r, g, b, a bool)

func (*Context) CompileShader

func (c *Context) CompileShader(id uint32)

func (*Context) CopyBufferSubData

func (c *Context) CopyBufferSubData(rt, wt uint32, ro, wo, size int)

func (*Context) CopyTexImage2D

func (c *Context) CopyTexImage2D(target uint32, level int, internal uint32, x, y, w, h, border int)

CopyTexImage2D copies from the read framebuffer.

func (*Context) CopyTexSubImage2D

func (c *Context) CopyTexSubImage2D(target uint32, level, xo, yo, x, y, w, h int)

func (*Context) CopyTexSubImage3D

func (c *Context) CopyTexSubImage3D(target uint32, level, xo, yo, zo, x, y, w, h int)

func (*Context) CreateBuffer

func (c *Context) CreateBuffer() uint32

func (*Context) CreateFramebuffer

func (c *Context) CreateFramebuffer() uint32

func (*Context) CreateProgram

func (c *Context) CreateProgram() uint32

func (*Context) CreateQuery

func (c *Context) CreateQuery() uint32

func (*Context) CreateRenderbuffer

func (c *Context) CreateRenderbuffer() uint32

func (*Context) CreateSampler

func (c *Context) CreateSampler() uint32

func (*Context) CreateShader

func (c *Context) CreateShader(typ uint32) uint32

func (*Context) CreateTexture

func (c *Context) CreateTexture() uint32

func (*Context) CreateTransformFeedback

func (c *Context) CreateTransformFeedback() uint32

func (*Context) CreateVertexArray

func (c *Context) CreateVertexArray() uint32

func (*Context) CullFace

func (c *Context) CullFace(m uint32)

func (*Context) DeleteBuffer

func (c *Context) DeleteBuffer(id uint32)

func (*Context) DeleteFramebuffer

func (c *Context) DeleteFramebuffer(id uint32)

func (*Context) DeleteProgram

func (c *Context) DeleteProgram(id uint32)

func (*Context) DeleteQuery

func (c *Context) DeleteQuery(id uint32)

func (*Context) DeleteRenderbuffer

func (c *Context) DeleteRenderbuffer(id uint32)

func (*Context) DeleteSampler

func (c *Context) DeleteSampler(id uint32)

func (*Context) DeleteShader

func (c *Context) DeleteShader(id uint32)

func (*Context) DeleteSync

func (c *Context) DeleteSync(id uint32)

func (*Context) DeleteTexture

func (c *Context) DeleteTexture(id uint32)

func (*Context) DeleteTransformFeedback

func (c *Context) DeleteTransformFeedback(id uint32)

func (*Context) DeleteVertexArray

func (c *Context) DeleteVertexArray(id uint32)

func (*Context) DepthFunc

func (c *Context) DepthFunc(f uint32)

func (*Context) DepthMask

func (c *Context) DepthMask(m bool)

func (*Context) DepthRange

func (c *Context) DepthRange(n, f float32)

func (*Context) DetachShader

func (c *Context) DetachShader(pid, sid uint32)

func (*Context) DrawArrays

func (c *Context) DrawArrays(mode uint32, first, count, instances int)

DrawArrays draws count vertices starting at first.

func (*Context) DrawBuffers

func (c *Context) DrawBuffers(bufs []uint32)

func (*Context) DrawElements

func (c *Context) DrawElements(mode uint32, count int, typ uint32, off int, instances int)

DrawElements draws indexed primitives.

func (*Context) Enable

func (c *Context) Enable(cap uint32, on bool)

func (*Context) EnableVertexAttribArray

func (c *Context) EnableVertexAttribArray(idx int, on bool)

func (*Context) EndQuery

func (c *Context) EndQuery(target uint32)

func (*Context) EndTransformFeedback

func (c *Context) EndTransformFeedback()

func (*Context) FenceSync

func (c *Context) FenceSync() uint32

func (*Context) FramebufferRenderbuffer

func (c *Context) FramebufferRenderbuffer(target, att, rbTarget, id uint32)

func (*Context) FramebufferTexture2D

func (c *Context) FramebufferTexture2D(target, att, textarget, id uint32, level int)

func (*Context) FramebufferTextureLayer

func (c *Context) FramebufferTextureLayer(target, att, id uint32, level, layer int)

func (*Context) FrontFace

func (c *Context) FrontFace(m uint32)

func (*Context) GenerateMipmap

func (c *Context) GenerateMipmap(target uint32)

func (*Context) GetActiveAttrib

func (c *Context) GetActiveAttrib(pid uint32, idx int) (string, uint32, int, bool)

GetActiveAttrib returns name, type, size.

func (*Context) GetActiveUniform

func (c *Context) GetActiveUniform(pid uint32, idx int) (string, uint32, int, bool)

func (*Context) GetActiveUniformBlockName

func (c *Context) GetActiveUniformBlockName(pid uint32, idx int) string

func (*Context) GetActiveUniformBlockParameter

func (c *Context) GetActiveUniformBlockParameter(pid uint32, idx int, pname uint32) (Val, bool)

func (*Context) GetActiveUniforms

func (c *Context) GetActiveUniforms(pid uint32, idxs []uint32, pname uint32) ([]float64, bool)

func (*Context) GetAttachedShaders

func (c *Context) GetAttachedShaders(pid uint32) []uint32

func (*Context) GetAttribLocation

func (c *Context) GetAttribLocation(pid uint32, name string) int

func (*Context) GetBufferParameter

func (c *Context) GetBufferParameter(target, pname uint32) (int, bool)

func (*Context) GetBufferSubData

func (c *Context) GetBufferSubData(target uint32, off int, dst []byte)

func (*Context) GetError

func (c *Context) GetError() uint32

GetError returns and clears the error flag.

func (*Context) GetFragDataLocation

func (c *Context) GetFragDataLocation(pid uint32, name string) int

func (*Context) GetFramebufferAttachmentParameter

func (c *Context) GetFramebufferAttachmentParameter(target, att, pname uint32) (int, bool)

func (*Context) GetIndexedParameter

func (c *Context) GetIndexedParameter(p uint32, idx int) (Val, bool)

GetIndexedParameter implements getIndexedParameter.

func (*Context) GetInternalformatParameter

func (c *Context) GetInternalformatParameter(target, internal, pname uint32) ([]int32, bool)

GetInternalformatParameter returns supported sample counts.

func (*Context) GetParameter

func (c *Context) GetParameter(p uint32) (Val, bool)

GetParameter implements gl.getParameter.

func (*Context) GetProgramInfoLog

func (c *Context) GetProgramInfoLog(pid uint32) string

func (*Context) GetProgramParameter

func (c *Context) GetProgramParameter(pid uint32, pname uint32) (int, bool)

func (*Context) GetQuery

func (c *Context) GetQuery(target, pname uint32) (uint32, bool)

func (*Context) GetQueryParameter

func (c *Context) GetQueryParameter(id, pname uint32) (uint64, bool)

func (*Context) GetRenderbufferParameter

func (c *Context) GetRenderbufferParameter(target, pname uint32) (int, bool)

func (*Context) GetSamplerParameter

func (c *Context) GetSamplerParameter(id, pname uint32) (float64, bool)

func (*Context) GetShaderInfoLog

func (c *Context) GetShaderInfoLog(id uint32) string

func (*Context) GetShaderParameter

func (c *Context) GetShaderParameter(id uint32, pname uint32) (int, bool)

func (*Context) GetShaderPrecisionFormat

func (c *Context) GetShaderPrecisionFormat(shader, prec uint32) (int, int, int, bool)

GetShaderPrecisionFormat returns rangeMin, rangeMax, precision.

func (*Context) GetShaderSource

func (c *Context) GetShaderSource(id uint32) string

func (*Context) GetTexParameter

func (c *Context) GetTexParameter(target, pname uint32) (float64, bool)

func (*Context) GetTransformFeedbackVarying

func (c *Context) GetTransformFeedbackVarying(pid uint32, idx int) (string, uint32, int, bool)

func (*Context) GetUniform

func (c *Context) GetUniform(pid uint32, loc int) (vals []uint32, glType uint32, ok bool)

GetUniform returns the uniform's current lanes as raw words with its type info.

func (*Context) GetUniformBlockIndex

func (c *Context) GetUniformBlockIndex(pid uint32, name string) uint32

func (*Context) GetUniformIndices

func (c *Context) GetUniformIndices(pid uint32, names []string) []uint32

func (*Context) GetUniformLocation

func (c *Context) GetUniformLocation(pid uint32, name string) int

GetUniformLocation resolves "name", "name[i]", "s.m", "s[i].m[j]".

func (*Context) GetVertexAttrib

func (c *Context) GetVertexAttrib(idx int, pname uint32) (Val, bool)

GetVertexAttrib implements getVertexAttrib.

func (*Context) GetVertexAttribOffset

func (c *Context) GetVertexAttribOffset(idx int) int

func (*Context) Hint

func (c *Context) Hint(target, mode uint32)

func (*Context) InvalidateFramebuffer

func (c *Context) InvalidateFramebuffer(target uint32, atts []uint32)

InvalidateFramebuffer is a no-op hint.

func (*Context) IsBuffer

func (c *Context) IsBuffer(id uint32) bool

func (*Context) IsEnabled

func (c *Context) IsEnabled(cap uint32) bool

func (*Context) IsFramebuffer

func (c *Context) IsFramebuffer(id uint32) bool

func (*Context) IsProgram

func (c *Context) IsProgram(id uint32) bool

func (*Context) IsQuery

func (c *Context) IsQuery(id uint32) bool

func (*Context) IsRenderbuffer

func (c *Context) IsRenderbuffer(id uint32) bool

func (*Context) IsSampler

func (c *Context) IsSampler(id uint32) bool

func (*Context) IsShader

func (c *Context) IsShader(id uint32) bool

func (*Context) IsSync

func (c *Context) IsSync(id uint32) bool

func (*Context) IsTexture

func (c *Context) IsTexture(id uint32) bool

func (*Context) IsTransformFeedback

func (c *Context) IsTransformFeedback(id uint32) bool

func (*Context) IsVertexArray

func (c *Context) IsVertexArray(id uint32) bool

func (*Context) LineWidth

func (c *Context) LineWidth(w float32)

func (*Context) LinkProgram

func (c *Context) LinkProgram(pid uint32)

func (*Context) Lock

func (c *Context) Lock()

Lock serialises access from host calls and the compositor.

func (*Context) LoseContext

func (c *Context) LoseContext()

LoseContext marks the context lost.

func (*Context) Lost

func (c *Context) Lost() bool

Lost reports context loss.

func (*Context) PackBufferBound

func (c *Context) PackBufferBound() bool

PackBufferBound reports whether a PIXEL_PACK_BUFFER is bound.

func (*Context) PackLayout

func (c *Context) PackLayout(w int, format, typ uint32) (pb, rowStride, base int)

PackLayout returns bytes per pixel, row stride and base offset for a read.

func (*Context) PackState

func (c *Context) PackState() Pack

PackState returns the current PACK_* parameters.

func (*Context) PauseTransformFeedback

func (c *Context) PauseTransformFeedback()

func (*Context) PeekError

func (c *Context) PeekError() uint32

PeekError returns the error flag without clearing it.

func (*Context) PixelStore

func (c *Context) PixelStore(pname uint32, v int)

PixelStore sets pack/unpack state.

func (*Context) PolygonOffset

func (c *Context) PolygonOffset(f, u float32)

func (*Context) Present

func (c *Context) Present()

Present snapshots the drawing buffer for the compositor and, unless preserveDrawingBuffer is set, clears it.

func (*Context) ReadBuffer

func (c *Context) ReadBuffer(src uint32)

func (*Context) ReadExtent

func (c *Context) ReadExtent() (w, h int, ok bool)

ReadExtent returns the size of the read framebuffer's color buffer.

func (*Context) ReadPixels

func (c *Context) ReadPixels(x, y, w, h int, format, typ uint32, dst []byte, pboOff int)

ReadPixels reads the read framebuffer into dst (or the pack buffer when bound).

func (*Context) RenderbufferStorage

func (c *Context) RenderbufferStorage(target, internal uint32, w, h int, samples int)

func (*Context) Resize

func (c *Context) Resize(w, h int)

Resize reallocates the default framebuffer (contents are lost).

func (*Context) ResumeTransformFeedback

func (c *Context) ResumeTransformFeedback()

func (*Context) SampleCoverage

func (c *Context) SampleCoverage(v float32, inv bool)

func (*Context) SamplerParameter

func (c *Context) SamplerParameter(id, pname uint32, f float32)

func (*Context) Scissor

func (c *Context) Scissor(x, y, w, h int)

func (*Context) SetError

func (c *Context) SetError(e uint32)

SetError lets the host raise an error (for example INVALID_OPERATION).

func (*Context) ShaderSource

func (c *Context) ShaderSource(id uint32, src string)

func (*Context) SnapshotImage

func (c *Context) SnapshotImage() *image.RGBA

SnapshotImage resolves the default framebuffer into an RGBA image (top row first), honouring alpha and premultipliedAlpha attributes.

func (*Context) StencilFuncSeparate

func (c *Context) StencilFuncSeparate(face, fn uint32, ref int32, mask uint32)

func (*Context) StencilMaskSeparate

func (c *Context) StencilMaskSeparate(face uint32, m uint32)

func (*Context) StencilOpSeparate

func (c *Context) StencilOpSeparate(face, fail, zfail, zpass uint32)

func (*Context) SyncSignaled

func (c *Context) SyncSignaled(id uint32) bool

SyncSignaled reports a fence's status.

func (*Context) TexImage2D

func (c *Context) TexImage2D(target uint32, level int, internal uint32, w, h, border int, format, typ uint32, data []byte, pboOff int, dom bool)

TexImage2D uploads (or allocates when data is nil) a 2D / cube face level. dom marks data as RGBA8 non-premultiplied pixels from a DOM source.

func (*Context) TexImage3D

func (c *Context) TexImage3D(target uint32, level int, internal uint32, w, h, d, border int, format, typ uint32, data []byte, pboOff int)

func (*Context) TexParameter

func (c *Context) TexParameter(target, pname uint32, v float32)

func (*Context) TexStorage

func (c *Context) TexStorage(target uint32, levels int, internal uint32, w, h, d int)

func (*Context) TexSubImage2D

func (c *Context) TexSubImage2D(target uint32, level, x, y, w, h int, format, typ uint32, data []byte, pboOff int, dom bool)

func (*Context) TexSubImage3D

func (c *Context) TexSubImage3D(target uint32, level, x, y, z, w, h, d int, format, typ uint32, data []byte, pboOff int, dom bool)

func (*Context) TransformFeedbackVaryings

func (c *Context) TransformFeedbackVaryings(pid uint32, names []string, mode uint32)

func (*Context) UniformBlockBinding

func (c *Context) UniformBlockBinding(pid uint32, idx, binding int)

func (*Context) UniformF

func (c *Context) UniformF(loc int, n int, vals []float32)

UniformF sets float / vector uniforms from values (count groups of n).

func (*Context) UniformI

func (c *Context) UniformI(loc int, n int, vals []int32, unsigned bool)

UniformI sets int/bool/sampler uniforms. unsigned selects uniformNui.

func (*Context) UniformMatrix

func (c *Context) UniformMatrix(loc int, cols, rows int, transpose bool, vals []float32)

UniformMatrix sets matrix uniforms: cols x rows, transpose must be false.

func (*Context) Unlock

func (c *Context) Unlock()

func (*Context) UseProgram

func (c *Context) UseProgram(pid uint32)

func (*Context) ValidateProgram

func (c *Context) ValidateProgram(pid uint32)

func (*Context) VertexAttrib

func (c *Context) VertexAttrib(idx int, kind uint32, v [4]uint32)

VertexAttrib sets a generic attribute value (kind GL_FLOAT / GL_INT / GL_UNSIGNED_INT).

func (*Context) VertexAttribDivisor

func (c *Context) VertexAttribDivisor(idx, d int)

func (*Context) VertexAttribPointer

func (c *Context) VertexAttribPointer(idx, size int, typ uint32, norm bool, stride, off int, integer bool)

VertexAttribPointer records an attribute array.

func (*Context) Viewport

func (c *Context) Viewport(x, y, w, h int)

type Format

type Format struct {
	Internal   uint32
	Base       uint32 // RGBA RGB RG RED ALPHA LUMINANCE LUMINANCE_ALPHA DEPTH_COMPONENT DEPTH_STENCIL (+_INTEGER)
	Class      Class
	Chan       int // number of color channels present
	Bits       [4]int
	DBits      int
	SBits      int
	SRGB       bool
	Half       bool // quantize to binary16 on store
	Snorm      bool
	Unsigned   bool // integer formats: unsigned
	Integer    bool
	Float      bool
	Filterable bool
	ColorRend  bool
	DepthRend  bool
	Luminance  bool // L replicated into RGB
	AlphaOnly  bool
	BytesPerPx int // bytes of an equivalent client-side pixel (readPixels etc. not used)
	Es3Only    bool
}

Format describes a sized internal format.

func (*Format) IsColor

func (f *Format) IsColor() bool

func (*Format) IsDepth

func (f *Format) IsDepth() bool

func (*Format) IsStencil

func (f *Format) IsStencil() bool

type Framebuffer

type Framebuffer struct {
	ID          uint32
	Color       [8]Attach
	Depth       Attach
	Stencil     Attach
	DrawBuffers [8]uint32
	ReadBuffer  uint32
	// contains filtered or unexported fields
}

Framebuffer is a GL framebuffer object.

type IOVarRef

type IOVarRef struct{}

type Image

type Image struct {
	W, H, D int
	S       int // samples (1 = single sampled)
	Fmt     *Format
	U8      []uint8
	F       []float32
	I       []int32
	St      []uint8 // stencil plane (W*H*D*S)
	// contains filtered or unexported fields
}

Image is one mip level (or renderbuffer / framebuffer storage) of pixels, stored as RGBA in the format's class.

func NewImage

func NewImage(f *Format, w, h, d, samples int) *Image

NewImage allocates zeroed storage.

func (*Image) Bytes

func (im *Image) Bytes() int

Bytes returns the approximate storage size.

func (*Image) Download

func (im *Image) Download(x, y, w, h int, format, typ uint32, dst []byte, pk Pack)

Download reads a rectangle out as client pixels (format/type) with the given pack state. Only color images are supported.

func (*Image) Get

func (im *Image) Get(x, y, z int) [4]float32

Get returns the texel as normalized floats (or raw ints for integer classes via math.Float32frombits of the int).

func (*Image) Raw

func (im *Image) Raw(x, y, z int) [4]uint32

Raw returns the texel's raw 32-bit lanes (float bits for float classes).

func (*Image) Upload

func (im *Image) Upload(x, y, z, w, h, d int, format, typ uint32, src []byte, pk Pack, flipY, premul bool)

Upload copies a client pixel rectangle into the image at (x,y,z). Source rows are read bottom-to-top when flipY is set.

type Kind

type Kind uint8

Kind of attribute shader variable.

const (
	AKFloat Kind = iota
	AKInt
	AKUint
)

type Limits

type Limits struct {
	MaxTextureSize       int
	MaxCubeMapSize       int
	Max3DTextureSize     int
	MaxArrayLayers       int
	MaxRenderbufferSize  int
	MaxViewportDims      [2]int
	MaxVertexAttribs     int
	MaxVertexUniformVecs int
	MaxFragUniformVecs   int
	MaxVaryingVecs       int
	MaxTextureUnits      int
	MaxVertexTexUnits    int
	MaxCombinedTexUnits  int
	MaxDrawBuffers       int
	MaxColorAttachments  int
	MaxSamples           int
	MaxUBOBindings       int
	MaxUBOSize           int
}

Limits holds implementation limits reported through getParameter.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns SwiftShader-like limits.

type Pack

type Pack struct {
	Alignment   int
	RowLength   int
	ImageHeight int
	SkipRows    int
	SkipPixels  int
	SkipImages  int
}

Pack describes client memory layout (UNPACK_* / PACK_* state).

func (Pack) RequiredBytes

func (p Pack) RequiredBytes(w, h, d, format, typ uint32) int

RequiredBytes is the number of bytes a w*h*d upload reads.

type Program

type Program struct {
	ID        uint32
	Linked    bool
	Log       string
	Validated bool

	Attribs []ActiveAttrib
	Leaves  []*UniformLeaf

	Blocks []*UBlock
	// contains filtered or unexported fields
}

Program is a GL program object.

type Query

type Query struct {
	ID      uint32
	Target  uint32
	Result  uint64
	Active  bool
	Ready   bool
	Created bool
	// contains filtered or unexported fields
}

Query is an occlusion / any-samples-passed query.

type Renderbuffer

type Renderbuffer struct {
	ID       uint32
	Img      *Image
	Internal uint32
	W, H     int
	Samples  int
	// contains filtered or unexported fields
}

Renderbuffer is a GL renderbuffer.

type SamplerObj

type SamplerObj struct {
	ID uint32
	P  SamplerParams
	// contains filtered or unexported fields
}

SamplerObj is a WebGL2 sampler object.

type SamplerParams

type SamplerParams struct {
	MinF, MagF, WrapS, WrapT, WrapR uint32
	MinLod, MaxLod                  float32
	CmpMode, CmpFunc                uint32
}

SamplerParams holds sampler-object state (WebGL2).

type Shader

type Shader struct {
	ID       uint32
	Type     uint32
	Source   string
	Compiled *glsl.Shader
	Log      string
	OK       bool
	// contains filtered or unexported fields
}

Shader is a GL shader object.

type Sync

type Sync struct {
	ID       uint32
	Signaled bool
}

Sync is a fence object (always signalled immediately).

type Texture

type Texture struct {
	ID        uint32
	Target    uint32
	Faces     [6][]*Image
	MinF      uint32
	MagF      uint32
	WrapS     uint32
	WrapT     uint32
	WrapR     uint32
	MinLod    float32
	MaxLod    float32
	BaseLevel int
	MaxLevel  int
	CmpMode   uint32
	CmpFunc   uint32
	Aniso     float32
	Immutable bool
	ImmLevels int
	// contains filtered or unexported fields
}

Texture is a GL texture object.

type TransformFeedback

type TransformFeedback struct {
	ID      uint32
	Bufs    [4]bufBinding
	Active  bool
	Paused  bool
	Mode    uint32
	Written int
	// contains filtered or unexported fields
}

TransformFeedback is a transform feedback object.

type UBlock

type UBlock struct {
	Name     string
	Binding  int
	DataSize int
	VS, FS   int // index in shader blocks or -1
	Members  []int
	RefVS    bool
	RefFS    bool
}

UBlock is a program-level uniform block.

type UniformLeaf

type UniformLeaf struct {
	Name   string // as reported by getActiveUniform (arrays carry "[0]")
	GLType uint32
	Size   int // array length (1 for non-arrays)
	Lanes  int // lanes per element
	Store  int
	Base   int // first location
	Kind   ukind
	Array  bool
	Rows   int
	Cols   int

	Block  int // index in program blocks, -1 for default block
	Offset int // block byte offset
	Stride int // array stride (bytes)
	MatStr int
	// contains filtered or unexported fields
}

UniformLeaf is one active uniform (a basic type or array of a basic type).

type VAO

type VAO struct {
	ID      uint32
	Attribs [16]Attrib
	Element *Buffer
}

VAO is a vertex array object.

type Val

type Val struct {
	K   string // "n" number, "b" bool, "s" string, "f" float32 array, "i" int32 array, "u" uint32 array, "bv" bool array, "o" object, "null"
	N   float64
	B   bool
	S   string
	F   []float32
	I   []int32
	U   []uint32
	BV  []bool
	Obj string
	ID  uint32
}

Val is a typed result of a getter, marshalled by the host layer.

Directories

Path Synopsis
Package glsl implements a GLSL ES 1.00 / 3.00 front end (lexer, preprocessor, parser, type checker) and a closure-compiled executor for software rendering.
Package glsl implements a GLSL ES 1.00 / 3.00 front end (lexer, preprocessor, parser, type checker) and a closure-compiled executor for software rendering.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL