gl

package
v0.25.6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package gl provides OpenGL constants and types for the GLES backend.

Package gl provides low-level OpenGL function bindings using syscall.

This package is used internally by the GLES HAL backend. It loads OpenGL functions at runtime via wglGetProcAddress (Windows) or platform-specific loaders.

Usage

The Context type holds function pointers loaded at runtime:

ctx := &gl.Context{}
ctx.Load(wgl.GetGLProcAddress)
ctx.ClearColor(0.2, 0.3, 0.3, 1.0)
ctx.Clear(gl.COLOR_BUFFER_BIT)

Index

Constants

View Source
const (
	// Boolean values
	FALSE = 0
	TRUE  = 1

	// Data types
	BYTE              = 0x1400
	UNSIGNED_BYTE     = 0x1401
	SHORT             = 0x1402
	UNSIGNED_SHORT    = 0x1403
	INT               = 0x1404
	UNSIGNED_INT      = 0x1405
	FLOAT             = 0x1406
	HALF_FLOAT        = 0x140B
	UNSIGNED_INT_24_8 = 0x84FA

	// Errors
	NO_ERROR                      = 0
	INVALID_ENUM                  = 0x0500
	INVALID_VALUE                 = 0x0501
	INVALID_OPERATION             = 0x0502
	OUT_OF_MEMORY                 = 0x0505
	INVALID_FRAMEBUFFER_OPERATION = 0x0506

	// Capabilities
	BLEND        = 0x0BE2
	CULL_FACE    = 0x0B44
	DEPTH_TEST   = 0x0B71
	DITHER       = 0x0BD0
	SCISSOR_TEST = 0x0C11
	STENCIL_TEST = 0x0B90

	// Buffer targets
	ARRAY_BUFFER              = 0x8892
	ELEMENT_ARRAY_BUFFER      = 0x8893
	UNIFORM_BUFFER            = 0x8A11
	COPY_READ_BUFFER          = 0x8F36
	COPY_WRITE_BUFFER         = 0x8F37
	PIXEL_PACK_BUFFER         = 0x88EB
	PIXEL_UNPACK_BUFFER       = 0x88EC
	TRANSFORM_FEEDBACK_BUFFER = 0x8C8E

	// Buffer access modes
	READ_ONLY  = 0x88B8
	WRITE_ONLY = 0x88B9
	READ_WRITE = 0x88BA

	// Buffer usage
	STREAM_DRAW  = 0x88E0
	STREAM_READ  = 0x88E1
	STREAM_COPY  = 0x88E2
	STATIC_DRAW  = 0x88E4
	STATIC_READ  = 0x88E5
	STATIC_COPY  = 0x88E6
	DYNAMIC_DRAW = 0x88E8
	DYNAMIC_READ = 0x88E9
	DYNAMIC_COPY = 0x88EA

	// Texture units
	TEXTURE0 = 0x84C0

	// Texture targets
	TEXTURE_2D                  = 0x0DE1
	TEXTURE_3D                  = 0x806F
	TEXTURE_2D_ARRAY            = 0x8C1A
	TEXTURE_2D_MULTISAMPLE      = 0x9100
	TEXTURE_CUBE_MAP            = 0x8513
	TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515
	TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516
	TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517
	TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518
	TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519
	TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A

	// Texture parameters
	TEXTURE_MAG_FILTER     = 0x2800
	TEXTURE_MIN_FILTER     = 0x2801
	TEXTURE_WRAP_S         = 0x2802
	TEXTURE_WRAP_T         = 0x2803
	TEXTURE_WRAP_R         = 0x8072
	TEXTURE_MIN_LOD        = 0x813A
	TEXTURE_MAX_LOD        = 0x813B
	TEXTURE_COMPARE_MODE   = 0x884C
	TEXTURE_COMPARE_FUNC   = 0x884D
	COMPARE_REF_TO_TEXTURE = 0x884E
	TEXTURE_BASE_LEVEL     = 0x813C
	TEXTURE_MAX_LEVEL      = 0x813D
	TEXTURE_MAX_ANISOTROPY = 0x84FE

	// Texture filter modes
	NEAREST                = 0x2600
	LINEAR                 = 0x2601
	NEAREST_MIPMAP_NEAREST = 0x2700
	LINEAR_MIPMAP_NEAREST  = 0x2701
	NEAREST_MIPMAP_LINEAR  = 0x2702
	LINEAR_MIPMAP_LINEAR   = 0x2703

	// Texture wrap modes
	REPEAT          = 0x2901
	CLAMP_TO_EDGE   = 0x812F
	MIRRORED_REPEAT = 0x8370

	// Pixel formats
	DEPTH_COMPONENT   = 0x1902
	RED               = 0x1903
	RG                = 0x8227
	RGB               = 0x1907
	RGBA              = 0x1908
	DEPTH_STENCIL     = 0x84F9
	RED_INTEGER       = 0x8D94
	RG_INTEGER        = 0x8228
	RGB_INTEGER       = 0x8D98
	RGBA_INTEGER      = 0x8D99
	BGRA              = 0x80E1
	DEPTH_COMPONENT16 = 0x81A5
	DEPTH_COMPONENT24 = 0x81A6
	DEPTH_COMPONENT32 = 0x81A7
	DEPTH24_STENCIL8  = 0x88F0

	// Internal formats
	R8                = 0x8229
	R16F              = 0x822D
	R32F              = 0x822E
	RG8               = 0x822B
	RG16F             = 0x822F
	RG32F             = 0x8230
	RGB8              = 0x8051
	RGBA8             = 0x8058
	SRGB8             = 0x8C41
	SRGB8_ALPHA8      = 0x8C43
	RGB16F            = 0x881B
	RGBA16F           = 0x881A
	RGB32F            = 0x8815
	RGBA32F           = 0x8814
	R8I               = 0x8231
	R8UI              = 0x8232
	R16I              = 0x8233
	R16UI             = 0x8234
	R32I              = 0x8235
	R32UI             = 0x8236
	RG8I              = 0x8237
	RG8UI             = 0x8238
	RG16I             = 0x8239
	RG16UI            = 0x823A
	RG32I             = 0x823B
	RG32UI            = 0x823C
	RGBA8I            = 0x8D8E
	RGBA8UI           = 0x8D7C
	RGBA16I           = 0x8D88
	RGBA16UI          = 0x8D76
	RGBA32I           = 0x8D82
	RGBA32UI          = 0x8D70
	DEPTH32F_STENCIL8 = 0x8CAD

	// Shader types
	FRAGMENT_SHADER = 0x8B30
	VERTEX_SHADER   = 0x8B31
	COMPUTE_SHADER  = 0x91B9

	// Shader parameters
	COMPILE_STATUS       = 0x8B81
	LINK_STATUS          = 0x8B82
	INFO_LOG_LENGTH      = 0x8B84
	ACTIVE_UNIFORMS      = 0x8B86
	ACTIVE_ATTRIBUTES    = 0x8B89
	SHADER_SOURCE_LENGTH = 0x8B88

	// Draw modes
	POINTS         = 0x0000
	LINES          = 0x0001
	LINE_LOOP      = 0x0002
	LINE_STRIP     = 0x0003
	TRIANGLES      = 0x0004
	TRIANGLE_STRIP = 0x0005
	TRIANGLE_FAN   = 0x0006

	// Blend factors
	ZERO                     = 0
	ONE                      = 1
	SRC_COLOR                = 0x0300
	ONE_MINUS_SRC_COLOR      = 0x0301
	SRC_ALPHA                = 0x0302
	ONE_MINUS_SRC_ALPHA      = 0x0303
	DST_ALPHA                = 0x0304
	ONE_MINUS_DST_ALPHA      = 0x0305
	DST_COLOR                = 0x0306
	ONE_MINUS_DST_COLOR      = 0x0307
	SRC_ALPHA_SATURATE       = 0x0308
	CONSTANT_COLOR           = 0x8001
	ONE_MINUS_CONSTANT_COLOR = 0x8002
	CONSTANT_ALPHA           = 0x8003
	ONE_MINUS_CONSTANT_ALPHA = 0x8004

	// Blend equations
	FUNC_ADD              = 0x8006
	FUNC_SUBTRACT         = 0x800A
	FUNC_REVERSE_SUBTRACT = 0x800B
	MIN                   = 0x8007
	MAX                   = 0x8008

	// Depth functions
	NEVER    = 0x0200
	LESS     = 0x0201
	EQUAL    = 0x0202
	LEQUAL   = 0x0203
	GREATER  = 0x0204
	NOTEQUAL = 0x0205
	GEQUAL   = 0x0206
	ALWAYS   = 0x0207

	// Stencil operations
	KEEP      = 0x1E00
	REPLACE   = 0x1E01
	INCR      = 0x1E02
	DECR      = 0x1E03
	INVERT    = 0x150A
	INCR_WRAP = 0x8507
	DECR_WRAP = 0x8508

	// Face culling
	FRONT          = 0x0404
	BACK           = 0x0405
	FRONT_AND_BACK = 0x0408
	CW             = 0x0900
	CCW            = 0x0901

	// Framebuffer
	FRAMEBUFFER              = 0x8D40
	FRAMEBUFFER_BINDING      = 0x8CA6
	READ_FRAMEBUFFER         = 0x8CA8
	DRAW_FRAMEBUFFER         = 0x8CA9
	RENDERBUFFER             = 0x8D41
	COLOR_ATTACHMENT0        = 0x8CE0
	DEPTH_ATTACHMENT         = 0x8D00
	STENCIL_ATTACHMENT       = 0x8D20
	DEPTH_STENCIL_ATTACHMENT = 0x821A
	FRAMEBUFFER_COMPLETE     = 0x8CD5

	// Pixel storage
	PACK_ALIGNMENT   = 0x0D05
	UNPACK_ALIGNMENT = 0x0CF5

	// Clear bits
	COLOR_BUFFER_BIT   = 0x00004000
	DEPTH_BUFFER_BIT   = 0x00000100
	STENCIL_BUFFER_BIT = 0x00000400

	// Get parameters
	VENDOR                           = 0x1F00
	RENDERER                         = 0x1F01
	VERSION                          = 0x1F02
	SHADING_LANGUAGE_VERSION         = 0x8B8C
	EXTENSIONS                       = 0x1F03
	MAX_TEXTURE_SIZE                 = 0x0D33
	MAX_TEXTURE_IMAGE_UNITS          = 0x8872
	MAX_VERTEX_ATTRIBS               = 0x8869
	MAX_VERTEX_UNIFORM_COMPONENTS    = 0x8B4A
	MAX_FRAGMENT_UNIFORM_COMPONENTS  = 0x8B49
	MAX_UNIFORM_BUFFER_BINDINGS      = 0x8A2F
	MAX_UNIFORM_BLOCK_SIZE           = 0x8A30
	MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D
	MAX_COLOR_ATTACHMENTS            = 0x8CDF
	MAX_DRAW_BUFFERS                 = 0x8824
	MAX_RENDERBUFFER_SIZE            = 0x84E8
	MAX_SAMPLES                      = 0x8D57

	// VAO
	VERTEX_ARRAY_BINDING = 0x85B5

	// Sync objects
	SYNC_GPU_COMMANDS_COMPLETE = 0x9117
	ALREADY_SIGNALED           = 0x911A
	TIMEOUT_EXPIRED            = 0x911B
	CONDITION_SATISFIED        = 0x911C
	WAIT_FAILED                = 0x911D
	SYNC_FLUSH_COMMANDS_BIT    = 0x00000001
	TIMEOUT_IGNORED            = 0xFFFFFFFFFFFFFFFF

	// Compute shader constants (OpenGL ES 3.1+ / OpenGL 4.3+)
	MAX_COMPUTE_WORK_GROUP_COUNT       = 0x91BE
	MAX_COMPUTE_WORK_GROUP_SIZE        = 0x91BF
	MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB

	// Memory barrier bits (OpenGL ES 3.1+ / OpenGL 4.2+)
	VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001
	ELEMENT_ARRAY_BARRIER_BIT       = 0x00000002
	UNIFORM_BARRIER_BIT             = 0x00000004
	TEXTURE_FETCH_BARRIER_BIT       = 0x00000008
	SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020
	COMMAND_BARRIER_BIT             = 0x00000040
	PIXEL_BUFFER_BARRIER_BIT        = 0x00000080
	TEXTURE_UPDATE_BARRIER_BIT      = 0x00000100
	BUFFER_UPDATE_BARRIER_BIT       = 0x00000200
	FRAMEBUFFER_BARRIER_BIT         = 0x00000400
	TRANSFORM_FEEDBACK_BARRIER_BIT  = 0x00000800
	ATOMIC_COUNTER_BARRIER_BIT      = 0x00001000
	SHADER_STORAGE_BARRIER_BIT      = 0x00002000
	ALL_BARRIER_BITS                = 0xFFFFFFFF

	// Indirect dispatch buffer (OpenGL ES 3.1+ / OpenGL 4.3+)
	DISPATCH_INDIRECT_BUFFER = 0x90EE

	// Shader storage buffer (OpenGL ES 3.1+ / OpenGL 4.3+)
	SHADER_STORAGE_BUFFER = 0x90D2
)

