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