glu

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArrayBuffer             = BufferTarget(gl.ARRAY_BUFFER)              // Vertex attributes
	AtomicCounterBuffer     = BufferTarget(gl.ATOMIC_COUNTER_BUFFER)     // Atomic counter storage
	CopyReadBuffer          = BufferTarget(gl.COPY_READ_BUFFER)          // Buffer copy source
	CopyWriteBuffer         = BufferTarget(gl.COPY_WRITE_BUFFER)         // Buffer copy destination
	DispatchIndirectBuffer  = BufferTarget(gl.DISPATCH_INDIRECT_BUFFER)  // Indirect compute dispatch commands
	DrawIndirectBuffer      = BufferTarget(gl.DRAW_INDIRECT_BUFFER)      // Indirect command arguments
	ElementArrayBuffer      = BufferTarget(gl.ELEMENT_ARRAY_BUFFER)      // Vertex array indices
	PixelPackBuffer         = BufferTarget(gl.PIXEL_PACK_BUFFER)         // Pixel read target
	PixelUnpackBuffer       = BufferTarget(gl.PIXEL_UNPACK_BUFFER)       // Texture data source
	QueryBuffer             = BufferTarget(gl.QUERY_BUFFER)              // Query result buffer
	ShaderStorageBuffer     = BufferTarget(gl.SHADER_STORAGE_BUFFER)     // Read-write storage for shaders
	TextureBuffer           = BufferTarget(gl.TEXTURE_BUFFER)            // Texture data buffer
	TransformFeedbackBuffer = BufferTarget(gl.TRANSFORM_FEEDBACK_BUFFER) // Transform feedback buffer
	UniformBuffer           = BufferTarget(gl.UNIFORM_BUFFER)            // Uniform block storage

)
View Source
const (
	ComputeShader        = ShaderType(gl.COMPUTE_SHADER)
	VertexShader         = ShaderType(gl.VERTEX_SHADER)
	TessControlShader    = ShaderType(gl.TESS_CONTROL_SHADER)
	TessEvaluationShader = ShaderType(gl.TESS_EVALUATION_SHADER)
	GeometryShader       = ShaderType(gl.GEOMETRY_SHADER)
	FragmentShader       = ShaderType(gl.FRAGMENT_SHADER)
)
View Source
const (
	DbgSevHigh               DbgSev = gl.DEBUG_SEVERITY_HIGH
	DbgSevMedium             DbgSev = gl.DEBUG_SEVERITY_MEDIUM
	DbgSevLow                DbgSev = gl.DEBUG_SEVERITY_LOW
	DbgSevNotification       DbgSev = gl.DEBUG_SEVERITY_NOTIFICATION
	DbgSrcApi                DbgSrc = gl.DEBUG_SOURCE_API
	DbgSrcWindowSystem       DbgSrc = gl.DEBUG_SOURCE_WINDOW_SYSTEM
	DbgSrcShaderCompiler     DbgSrc = gl.DEBUG_SOURCE_SHADER_COMPILER
	DbgSrcThirdParty         DbgSrc = gl.DEBUG_SOURCE_THIRD_PARTY
	DbgSrcApplication        DbgSrc = gl.DEBUG_SOURCE_APPLICATION
	DbgSrcOther              DbgSrc = gl.DEBUG_SOURCE_OTHER
	DbgTypError              DbgTyp = gl.DEBUG_TYPE_ERROR
	DbgTypDeprecatedBehavior DbgTyp = gl.DEBUG_TYPE_DEPRECATED_BEHAVIOR
	DbgTypUndefinedBehavior  DbgTyp = gl.DEBUG_TYPE_UNDEFINED_BEHAVIOR
	DbgTypPortability        DbgTyp = gl.DEBUG_TYPE_PORTABILITY
	DbgTypPerformance        DbgTyp = gl.DEBUG_TYPE_PERFORMANCE
	DbgTypMarker             DbgTyp = gl.DEBUG_TYPE_MARKER
	DbgTypPushGroup          DbgTyp = gl.DEBUG_TYPE_PUSH_GROUP
	DbgTypPopGroup           DbgTyp = gl.DEBUG_TYPE_POP_GROUP
	DbgTypOther              DbgTyp = gl.DEBUG_TYPE_OTHER
)