OpenGL ES 3.0 / OpenGL 3.3 constants. These are the subset needed for WebGPU implementation. OpenGL constants use ALL_CAPS by industry convention.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context added in v0.4.0

type Context struct {
	// contains filtered or unexported fields
}

Context holds OpenGL function pointers loaded at runtime via goffi. Functions are loaded via eglGetProcAddress for all OpenGL functions.

func (*Context) ActiveTexture added in v0.4.0

func (c *Context) ActiveTexture(texture uint32)

func (*Context) AttachShader added in v0.4.0

func (c *Context) AttachShader(program, shader uint32)

func (*Context) BindBuffer added in v0.4.0

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

func (*Context) BindBufferBase added in v0.16.0

func (c *Context) BindBufferBase(target, index, buffer uint32)

BindBufferBase binds a buffer to an indexed binding point.

func (*Context) BindBufferRange added in v0.16.0

func (c *Context) BindBufferRange(target, index, buffer uint32, offset, size int)

BindBufferRange binds a range of a buffer to an indexed binding point.

func (*Context) BindFramebuffer added in v0.4.0

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

func (*Context) BindRenderbuffer added in v0.25.0

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

BindRenderbuffer binds a renderbuffer object to the given target (typically GL_RENDERBUFFER).

func (*Context) BindSampler added in v0.22.0

