gl

package
v0.0.0-...-793ea6c Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package gl implements Go bindings to OpenGL.

This package was automatically generated using Glow:

http://github.com/go-gl/glow

Generated based on the OpenGL XML specification:

SVN revision 27695

This file implements GlowGetProcAddress for every supported platform. The correct version is chosen automatically based on build tags: windows: WGL darwin: CGL linux: GLX Use of EGL instead of the platform's default (listed above) is made possible via the "egl" build tag. It is also possible to install your own function outside this package for retrieving OpenGL function pointers, to do this see InitWithProcAddrFunc.

Index

Constants

View Source
const (
	ALPHA_BITS                                = 0x0D55
	ALWAYS                                    = 0x0207
	ARRAY_BUFFER                              = 0x8892
	BACK                                      = 0x0405
	BGRA                                      = 0x80E1
	BLEND                                     = 0x0BE2
	BLEND_COLOR                               = 0x8005
	BLEND_DST_ALPHA                           = 0x80CA
	BLEND_DST_RGB                             = 0x80C8
	BLEND_EQUATION_ALPHA                      = 0x883D
	BLEND_EQUATION_RGB                        = 0x8009
	BLEND_SRC_ALPHA                           = 0x80CB
	BLEND_SRC_RGB                             = 0x80C9
	BLUE_BITS                                 = 0x0D54
	CLAMP_TO_BORDER                           = 0x812D
	CLAMP_TO_EDGE                             = 0x812F
	COLOR_ATTACHMENT0                         = 0x8CE0
	COLOR_BUFFER_BIT                          = 0x00004000
	COLOR_CLEAR_VALUE                         = 0x0C22
	COLOR_WRITEMASK                           = 0x0C23
	COMPILE_STATUS                            = 0x8B81
	COMPRESSED_TEXTURE_FORMATS                = 0x86A3
	CONSTANT_ALPHA                            = 0x8003
	CONSTANT_COLOR                            = 0x8001
	CULL_FACE                                 = 0x0B44
	CULL_FACE_MODE                            = 0x0B45
	CURRENT_PROGRAM                           = 0x8B8D
	DEBUG_OUTPUT_SYNCHRONOUS_ARB              = 0x8242
	DEBUG_SEVERITY_HIGH                       = 0x9146
	DEBUG_SEVERITY_LOW                        = 0x9148
	DEBUG_SEVERITY_MEDIUM                     = 0x9147
	DEBUG_TYPE_DEPRECATED_BEHAVIOR            = 0x824D
	DEBUG_TYPE_ERROR                          = 0x824C
	DEBUG_TYPE_OTHER                          = 0x8251
	DEBUG_TYPE_PERFORMANCE                    = 0x8250
	DEBUG_TYPE_PORTABILITY                    = 0x824F
	DEBUG_TYPE_UNDEFINED_BEHAVIOR             = 0x824E
	DECR                                      = 0x1E03
	DECR_WRAP                                 = 0x8508
	DEPTH24_STENCIL8                          = 0x88F0
	DEPTH_ATTACHMENT                          = 0x8D00
	DEPTH_BITS                                = 0x0D56
	DEPTH_BUFFER_BIT                          = 0x00000100
	DEPTH_CLAMP                               = 0x864F
	DEPTH_CLEAR_VALUE                         = 0x0B73
	DEPTH_COMPONENT                           = 0x1902
	DEPTH_COMPONENT16                         = 0x81A5
	DEPTH_COMPONENT24                         = 0x81A6
	DEPTH_COMPONENT32                         = 0x81A7
	DEPTH_FUNC                                = 0x0B74
	DEPTH_TEST                                = 0x0B71
	DEPTH_WRITEMASK                           = 0x0B72
	DITHER                                    = 0x0BD0
	DST_ALPHA                                 = 0x0304
	DST_COLOR                                 = 0x0306
	DYNAMIC_DRAW                              = 0x88E8
	ELEMENT_ARRAY_BUFFER                      = 0x8893
	EQUAL                                     = 0x0202
	EXTENSIONS                                = 0x1F03
	FLOAT                                     = 0x1406
	FRAGMENT_SHADER                           = 0x8B30
	FRAMEBUFFER                               = 0x8D40
	FRAMEBUFFER_COMPLETE                      = 0x8CD5
	FRAMEBUFFER_INCOMPLETE_ATTACHMENT         = 0x8CD6
	FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER        = 0x8CDB
	FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7
	FRAMEBUFFER_INCOMPLETE_MULTISAMPLE        = 0x8D56
	FRAMEBUFFER_INCOMPLETE_READ_BUFFER        = 0x8CDC
	FRAMEBUFFER_UNDEFINED                     = 0x8219
	FRAMEBUFFER_UNSUPPORTED                   = 0x8CDD
	FRONT                                     = 0x0404
	FRONT_AND_BACK                            = 0x0408
	FUNC_ADD                                  = 0x8006
	FUNC_REVERSE_SUBTRACT                     = 0x800B
	FUNC_SUBTRACT                             = 0x800A
	GENERATE_MIPMAP                           = 0x8191
	GEQUAL                                    = 0x0206
	GREATER                                   = 0x0204
	GREEN_BITS                                = 0x0D53
	INCR                                      = 0x1E02
	INCR_WRAP                                 = 0x8507
	INFO_LOG_LENGTH                           = 0x8B84
	INVALID_ENUM                              = 0x0500
	INVALID_FRAMEBUFFER_OPERATION             = 0x0506
	INVALID_OPERATION                         = 0x0502
	INVALID_VALUE                             = 0x0501
	INVERT                                    = 0x150A
	KEEP                                      = 0x1E00
	LEQUAL                                    = 0x0203
	LESS                                      = 0x0201
	LINEAR                                    = 0x2601
	LINEAR_MIPMAP_LINEAR                      = 0x2703
	LINEAR_MIPMAP_NEAREST                     = 0x2701
	LINES                                     = 0x0001
	LINK_STATUS                               = 0x8B82
	MAX_FRAGMENT_UNIFORM_COMPONENTS           = 0x8B49
	MAX_FRAGMENT_UNIFORM_VECTORS              = 0x8DFD
	MAX_SAMPLES                               = 0x8D57
	MAX_TEXTURE_SIZE                          = 0x0D33
	MAX_VARYING_FLOATS                        = 0x8B4B
	MAX_VARYING_VECTORS                       = 0x8DFC
	MAX_VERTEX_UNIFORM_COMPONENTS             = 0x8B4A
	MAX_VERTEX_UNIFORM_VECTORS                = 0x8DFB
	MIRRORED_REPEAT                           = 0x8370
	MULTISAMPLE                               = 0x809D
	NEAREST                                   = 0x2600
	NEAREST_MIPMAP_LINEAR                     = 0x2702
	NEAREST_MIPMAP_NEAREST                    = 0x2700
	NEVER                                     = 0x0200
	NOTEQUAL                                  = 0x0205
	NO_ERROR                                  = 0
	NUM_COMPRESSED_TEXTURE_FORMATS            = 0x86A2
	ONE                                       = 1
	ONE_MINUS_CONSTANT_ALPHA                  = 0x8004
	ONE_MINUS_CONSTANT_COLOR                  = 0x8002
	ONE_MINUS_DST_ALPHA                       = 0x0305
	ONE_MINUS_DST_COLOR                       = 0x0307
	ONE_MINUS_SRC_ALPHA                       = 0x0303
	ONE_MINUS_SRC_COLOR                       = 0x0301
	OUT_OF_MEMORY                             = 0x0505
	POINTS                                    = 0x0000
	PROGRAM_POINT_SIZE_EXT                    = 0x8642
	QUERY_COUNTER_BITS                        = 0x8864
	QUERY_RESULT                              = 0x8866
	QUERY_RESULT_AVAILABLE                    = 0x8867
	RED_BITS                                  = 0x0D52
	RENDERBUFFER                              = 0x8D41
	RENDERER                                  = 0x1F01
	REPEAT                                    = 0x2901
	REPLACE                                   = 0x1E01
	RGB                                       = 0x1907
	RGB8                                      = 0x8051
	RGBA                                      = 0x1908
	RGBA8                                     = 0x8058
	SAMPLES                                   = 0x80A9
	SAMPLES_PASSED                            = 0x8914
	SAMPLE_ALPHA_TO_COVERAGE                  = 0x809E
	SAMPLE_BUFFERS                            = 0x80A8
	SCISSOR_BOX                               = 0x0C10
	SCISSOR_TEST                              = 0x0C11
	SHADING_LANGUAGE_VERSION                  = 0x8B8C
	SRC_ALPHA                                 = 0x0302
	SRC_ALPHA_SATURATE                        = 0x0308
	SRC_COLOR                                 = 0x0300
	STACK_OVERFLOW                            = 0x0503
	STACK_UNDERFLOW                           = 0x0504
	STATIC_DRAW                               = 0x88E4
	STENCIL_ATTACHMENT                        = 0x8D20
	STENCIL_BACK_FAIL                         = 0x8801
	STENCIL_BACK_FUNC                         = 0x8800
	STENCIL_BACK_PASS_DEPTH_FAIL              = 0x8802
	STENCIL_BACK_PASS_DEPTH_PASS              = 0x8803
	STENCIL_BACK_REF                          = 0x8CA3
	STENCIL_BACK_VALUE_MASK                   = 0x8CA4
	STENCIL_BACK_WRITEMASK                    = 0x8CA5
	STENCIL_BITS                              = 0x0D57
	STENCIL_BUFFER_BIT                        = 0x00000400
	STENCIL_CLEAR_VALUE                       = 0x0B91
	STENCIL_FAIL                              = 0x0B94
	STENCIL_FUNC                              = 0x0B92
	STENCIL_PASS_DEPTH_FAIL                   = 0x0B95
	STENCIL_PASS_DEPTH_PASS                   = 0x0B96
	STENCIL_REF                               = 0x0B97
	STENCIL_TEST                              = 0x0B90
	STENCIL_VALUE_MASK                        = 0x0B93
	STENCIL_WRITEMASK                         = 0x0B98
	TEXTURE0                                  = 0x84C0
	TEXTURE_2D                                = 0x0DE1
	TEXTURE_BASE_LEVEL                        = 0x813C
	TEXTURE_BORDER_COLOR                      = 0x1004
	TEXTURE_MAG_FILTER                        = 0x2800
	TEXTURE_MAX_LEVEL                         = 0x813D
	TEXTURE_MIN_FILTER                        = 0x2801
	TEXTURE_WRAP_S                            = 0x2802
	TEXTURE_WRAP_T                            = 0x2803
	TRIANGLES                                 = 0x0004
	TRUE                                      = 1
	UNSIGNED_BYTE                             = 0x1401
	UNSIGNED_INT                              = 0x1405
	VENDOR                                    = 0x1F00
	VERSION                                   = 0x1F02
	VERTEX_SHADER                             = 0x8B31
	VIEWPORT                                  = 0x0BA2
	ZERO                                      = 0
)

