github.com/gop9/olt@v0.0.0-20200202132135-d956aad50b08/gio/app/internal/gl/gl.go (about)

     1  // SPDX-License-Identifier: Unlicense OR MIT
     2  
     3  package gl
     4  
     5  type (
     6  	Attrib uint
     7  	Enum   uint
     8  )
     9  
    10  const (
    11  	ARRAY_BUFFER                          = 0x8892
    12  	BLEND                                 = 0xbe2
    13  	CLAMP_TO_EDGE                         = 0x812f
    14  	COLOR_ATTACHMENT0                     = 0x8ce0
    15  	COLOR_BUFFER_BIT                      = 0x4000
    16  	COMPILE_STATUS                        = 0x8b81
    17  	DEPTH_BUFFER_BIT                      = 0x100
    18  	DEPTH_ATTACHMENT                      = 0x8d00
    19  	DEPTH_COMPONENT16                     = 0x81a5
    20  	DEPTH_TEST                            = 0xb71
    21  	DST_COLOR                             = 0x306
    22  	ELEMENT_ARRAY_BUFFER                  = 0x8893
    23  	EXTENSIONS                            = 0x1f03
    24  	FLOAT                                 = 0x1406
    25  	FRAGMENT_SHADER                       = 0x8b30
    26  	FRAMEBUFFER                           = 0x8d40
    27  	FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210
    28  	FRAMEBUFFER_BINDING                   = 0x8ca6
    29  	FRAMEBUFFER_COMPLETE                  = 0x8cd5
    30  	HALF_FLOAT                            = 0x140b
    31  	HALF_FLOAT_OES                        = 0x8d61
    32  	INFO_LOG_LENGTH                       = 0x8B84
    33  	GREATER                               = 0x204
    34  	LINEAR                                = 0x2601
    35  	LINK_STATUS                           = 0x8b82
    36  	LUMINANCE                             = 0x1909
    37  	MAX_TEXTURE_SIZE                      = 0xd33
    38  	NEAREST                               = 0x2600
    39  	NO_ERROR                              = 0x0
    40  	NUM_EXTENSIONS                        = 0x821D
    41  	ONE                                   = 0x1
    42  	ONE_MINUS_SRC_ALPHA                   = 0x303
    43  	QUERY_RESULT                          = 0x8866
    44  	QUERY_RESULT_AVAILABLE                = 0x8867
    45  	R16F                                  = 0x822d
    46  	R8                                    = 0x8229
    47  	READ_FRAMEBUFFER                      = 0x8ca8
    48  	RED                                   = 0x1903
    49  	RENDERER                              = 0x1F01
    50  	RENDERBUFFER                          = 0x8d41
    51  	RENDERBUFFER_BINDING                  = 0x8ca7
    52  	RENDERBUFFER_HEIGHT                   = 0x8d43
    53  	RENDERBUFFER_WIDTH                    = 0x8d42
    54  	RGB                                   = 0x1907
    55  	RGBA                                  = 0x1908
    56  	RGBA8                                 = 0x8058
    57  	SHORT                                 = 0x1402
    58  	SRGB                                  = 0x8c40
    59  	SRGB_ALPHA_EXT                        = 0x8c42
    60  	SRGB8                                 = 0x8c41
    61  	SRGB8_ALPHA8                          = 0x8c43
    62  	STATIC_DRAW                           = 0x88e4
    63  	TEXTURE_2D                            = 0xde1
    64  	TEXTURE_MAG_FILTER                    = 0x2800
    65  	TEXTURE_MIN_FILTER                    = 0x2801
    66  	TEXTURE_WRAP_S                        = 0x2802
    67  	TEXTURE_WRAP_T                        = 0x2803
    68  	TEXTURE0                              = 0x84c0
    69  	TEXTURE1                              = 0x84c1
    70  	TRIANGLE_STRIP                        = 0x5
    71  	TRIANGLES                             = 0x4
    72  	UNPACK_ALIGNMENT                      = 0xcf5
    73  	UNSIGNED_BYTE                         = 0x1401
    74  	UNSIGNED_SHORT                        = 0x1403
    75  	VERSION                               = 0x1f02
    76  	VERTEX_SHADER                         = 0x8b31
    77  	ZERO                                  = 0x0
    78  
    79  	// EXT_disjoint_timer_query
    80  	TIME_ELAPSED_EXT = 0x88BF
    81  	GPU_DISJOINT_EXT = 0x8FBB
    82  )
    83  
    84  // Enforce Functions interface.
    85  var _ interface {
    86  	ActiveTexture(texture Enum)
    87  	AttachShader(p Program, s Shader)
    88  	BeginQuery(target Enum, query Query)
    89  	BindAttribLocation(p Program, a Attrib, name string)
    90  	BindBuffer(target Enum, b Buffer)
    91  	BindFramebuffer(target Enum, fb Framebuffer)
    92  	BindRenderbuffer(target Enum, rb Renderbuffer)
    93  	BindTexture(target Enum, t Texture)
    94  	BlendEquation(mode Enum)
    95  	BlendFunc(sfactor, dfactor Enum)
    96  	BufferData(target Enum, src []byte, usage Enum)
    97  	CheckFramebufferStatus(target Enum) Enum
    98  	Clear(mask Enum)
    99  	ClearColor(red, green, blue, alpha float32)
   100  	ClearDepthf(d float32)
   101  	CompileShader(s Shader)
   102  	CreateBuffer() Buffer
   103  	CreateFramebuffer() Framebuffer
   104  	CreateProgram() Program
   105  	CreateQuery() Query
   106  	CreateRenderbuffer() Renderbuffer
   107  	CreateShader(ty Enum) Shader
   108  	CreateTexture() Texture
   109  	DeleteBuffer(v Buffer)
   110  	DeleteFramebuffer(v Framebuffer)
   111  	DeleteProgram(p Program)
   112  	DeleteQuery(query Query)
   113  	DeleteRenderbuffer(v Renderbuffer)
   114  	DeleteShader(s Shader)
   115  	DeleteTexture(v Texture)
   116  	DepthFunc(f Enum)
   117  	DepthMask(mask bool)
   118  	DisableVertexAttribArray(a Attrib)
   119  	Disable(cap Enum)
   120  	DrawArrays(mode Enum, first, count int)
   121  	DrawElements(mode Enum, count int, ty Enum, offset int)
   122  	Enable(cap Enum)
   123  	EnableVertexAttribArray(a Attrib)
   124  	EndQuery(target Enum)
   125  	Finish()
   126  	FramebufferRenderbuffer(target, attachment, renderbuffertarget Enum, renderbuffer Renderbuffer)
   127  	FramebufferTexture2D(target, attachment, texTarget Enum, t Texture, level int)
   128  	GetBinding(pname Enum) Object
   129  	GetError() Enum
   130  	GetRenderbufferParameteri(target, pname Enum) int
   131  	GetFramebufferAttachmentParameteri(target, attachment, pname Enum) int
   132  	GetInteger(pname Enum) int
   133  	GetProgrami(p Program, pname Enum) int
   134  	GetProgramInfoLog(p Program) string
   135  	GetQueryObjectuiv(query Query, pname Enum) uint
   136  	GetShaderi(s Shader, pname Enum) int
   137  	GetShaderInfoLog(s Shader) string
   138  	GetString(pname Enum) string
   139  	GetUniformLocation(p Program, name string) Uniform
   140  	InvalidateFramebuffer(target, attachment Enum)
   141  	LinkProgram(p Program)
   142  	PixelStorei(pname Enum, param int32)
   143  	RenderbufferStorage(target, internalformat Enum, width, height int)
   144  	Scissor(x, y, width, height int32)
   145  	ShaderSource(s Shader, src string)
   146  	TexImage2D(target Enum, level int, internalFormat int, width, height int, format, ty Enum, data []byte)
   147  	TexSubImage2D(target Enum, level int, x, y, width, height int, format, ty Enum, data []byte)
   148  	TexParameteri(target, pname Enum, param int)
   149  	Uniform1f(dst Uniform, v float32)
   150  	Uniform1i(dst Uniform, v int)
   151  	Uniform2f(dst Uniform, v0, v1 float32)
   152  	Uniform3f(dst Uniform, v0, v1, v2 float32)
   153  	Uniform4f(dst Uniform, v0, v1, v2, v3 float32)
   154  	UseProgram(p Program)
   155  	VertexAttribPointer(dst Attrib, size int, ty Enum, normalized bool, stride, offset int)
   156  	Viewport(x, y, width, height int)
   157  } = (*Functions)(nil)