Variables

View Source
var Color = struct {
	R, G, B, W, C, M, Y, K mgl32.Vec3
}{
	mgl32.Vec3{1, 0, 0},
	mgl32.Vec3{0, 1, 0},
	mgl32.Vec3{0, 0, 1},
	mgl32.Vec3{1, 1, 1},
	mgl32.Vec3{0, 1, 1},
	mgl32.Vec3{1, 0, 1},
	mgl32.Vec3{1, 1, 0},
	mgl32.Vec3{0, 0, 0},
}

Functions

func Disable

func Disable(cap uint32, fn func())

func Enable

func Enable(cap uint32, fn func())

Types

type Buffer

type Buffer struct {
	Ref
	Target BufferTarget
}

func (Buffer) Bind

func (b Buffer) Bind()

func (Buffer) Delete

func (b Buffer) Delete()

func (Buffer) Init

func (b Buffer) Init(size int, usage uint32)

func (Buffer) Unbind

func (b Buffer) Unbind()

func (Buffer) Write

func (b Buffer) Write(data interface{}, usage uint32)

func (Buffer) WriteAt

func (b Buffer) WriteAt(data interface{}, offset int) int

type BufferTarget

type BufferTarget uint32

func (BufferTarget) ID

func (b BufferTarget) ID() uint32

func (BufferTarget) New

func (b BufferTarget) New() Buffer

func (BufferTarget) NewWith

func (b BufferTarget) NewWith(data interface{}, usage uint32) Buffer

type DbgSev

type DbgSev uint32

Debug message severity

func (DbgSev) String

func (v DbgSev) String() string

type DbgSrc

type DbgSrc uint32

Debug message source

func (DbgSrc) String

func (v DbgSrc) String() string

type DbgTyp

type DbgTyp uint32

Debug message type

func (DbgTyp) String

func (v DbgTyp) String() string

type Program

type Program struct{ Ref }

func BuildShaderProgram

func BuildShaderProgram(source map[ShaderType]string) (Program, error)

func NewProgram

func NewProgram() Program

func (Program) AttachShaders

func (p Program) AttachShaders(s ...Shader)

func (Program) Delete

func (p Program) Delete()

func (Program) GetAttrib

func (p Program) GetAttrib(name string) VertexAttrib

func (Program) GetUniform

func (p Program) GetUniform(name string) Uniform

func (Program) Getiv

func (p Program) Getiv(name uint32) (v int32)

func (Program) InfoLog

func (p Program) InfoLog() string
func (p Program) Link() error

func (Program) Unuse

func (_ Program) Unuse()

func (Program) Use

func (p Program) Use()

type Ref

type Ref uint32

func Gen

func Gen(n int, fn func(int32, *uint32), skip int, msg string, args ...interface{}) []Ref

func GenT

func GenT(target uint32, n int, fn func(uint32, int32, *uint32), skip int, msg string, args ...interface{}) []Ref

func NewRef

func NewRef(v uint32, skip int, msg string, args ...interface{}) Ref

func (Ref) ID

func (r Ref) ID() uint32

func (Ref) SID

func (r Ref) SID() int32

type Shader

type Shader struct{ Ref }

func (Shader) Compile

func (s Shader) Compile(source string) error

func (Shader) Delete

func (s Shader) Delete()

func (Shader) Getiv

func (s Shader) Getiv(name uint32) (v int32)

func (Shader) InfoLog

func (s Shader) InfoLog() string

type ShaderType

type ShaderType uint32

func (ShaderType) ID

func (s ShaderType) ID() uint32

func (ShaderType) New

func (s ShaderType) New() Shader

type Texture

type Texture struct {
	Ref
	Target TextureTarget
}