Variables

This section is empty.

Functions

func ActiveTexture

func ActiveTexture(texture uint32)

select active texture unit

func AttachShader

func AttachShader(program uint32, shader uint32)

Attaches a shader object to a program object

func BeginQuery

func BeginQuery(target uint32, id uint32)

delimit the boundaries of a query object

func BindBuffer

func BindBuffer(target uint32, buffer uint32)

bind a named buffer object

func BindFramebuffer

func BindFramebuffer(target uint32, framebuffer uint32)

bind a framebuffer to a framebuffer target

func BindRenderbuffer

func BindRenderbuffer(target uint32, renderbuffer uint32)

bind a renderbuffer to a renderbuffer target

func BindTexture

func BindTexture(target uint32, texture uint32)

bind a named texture to a texturing target

func BlendColor

func BlendColor(red float32, green float32, blue float32, alpha float32)

set the blend color

func BlendEquationSeparate

func BlendEquationSeparate(modeRGB uint32, modeAlpha uint32)

set the RGB blend equation and the alpha blend equation separately

func BlendFuncSeparate

func BlendFuncSeparate(sfactorRGB uint32, dfactorRGB uint32, sfactorAlpha uint32, dfactorAlpha uint32)

specify pixel arithmetic for RGB and alpha components separately

func BufferData