func (c *Context) BindSampler(unit, sampler uint32)

BindSampler binds a sampler object to a texture unit. No-op if sampler objects are not supported.

func (*Context) BindTexture added in v0.4.0

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

func (*Context) BindVertexArray added in v0.4.0

func (c *Context) BindVertexArray(array uint32)

func (*Context) BlendColor added in v0.16.0

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

BlendColor sets the constant blend color.

func (*Context) BlendEquation added in v0.4.0

func (c *Context) BlendEquation(mode uint32)

func (*Context) BlendEquationSeparate added in v0.16.0

func (c *Context) BlendEquationSeparate(modeRGB, modeAlpha uint32)

BlendEquationSeparate sets separate blend equations for RGB and alpha.

func (*Context) BlendFunc added in v0.4.0

func (c *Context) BlendFunc(sfactor, dfactor uint32)

func (*Context) BlendFuncSeparate added in v0.4.0

func (c *Context) BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha uint32)

func (*Context) BlitFramebuffer added in v0.16.0

func (c *Context) BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1 int32, mask, filter uint32)

BlitFramebuffer copies a block of pixels between framebuffers. Requires OpenGL 3.0+ or OpenGL ES 3.0+. No-op if not supported.

func (*Context) BufferData added in v0.4.0

func (c *Context) BufferData(target uint32, size int, data uintptr, usage uint32)