func (Texture) Bind

func (t Texture) Bind()

func (Texture) Delete

func (t Texture) Delete()

func (Texture) Unbind

func (t Texture) Unbind()

type TextureTarget

type TextureTarget uint32

func (TextureTarget) ID

func (t TextureTarget) ID() uint32

func (TextureTarget) Image2D

func (t TextureTarget) Image2D(level, internalformat, width, height, border int32, format, xtype uint32, pixels unsafe.Pointer)

func (TextureTarget) LoadImage2D

func (t TextureTarget) LoadImage2D(img image.Image, level, internalFormat, border int32)

func (TextureTarget) New

func (t TextureTarget) New() Texture

func (TextureTarget) Parameteri

func (t TextureTarget) Parameteri(name uint32, val int32)

type Uniform

type Uniform struct{ Ref }

func (Uniform) As1f

func (u Uniform) As1f(a float32)

func (Uniform) As1fv

func (u Uniform) As1fv(v ...float32)

func (Uniform) As1i

func (u Uniform) As1i(a int32)

func (Uniform) As1iv

func (u Uniform) As1iv(v ...int32)

func (Uniform) As1ui

func (u Uniform) As1ui(a uint32)

func (Uniform) As1uiv

func (u Uniform) As1uiv(v ...uint32)

func (Uniform) As2f

func (u Uniform) As2f(a, b float32)

func (Uniform) As2fv

func (u Uniform) As2fv(v ...mgl32.Vec2)

func (Uniform) As2i

func (u Uniform) As2i(a, b int32)

func (Uniform) As2iv

func (u Uniform) As2iv(v ...[2]int32)

func (Uniform) As2ui

func (u Uniform) As2ui(a, b uint32)

func (Uniform) As2uiv

func (u Uniform) As2uiv(v ...[2]uint32)

func (Uniform) As3f

func (u Uniform) As3f(a, b, c float32)

func (Uniform) As3fv

func (u Uniform) As3fv(v ...mgl32.Vec3)

func (Uniform) As3i

func (u Uniform) As3i(a, b, c int32)

func (Uniform) As3iv

func (u Uniform) As3iv(v ...[3]int32)

func (Uniform) As3ui

func (u Uniform) As3ui(a, b, c uint32)

func (Uniform) As3uiv

func (u Uniform) As3uiv(v ...[3]uint32)

func (Uniform) As4f

func (u Uniform) As4f(a, b, c, d float32)

func (Uniform) As4fv

func (u Uniform) As4fv(v ...mgl32.Vec4)

func (Uniform) As4i

func (u Uniform) As4i(a, b, c, d int32)

func (Uniform) As4iv

func (u Uniform) As4iv(v ...[4]int32)

func (Uniform) As4ui

func (u Uniform) As4ui(a, b, c, d uint32)

func (Uniform) As4uiv

func (u Uniform) As4uiv(v ...[4]uint32)

func (Uniform) AsMatrix2fv

func (u Uniform) AsMatrix2fv(transpose bool, v ...mgl32.Mat2)

func (Uniform) AsMatrix2x3fv

func (u Uniform) AsMatrix2x3fv(transpose bool, v ...mgl32.Mat2x3)

func (Uniform) AsMatrix2x4fv

func (u Uniform) AsMatrix2x4fv(transpose bool, v ...mgl32.Mat2x4)

func (Uniform) AsMatrix3fv

func (u Uniform) AsMatrix3fv(transpose bool, v ...mgl32.Mat3)

func (Uniform) AsMatrix3x2fv

func (u Uniform) AsMatrix3x2fv(transpose bool, v ...mgl32.Mat3x2)

func (Uniform) AsMatrix3x4fv

func (u Uniform) AsMatrix3x4fv(transpose bool, v ...mgl32.Mat3x4)

func (Uniform) AsMatrix4fv

func (u Uniform) AsMatrix4fv(transpose bool, v ...mgl32.Mat4)