func BufferData(target uint32, size int, data unsafe.Pointer, usage uint32)

creates and initializes a buffer object's data store

func CheckFramebufferStatus

func CheckFramebufferStatus(target uint32) uint32

check the completeness status of a framebuffer

func Clear

func Clear(mask uint32)

clear buffers to preset values

func ClearColor

func ClearColor(red float32, green float32, blue float32, alpha float32)

specify clear values for the color buffers

func ClearDepth

func ClearDepth(depth float64)

specify the clear value for the depth buffer

func ClearDepthf

func ClearDepthf(d float32)

func ClearStencil

func ClearStencil(s int32)

specify the clear value for the stencil buffer

func ColorMask

func ColorMask(red bool, green bool, blue bool, alpha bool)

func CompileShader

func CompileShader(shader uint32)

Compiles a shader object

func CreateProgram

func CreateProgram() uint32

Creates a program object

func CreateShader

func CreateShader(xtype uint32) uint32

Creates a shader object

func CullFace

func CullFace(mode uint32)

specify whether front- or back-facing facets can be culled

func DebugMessageCallbackARB

func DebugMessageCallbackARB(callback DebugProc, userParam unsafe.Pointer)

func DeleteBuffers

func DeleteBuffers(n int32, buffers *uint32)

delete named buffer objects