func (*Context) BufferSubData added in v0.4.0

func (c *Context) BufferSubData(target uint32, offset, size int, data uintptr)

func (*Context) CheckFramebufferStatus added in v0.4.0

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

func (*Context) Clear added in v0.4.0

func (c *Context) Clear(mask uint32)

func (*Context) ClearColor added in v0.4.0

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

func (*Context) ColorMask added in v0.16.0

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

ColorMask enables or disables writing of color components.

func (*Context) CompileShader added in v0.4.0

func (c *Context) CompileShader(shader uint32)

func (*Context) CreateProgram added in v0.4.0

func (c *Context) CreateProgram() uint32

func (*Context) CreateShader added in v0.4.0

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

func (*Context) CullFace added in v0.4.0

func (c *Context) CullFace(mode uint32)

func (*Context) DeleteBuffers added in v0.4.0

func (c *Context) DeleteBuffers(buffers ...uint32)

func (*Context) DeleteFramebuffers added in v0.4.0

func (c *Context) DeleteFramebuffers(framebuffers ...uint32)

func (*Context) DeleteProgram added in v0.4.0

func (c *Context) DeleteProgram(program uint32)

func (*Context) DeleteRenderbuffers added in v0.25.0

func (c *Context) DeleteRenderbuffers(renderbuffers ...uint32)

