data

package
v0.0.0-...-7ca6639 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WrapClampToEdge       = TexWrapMode(gl.CLAMP_TO_EDGE)
	WrapClampToBorder     = TexWrapMode(gl.CLAMP_TO_BORDER)
	WrapMirroredRepeat    = TexWrapMode(gl.MIRRORED_REPEAT)
	WrapRepeat            = TexWrapMode(gl.REPEAT)
	WrapMirrorClampToEdge = TexWrapMode(gl.MIRROR_CLAMP_TO_EDGE)
)

Texture Wrap Modes

View Source
const (
	FilterNearest = TexFilterMode(gl.NEAREST)
	FilterLinear  = TexFilterMode(gl.LINEAR)
)

Common texture filters

View Source
const (
	FilterNearestMipMapNearest = TexFilterMode(gl.NEAREST_MIPMAP_NEAREST)
	FilterLinearMipMapNearest  = TexFilterMode(gl.LINEAR_MIPMAP_NEAREST)
	FilterNearestMipMapLinear  = TexFilterMode(gl.NEAREST_MIPMAP_LINEAR)
	FilterLinearMipMapLinear   = TexFilterMode(gl.LINEAR_MIPMAP_LINEAR)
)

Texture minification filters

View Source
const (
	Texture1D      = TexTarget(gl.TEXTURE_1D)
	TextureProxy1D = TexTarget(gl.PROXY_TEXTURE_1D)
)

1D Texture targets

View Source
const (
	Texture2D               = TexTarget(gl.TEXTURE_2D)
	TextureProxy2D          = TexTarget(gl.PROXY_TEXTURE_2D)
	Texture1DArray          = TexTarget(gl.TEXTURE_1D_ARRAY)
	TextureProxy1DArray     = TexTarget(gl.PROXY_TEXTURE_1D_ARRAY)
	TextureRectangle        = TexTarget(gl.TEXTURE_RECTANGLE)
	TextureProxyRectangle   = TexTarget(gl.PROXY_TEXTURE_RECTANGLE)
	TextureCubeMapPositiveX = TexTarget(gl.TEXTURE_CUBE_MAP_POSITIVE_X)
	TextureCubeMapPositiveY = TexTarget(gl.TEXTURE_CUBE_MAP_POSITIVE_Y)
	TextureCubeMapPositiveZ = TexTarget(gl.TEXTURE_CUBE_MAP_POSITIVE_Z)
	TextureCubeMapNegativeX = TexTarget(gl.TEXTURE_CUBE_MAP_NEGATIVE_X)
	TextureCubeMapNegativeY = TexTarget(gl.TEXTURE_CUBE_MAP_NEGATIVE_Y)
	TextureCubeMapNegativeZ = TexTarget(gl.TEXTURE_CUBE_MAP_NEGATIVE_Z)
	TextureProxyCubeMap     = TexTarget(gl.PROXY_TEXTURE_CUBE_MAP)
)

2D Texture targets

View Source
const (
	Texture3D           = TexTarget(gl.TEXTURE_3D)
	TextureProxy3D      = TexTarget(gl.PROXY_TEXTURE_3D)
	Texture2DArray      = TexTarget(gl.TEXTURE_2D_ARRAY)
	TextureProxy2DArray = TexTarget(gl.PROXY_TEXTURE_2D_ARRAY)
)

3D Texture targets

Variables

This section is empty.

Functions

This section is empty.

Types

type TexFilterMode

type TexFilterMode int

type TexTarget

type TexTarget int

type TexWrapMode

type TexWrapMode int

type Texture

type Texture struct {
	Target TexTarget
	// contains filtered or unexported fields
}

func NewTexture

func NewTexture(texType TexTarget) *Texture

func (*Texture) Alloc

func (tex *Texture) Alloc(level, internalFormat, width, height, depth int32, format, dataType uint32, data interface{})

func (*Texture) AllocWithBytes

func (tex *Texture) AllocWithBytes(bytes []byte, width, height int32, level, internalFormat int32, format uint32)

func (*Texture) AllocWithFile1D

func (tex *Texture) AllocWithFile1D(file io.Reader, level, internalFormat int32, format, dataType uint32) error

func (*Texture) AllocWithFile2D

func (tex *Texture) AllocWithFile2D(file io.Reader, level, internalFormat int32, format, dataType uint32) error

func (*Texture) AllocWithFile3D

func (tex *Texture) AllocWithFile3D(files [6]io.Reader, level, internalFormat int32, format, dataType uint32) error

files - right (+x), left (-x), top (+y), bottom (-y), back (+z), front (-z)

func (*Texture) AllocWithImage

func (tex *Texture) AllocWithImage(img image.Image, level, internalFormat int32, format, dataType uint32)

func (*Texture) As

func (tex *Texture) As(target TexTarget) *Texture

func (*Texture) Bind

func (tex *Texture) Bind(unit int)

func (*Texture) BindFor

func (tex *Texture) BindFor(unit int, context utils.BindingClosure)

func (*Texture) FilterMode

func (tex *Texture) FilterMode(minMode, magMode TexFilterMode)

func (*Texture) GenerateMipmap

func (tex *Texture) GenerateMipmap()

func (*Texture) Id

func (tex *Texture) Id() uint32

func (*Texture) Unbind

func (tex *Texture) Unbind(unit int)

func (*Texture) WrapMode

func (tex *Texture) WrapMode(sMode, tMode, rMode TexWrapMode)

type TypeErr

type TypeErr struct {
	Type reflect.Type
}

func (TypeErr) Error

func (terr TypeErr) Error() string

type Vao

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

func NewVao

func NewVao() *Vao

func (*Vao) Bind

func (vao *Vao) Bind()

func (*Vao) BindFor

func (vao *Vao) BindFor(context utils.BindingClosure)

func (*Vao) Destroy

func (vao *Vao) Destroy()

TODO: Destroy VBOs, note that VAOs can share VBOs

func (*Vao) Id

func (vao *Vao) Id() uint32

func (*Vao) Unbind

func (vao *Vao) Unbind()

type Vbo

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

func NewVbo

func NewVbo() *Vbo

func (*Vbo) Bind

func (vbo *Vbo) Bind(target uint32)

func (*Vbo) BindFor

func (vbo *Vbo) BindFor(target uint32, context utils.BindingClosure)

func (*Vbo) Destroy

func (vbo *Vbo) Destroy()

func (*Vbo) Id

func (vbo *Vbo) Id() uint32

func (*Vbo) Layout

func (vbo *Vbo) Layout(index int, size int, dataType interface{}, normalized bool, stride int) (err error)

func (*Vbo) MustLayout

func (vbo *Vbo) MustLayout(index int, size int, dataType interface{}, normalized bool, stride int)

Like Layout but panics if there is an error

func (*Vbo) Unbind

func (vbo *Vbo) Unbind(target uint32)

func (*Vbo) Write

func (vbo *Vbo) Write(mode uint32, data interface{})

data - a silce of some type

func (*Vbo) WriteStatic

func (vbo *Vbo) WriteStatic(data interface{})

data - a silce of some type

Jump to

Keyboard shortcuts

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