func DeleteFramebuffers

func DeleteFramebuffers(n int32, framebuffers *uint32)

delete framebuffer objects

func DeleteProgram

func DeleteProgram(program uint32)

Deletes a program object

func DeleteQueries

func DeleteQueries(n int32, ids *uint32)

delete named query objects

func DeleteRenderbuffers

func DeleteRenderbuffers(n int32, renderbuffers *uint32)

delete renderbuffer objects

func DeleteShader

func DeleteShader(shader uint32)

Deletes a shader object

func DeleteTextures

func DeleteTextures(n int32, textures *uint32)

delete named textures

func DepthFunc

func DepthFunc(xfunc uint32)

specify the value used for depth buffer comparisons

func DepthMask

func DepthMask(flag bool)

enable or disable writing into the depth buffer

func Disable

func Disable(cap uint32)

func DisableVertexAttribArray

func DisableVertexAttribArray(index uint32)

Enable or disable a generic vertex attribute array

func DrawArrays

func DrawArrays(mode uint32, first int32, count int32)

render primitives from array data

func DrawElements

func DrawElements(mode uint32, count int32, xtype uint32, indices unsafe.Pointer)

render primitives from array data

func Enable

func Enable(cap uint32)

enable or disable server-side GL capabilities

func EnableVertexAttribArray

func EnableVertexAttribArray(index uint32)

Enable or disable a generic vertex attribute array

func EndQuery

func EndQuery(target uint32)

func Finish

func Finish()

block until all GL execution is complete

func Flush

func Flush()

force execution of GL commands in finite time

func FramebufferRenderbuffer

func FramebufferRenderbuffer(target uint32, attachment uint32, renderbuffertarget uint32, renderbuffer uint32)

attach a renderbuffer as a logical buffer of a framebuffer object

func FramebufferTexture2D

func FramebufferTexture2D(target uint32, attachment uint32, textarget uint32, texture uint32, level int32)

func GenBuffers

func GenBuffers(n int32, buffers *uint32)

generate buffer object names

func GenFramebuffers

func GenFramebuffers(n int32, framebuffers *uint32)

generate framebuffer object names

func GenQueries

func GenQueries(n int32, ids *uint32)

generate query object names

func GenRenderbuffers

func GenRenderbuffers(n int32, renderbuffers *uint32)

generate renderbuffer object names

func GenTextures

func GenTextures(n int32, textures *uint32)

generate texture names

func GenerateMipmap

func GenerateMipmap(target uint32)

generate mipmaps for a specified texture object

func GetAttribLocation

func GetAttribLocation(program uint32, name *uint8) int32

Returns the location of an attribute variable

func GetBooleanv

func GetBooleanv(pname uint32, data *bool)

func GetDoublev

func GetDoublev(pname uint32, data *float64)

func GetError

func GetError() uint32

return error information

func GetFloatv

func GetFloatv(pname uint32, data *float32)

func GetIntegerv

func GetIntegerv(pname uint32, data *int32)

func GetProgramInfoLog

func GetProgramInfoLog(program uint32, bufSize int32, length *int32, infoLog *uint8)

Returns the information log for a program object

func GetProgramiv

func GetProgramiv(program uint32, pname uint32, params *int32)

Returns a parameter from a program object

func GetQueryObjectiv

func GetQueryObjectiv(id uint32, pname uint32, params *int32)

func GetQueryiv

func GetQueryiv(target uint32, pname uint32, params *int32)

return parameters of a query object target

func GetShaderInfoLog

func GetShaderInfoLog(shader uint32, bufSize int32, length *int32, infoLog *uint8)

Returns the information log for a shader object

func GetShaderiv

func GetShaderiv(shader uint32, pname uint32, params *int32)

Returns a parameter from a shader object

func GetString

func GetString(name uint32) *uint8

return a string describing the current GL connection

func GetUniformLocation