DeleteRenderbuffers deletes the named renderbuffer objects.

func (*Context) DeleteSamplers added in v0.22.0

func (c *Context) DeleteSamplers(samplers ...uint32)

DeleteSamplers deletes sampler objects. No-op if sampler objects are not supported.

func (*Context) DeleteShader added in v0.4.0

func (c *Context) DeleteShader(shader uint32)

func (*Context) DeleteTextures added in v0.4.0

func (c *Context) DeleteTextures(textures ...uint32)

func (*Context) DeleteVertexArrays added in v0.4.0

func (c *Context) DeleteVertexArrays(arrays ...uint32)

func (*Context) DepthFunc added in v0.4.0

func (c *Context) DepthFunc(fn uint32)

func (*Context) DepthMask added in v0.4.0

func (c *Context) DepthMask(flag bool)

func (*Context) Disable added in v0.4.0

func (c *Context) Disable(capability uint32)

func (*Context) DisableVertexAttribArray added in v0.4.0

func (c *Context) DisableVertexAttribArray(index uint32)

func (*Context) DispatchCompute added in v0.8.1

func (c *Context) DispatchCompute(numGroupsX, numGroupsY, numGroupsZ uint32)

DispatchCompute launches compute shader workgroups. Requires OpenGL 4.3+ or OpenGL ES 3.1+. No-op if compute shaders are not supported.

func (*Context) DispatchComputeIndirect added in v0.8.1

func (c *Context) DispatchComputeIndirect(indirect uintptr)

DispatchComputeIndirect launches compute workgroups with parameters from a buffer. The indirect parameter is an offset into the currently bound GL_DISPATCH_INDIRECT_BUFFER. Requires OpenGL 4.3+ or OpenGL ES 3.1+. No-op if compute shaders are not supported.

func (*Context) DrawArrays added in v0.4.0

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

func (*Context) DrawArraysInstanced added in v0.4.0

func (c *Context) DrawArraysInstanced(mode uint32, first, count, instanceCount int32)

func (*Context) DrawElements added in v0.4.0

func (c *Context) DrawElements(mode uint32, count int32, typ uint32, indices uintptr)

func (*Context) DrawElementsInstanced added in v0.4.0

func (c *Context) DrawElementsInstanced(mode uint32, count int32, typ uint32, indices uintptr, instanceCount int32)

func (*Context) Enable added in v0.4.0

func (c *Context) Enable(capability uint32)

func (*Context) EnableVertexAttribArray added in v0.4.0

func (c *Context) EnableVertexAttribArray(index uint32)

func (*Context) Finish added in v0.4.0