func (Uniform) AsMatrix4x2fv

func (u Uniform) AsMatrix4x2fv(transpose bool, v ...mgl32.Mat4x2)

func (Uniform) AsMatrix4x3fv

func (u Uniform) AsMatrix4x3fv(transpose bool, v ...mgl32.Mat4x3)

type VertexArray

type VertexArray struct{ Ref }

func NewVertexArray

func NewVertexArray() VertexArray

func (VertexArray) Bind

func (a VertexArray) Bind()

func (VertexArray) Delete

func (a VertexArray) Delete()

func (VertexArray) Disable

func (a VertexArray) Disable(b ...VertexAttrib)

func (VertexArray) Enable

func (a VertexArray) Enable(b ...VertexAttrib)

func (VertexArray) Unbind

func (_ VertexArray) Unbind()

type VertexAttrib

type VertexAttrib struct{ Ref }

func (VertexAttrib) As1d

func (a VertexAttrib) As1d(v0 float64)

func (VertexAttrib) As1dv

func (a VertexAttrib) As1dv(v [1]float64)

func (VertexAttrib) As1f

func (a VertexAttrib) As1f(v0 float32)

func (VertexAttrib) As1fv

func (a VertexAttrib) As1fv(v [1]float32)

func (VertexAttrib) As1s

func (a VertexAttrib) As1s(v0 int16)

func (VertexAttrib) As1sv

func (a VertexAttrib) As1sv(v [1]int16)

func (VertexAttrib) As2d

func (a VertexAttrib) As2d(v0, v1 float64)

func (VertexAttrib) As2dv

func (a VertexAttrib) As2dv(v [2]float64)

func (VertexAttrib) As2f

func (a VertexAttrib) As2f(v0, v1 float32)

func (VertexAttrib) As2fv

func (a VertexAttrib) As2fv(v [2]float32)

func (VertexAttrib) As2s

func (a VertexAttrib) As2s(v0, v1 int16)

func (VertexAttrib) As2sv

func (a VertexAttrib) As2sv(v [2]int16)

func (VertexAttrib) As3d

func (a VertexAttrib) As3d(v0, v1, v2 float64)

func (VertexAttrib) As3dv

func (a VertexAttrib) As3dv(v [3]float64)

func (VertexAttrib) As3f

func (a VertexAttrib) As3f(v0, v1, v2 float32)

func (VertexAttrib) As3fv

func (a VertexAttrib) As3fv(v [3]float32)

func (VertexAttrib) As3s

func (a VertexAttrib) As3s(v0, v1, v2 int16)

func (VertexAttrib) As3sv

func (a VertexAttrib) As3sv(v [3]int16)

func (VertexAttrib) As4Nbv

func (a VertexAttrib) As4Nbv(v [4]int8)

func (VertexAttrib) As4Niv

func (a VertexAttrib) As4Niv(v [4]int32)

func (VertexAttrib) As4Nsv

func (a VertexAttrib) As4Nsv(v [4]int16)

func (VertexAttrib) As4Nub

func (a VertexAttrib) As4Nub(v0, v1, v2, v3 uint8)

func (VertexAttrib) As4Nubv

func (a VertexAttrib) As4Nubv(v [4]uint8)

func (VertexAttrib) As4Nuiv

func (a VertexAttrib) As4Nuiv(v [4]uint32)

func (VertexAttrib) As4Nusv

func (a VertexAttrib) As4Nusv(v [4]uint16)

func (VertexAttrib) As4bv

func (a VertexAttrib) As4bv(v [4]int8)

func (VertexAttrib) As4d

func (a VertexAttrib) As4d(v0, v1, v2, v3 float64)

func (VertexAttrib) As4dv

func (a VertexAttrib) As4dv(v [4]float64)

func (VertexAttrib) As4f

func (a VertexAttrib) As4f(v0, v1, v2, v3 float32)

func (VertexAttrib) As4fv

func (a VertexAttrib) As4fv(v [4]float32)

func (VertexAttrib) As4iv