func GetUniformLocation(program uint32, name *uint8) int32

Returns the location of a uniform variable

func GoStr

func GoStr(cstr *uint8) string

GoStr takes a null-terminated string returned by OpenGL and constructs a corresponding Go string.

func Init

func Init() error

func InitWithProcAddrFunc

func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error

InitWithProcAddrFunc intializes the package using the specified OpenGL function pointer loading function. For more cases Init should be used instead.

func LinkProgram

func LinkProgram(program uint32)

Links a program object

func Ptr

func Ptr(data interface{}) unsafe.Pointer

Ptr takes a slice or pointer (to a singular scalar value or the first element of an array or slice) and returns its GL-compatible address.

func PtrOffset

func PtrOffset(offset int) unsafe.Pointer

PtrOffset takes a pointer offset and returns a GL-compatible pointer. Useful for functions such as glVertexAttribPointer that take pointer parameters indicating an offset rather than an absolute memory address.

func ReadPixels

func ReadPixels(x int32, y int32, width int32, height int32, format uint32, xtype uint32, pixels unsafe.Pointer)

read a block of pixels from the frame buffer

func RenderbufferStorageMultisample

func RenderbufferStorageMultisample(target uint32, samples int32, internalformat uint32, width int32, height int32)

establish data storage, format, dimensions and sample count of a renderbuffer object's image

func Scissor

func Scissor(x int32, y int32, width int32, height int32)

define the scissor box

func ShaderSource

func ShaderSource(shader uint32, count int32, xstring **uint8, length *int32)

Replaces the source code in a shader object

func StencilFuncSeparate

func StencilFuncSeparate(face uint32, xfunc uint32, ref int32, mask uint32)

set front and/or back function and reference value for stencil testing

func StencilMaskSeparate

func StencilMaskSeparate(face uint32, mask uint32)

control the front and/or back writing of individual bits in the stencil planes

func StencilOpSeparate

func StencilOpSeparate(face uint32, sfail uint32, dpfail uint32, dppass uint32)

set front and/or back stencil test actions

func Str

func Str(str string) *uint8

Str takes a null-terminated Go string and returns its GL-compatible address. This function reaches into Go string storage in an unsafe way so the caller must ensure the string is not garbage collected.

func Strs

func Strs(strs ...string) (cstrs **uint8, free func())

Strs takes a list of null-terminated Go strings and return's their C counterpart.

The returned free function must be called once you are done using the strings in order to free the memory.

If no strings are provided as a parameter, or if any string is not null-terminated, this function will panic.

func TexImage2D

func TexImage2D(target uint32, level int32, internalformat int32, width int32, height int32, border int32, format uint32, xtype uint32, pixels unsafe.Pointer)

specify a two-dimensional texture image

func TexParameterfv

func TexParameterfv(target uint32, pname uint32, params *float32)

func TexParameteri

func TexParameteri(target uint32, pname uint32, param int32)

func Uniform1fv

func Uniform1fv(location int32, count int32, value *float32)

Specify the value of a uniform variable for the current program object

func Uniform1i

func Uniform1i(location int32, v0 int32)

Specify the value of a uniform variable for the current program object

func Uniform1iv

func Uniform1iv(location int32, count int32, value *int32)

Specify the value of a uniform variable for the current program object

func Uniform2fv

func Uniform2fv(location int32, count int32, value *float32)

Specify the value of a uniform variable for the current program object

func Uniform3fv

func Uniform3fv(location int32, count int32, value *float32)

Specify the value of a uniform variable for the current program object

func Uniform4fv

func Uniform4fv(location int32, count int32, value *float32)

Specify the value of a uniform variable for the current program object

func UniformMatrix4fv

func UniformMatrix4fv(location int32, count int32, transpose bool, value *float32)

Specify the value of a uniform variable for the current program object

func UseProgram

func UseProgram(program uint32)

Installs a program object as part of current rendering state

func VertexAttribPointer

func VertexAttribPointer(index uint32, size int32, xtype uint32, normalized bool, stride int32, pointer unsafe.Pointer)

define an array of generic vertex attribute data

func Viewport

func Viewport(x int32, y int32, width int32, height int32)

set the viewport

Types

type DebugProc

type DebugProc func(
	source uint32,
	gltype uint32,
	id uint32,
	severity uint32,
	length int32,
	message string,
	userParam unsafe.Pointer)

Jump to

Keyboard shortcuts

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