func (c *Context) Finish()

func (*Context) Flush added in v0.4.0

func (c *Context) Flush()

func (*Context) FramebufferRenderbuffer added in v0.25.0

func (c *Context) FramebufferRenderbuffer(target, attachment, renderbufferTarget, renderbuffer uint32)

FramebufferRenderbuffer attaches a renderbuffer to the currently bound framebuffer at the specified attachment point.

func (*Context) FramebufferTexture2D added in v0.4.0

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

func (*Context) FrontFace added in v0.4.0

func (c *Context) FrontFace(mode uint32)

func (*Context) GenBuffers added in v0.4.0

func (c *Context) GenBuffers(n int32) uint32

func (*Context) GenFramebuffers added in v0.4.0

func (c *Context) GenFramebuffers(n int32) uint32

func (*Context) GenRenderbuffers added in v0.25.0

func (c *Context) GenRenderbuffers(n int32) uint32

GenRenderbuffers generates a single renderbuffer object and returns its name.

func (*Context) GenSamplers added in v0.22.0

func (c *Context) GenSamplers(n int32) uint32

GenSamplers generates sampler object names. Requires OpenGL 3.3+ or OpenGL ES 3.0+. Returns 0 if sampler objects are not supported.

func (*Context) GenTextures added in v0.4.0

func (c *Context) GenTextures(n int32) uint32

func (*Context) GenVertexArrays added in v0.4.0

func (c *Context) GenVertexArrays(n int32) uint32

func (*Context) GenerateMipmap added in v0.4.0

func (c *Context) GenerateMipmap(target uint32)

func (*Context) GetAttribLocation added in v0.4.0

func (c *Context) GetAttribLocation(program uint32, name string) int32

func (*Context) GetError added in v0.4.0

func (c *Context) GetError() uint32

func (*Context) GetIntegerv added in v0.4.0

func (c *Context) GetIntegerv(pname uint32, data *int32)

func (*Context) GetProgramInfoLog added in v0.4.0

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

func (*Context) GetProgramiv added in v0.4.0

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

func (*Context) GetShaderInfoLog added in v0.4.0

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

func (*Context) GetShaderiv added in v0.4.0

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

func (*Context) GetString added in v0.4.0

func (c *Context) GetString(name uint32) string

func (*Context) GetUniformBlockIndex added in v0.16.0

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

GetUniformBlockIndex returns the index of a named uniform block.

func (*Context) GetUniformLocation added in v0.4.0

func (c *Context) GetUniformLocation(program uint32, name string) int32

func (*Context) LinkProgram added in v0.4.0

func (c *Context) LinkProgram(program uint32)

func (*Context) Load added in v0.4.0

func (c *Context) Load(getProcAddr ProcAddressFunc) error

Load loads all OpenGL function pointers using the provided loader.

func (*Context) MapBuffer added in v0.15.0

func (c *Context) MapBuffer(target, access uint32) uintptr

MapBuffer maps a buffer object's data store into the client's address space. target: GL_ARRAY_BUFFER, GL_COPY_READ_BUFFER, etc. access: GL_READ_ONLY, GL_WRITE_ONLY, GL_READ_WRITE. Returns the mapped pointer, or 0 if glMapBuffer is not available or the call fails.

func (*Context) MemoryBarrier added in v0.8.1

func (c *Context) MemoryBarrier(barriers uint32)

MemoryBarrier inserts a memory barrier for specified access types. barriers is a bitwise OR of GL_*_BARRIER_BIT constants. Requires OpenGL 4.2+ or OpenGL ES 3.1+. No-op if memory barriers are not supported.

func (*Context) PixelStorei added in v0.16.0

func (c *Context) PixelStorei(pname uint32, param int32)

PixelStorei sets pixel storage modes that affect ReadPixels and TexImage operations.

func (*Context) ReadPixels added in v0.16.0

func (c *Context) ReadPixels(x, y, width, height int32, format, dataType uint32, pixels unsafe.Pointer)