func (a VertexAttrib) As4iv(v [4]int32)

func (VertexAttrib) As4s

func (a VertexAttrib) As4s(v0, v1, v2, v3 int16)

func (VertexAttrib) As4sv

func (a VertexAttrib) As4sv(v [4]int16)

func (VertexAttrib) As4ubv

func (a VertexAttrib) As4ubv(v [4]uint8)

func (VertexAttrib) As4uiv

func (a VertexAttrib) As4uiv(v [4]uint32)

func (VertexAttrib) As4usv

func (a VertexAttrib) As4usv(v [4]uint16)

func (VertexAttrib) AsArray

func (a VertexAttrib) AsArray(size int32, xtype uint32, normalized bool, stride int32, pointer unsafe.Pointer)

func (VertexAttrib) AsI1i

func (a VertexAttrib) AsI1i(v0 int32)

func (VertexAttrib) AsI1iv

func (a VertexAttrib) AsI1iv(v [1]int32)

func (VertexAttrib) AsI1ui

func (a VertexAttrib) AsI1ui(v0 uint32)

func (VertexAttrib) AsI1uiv

func (a VertexAttrib) AsI1uiv(v [1]uint32)

func (VertexAttrib) AsI2i

func (a VertexAttrib) AsI2i(v0, v1 int32)

func (VertexAttrib) AsI2iv

func (a VertexAttrib) AsI2iv(v [2]int32)

func (VertexAttrib) AsI2ui

func (a VertexAttrib) AsI2ui(v0, v1 uint32)

func (VertexAttrib) AsI2uiv

func (a VertexAttrib) AsI2uiv(v [2]uint32)

func (VertexAttrib) AsI3i

func (a VertexAttrib) AsI3i(v0, v1, v2 int32)

func (VertexAttrib) AsI3iv

func (a VertexAttrib) AsI3iv(v [3]int32)

func (VertexAttrib) AsI3ui

func (a VertexAttrib) AsI3ui(v0, v1, v2 uint32)

func (VertexAttrib) AsI3uiv

func (a VertexAttrib) AsI3uiv(v [3]uint32)

func (VertexAttrib) AsI4bv

func (a VertexAttrib) AsI4bv(v [4]int8)

func (VertexAttrib) AsI4i

func (a VertexAttrib) AsI4i(v0, v1, v2, v3 int32)

func (VertexAttrib) AsI4iv

func (a VertexAttrib) AsI4iv(v [4]int32)

func (VertexAttrib) AsI4sv

func (a VertexAttrib) AsI4sv(v [4]int16)

func (VertexAttrib) AsI4ubv

func (a VertexAttrib) AsI4ubv(v [4]uint8)

func (VertexAttrib) AsI4ui

func (a VertexAttrib) AsI4ui(v0, v1, v2, v3 uint32)

func (VertexAttrib) AsI4uiv

func (a VertexAttrib) AsI4uiv(v [4]uint32)

func (VertexAttrib) AsI4usv

func (a VertexAttrib) AsI4usv(v [4]uint16)

func (VertexAttrib) AsL1d

func (a VertexAttrib) AsL1d(v0 float64)

func (VertexAttrib) AsL1dv

func (a VertexAttrib) AsL1dv(v [1]float64)

func (VertexAttrib) AsL2d

func (a VertexAttrib) AsL2d(v0, v1 float64)

func (VertexAttrib) AsL2dv

func (a VertexAttrib) AsL2dv(v [2]float64)

func (VertexAttrib) AsL3d

func (a VertexAttrib) AsL3d(v0, v1, v2 float64)

func (VertexAttrib) AsL3dv

func (a VertexAttrib) AsL3dv(v [3]float64)

func (VertexAttrib) AsL4d

func (a VertexAttrib) AsL4d(v0, v1, v2, v3 float64)

func (VertexAttrib) AsL4dv

func (a VertexAttrib) AsL4dv(v [4]float64)

Jump to

Keyboard shortcuts

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