ReadPixels reads a block of pixels from the framebuffer.

func (*Context) RenderbufferStorage added in v0.25.0

func (c *Context) RenderbufferStorage(target, internalFormat uint32, width, height int32)

RenderbufferStorage allocates storage for the currently bound renderbuffer. internalFormat is a sized format like GL_RGBA8 or GL_DEPTH24_STENCIL8.

func (*Context) SamplerParameterf added in v0.22.0

func (c *Context) SamplerParameterf(sampler, pname uint32, param float32)

SamplerParameterf sets a float parameter on a sampler object. No-op if sampler objects are not supported.

func (*Context) SamplerParameteri added in v0.22.0

func (c *Context) SamplerParameteri(sampler, pname uint32, param int32)

SamplerParameteri sets an integer parameter on a sampler object. No-op if sampler objects are not supported.

func (*Context) Scissor added in v0.4.0

func (c *Context) Scissor(x, y, width, height int32)

func (*Context) ShaderSource added in v0.4.0

func (c *Context) ShaderSource(shader uint32, source string)

func (*Context) StencilFuncSeparate added in v0.16.0

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

StencilFuncSeparate sets stencil test function per face.

func (*Context) StencilMaskSeparate added in v0.16.0

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

StencilMaskSeparate sets stencil write mask per face.

func (*Context) StencilOpSeparate added in v0.16.0

func (c *Context) StencilOpSeparate(face, sfail, dpfail, dppass uint32)

StencilOpSeparate sets stencil operations per face.

func (*Context) SupportsCompute added in v0.8.1

func (c *Context) SupportsCompute() bool

SupportsCompute returns true if compute shaders are supported.

func (*Context) SupportsSamplerObjects added in v0.22.0

func (c *Context) SupportsSamplerObjects() bool

SupportsSamplerObjects returns true if GL sampler objects are supported.

func (*Context) TexImage2D added in v0.4.0

func (c *Context) TexImage2D(target uint32, level int32, internalformat int32, width, height int32, border int32, format, typ uint32, pixels uintptr)

func (*Context) TexImage2DMultisample added in v0.16.0

func (c *Context) TexImage2DMultisample(target uint32, samples int32, internalformat uint32, width, height int32, fixedsamplelocations bool)

TexImage2DMultisample creates a multisample 2D texture image. Requires OpenGL 3.2+ or OpenGL ES 3.1+. No-op if not supported.

func (*Context) TexParameteri added in v0.4.0

func (c *Context) TexParameteri(target, pname uint32, param int32)

func (*Context) TexSubImage2D added in v0.23.4

func (c *Context) TexSubImage2D(target uint32, level int32, xoffset, yoffset, width, height int32, format, typ uint32, pixels uintptr)

func (*Context) Uniform1i added in v0.16.0

func (c *Context) Uniform1i(location, value int32)

Uniform1i sets an integer uniform value.

func (*Context) UniformBlockBinding added in v0.16.0

func (c *Context) UniformBlockBinding(program, blockIndex, blockBinding uint32)

UniformBlockBinding assigns a uniform block to a binding point.

func (*Context) UnmapBuffer added in v0.15.0

func (c *Context) UnmapBuffer(target uint32) bool

UnmapBuffer releases the mapping of a buffer object's data store. Returns true if the buffer was successfully unmapped, false if the buffer contents became corrupt during the mapping (GL_FALSE from driver) or glUnmapBuffer is unavailable.

func (*Context) UseProgram added in v0.4.0

func (c *Context) UseProgram(program uint32)

func (*Context) VertexAttribPointer added in v0.4.0

func (c *Context) VertexAttribPointer(index uint32, size int32, typ uint32, normalized bool, stride int32, offset uintptr)

func (*Context) Viewport added in v0.4.0

func (c *Context) Viewport(x, y, width, height int32)

type ProcAddressFunc added in v0.4.0

type ProcAddressFunc func(name string) unsafe.Pointer

ProcAddressFunc is a function that returns the address of an OpenGL function.

Jump to

Keyboard shortcuts

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