texture

package
v0.0.0-...-0518d83 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Red = Format(iota)
	Depth
	RGB
	BGR
	RGB32F
	RGBA
	BGRA
	RGBA32F
)

Variables

View Source
var Filtering = struct {
	Nearest,
	Linear,
	MipMap,
	MipMapNearestNearest,
	MipMapLinearNearest,
	MipMapNearestLinear,
	MipMapLinearLinear Filter
}{gl.NEAREST, gl.LINEAR, gl.LINEAR_MIPMAP_LINEAR, gl.NEAREST_MIPMAP_NEAREST, gl.LINEAR_MIPMAP_NEAREST, gl.NEAREST_MIPMAP_LINEAR, gl.LINEAR_MIPMAP_LINEAR}

Functions

This section is empty.

Types

type Filter

type Filter int32

type Format

type Format int

func (Format) Format

func (f Format) Format() uint32

func (Format) InternalFormat

func (f Format) InternalFormat() uint32

func (Format) Size

func (f Format) Size() int

func (Format) Type

func (f Format) Type() uint32

type Pixmap

type Pixmap struct {
	RawPointer unsafe.Pointer
	Data       []uint8

	Width      int
	Height     int
	Components int
	// contains filtered or unexported fields
}

func NewPixMap

func NewPixMap(width, height int) *Pixmap

func NewPixMapC

func NewPixMapC(width, height, components int) *Pixmap

func NewPixmapFile

func NewPixmapFile(file *os.File) (*Pixmap, error)

func NewPixmapFileString

func NewPixmapFileString(path string) (*Pixmap, error)

func NewPixmapFromBytes

func NewPixmapFromBytes(bytes []byte) (*Pixmap, error)

func NewPixmapReader

func NewPixmapReader(file io.ReadCloser, _size int64) (*Pixmap, error)

func (*Pixmap) Dispose

func (pixmap *Pixmap) Dispose()

func (*Pixmap) NRGBA

func (pixmap *Pixmap) NRGBA() *image.NRGBA

func (*Pixmap) RGBA

func (pixmap *Pixmap) RGBA() *image.RGBA

func (*Pixmap) WritePng

func (pixmap *Pixmap) WritePng(destination string, flip bool) error

type Texture

type Texture interface {
	GetID() uint32
	GetWidth() int32
	GetHeight() int32
	GetRegion() TextureRegion
	GetLayers() int32
	SetFiltering(min, mag Filter)
	Bind(loc uint)
	GetLocation() uint
	Dispose()
}

type TextureAtlas

type TextureAtlas struct {
	*TextureMultiLayer
	// contains filtered or unexported fields
}

func NewTextureAtlas

func NewTextureAtlas(size, mipmaps int) *TextureAtlas

func NewTextureAtlasFormat

func NewTextureAtlasFormat(size int, format Format, mipmaps int, layers int) *TextureAtlas

func (*TextureAtlas) AddTexture

func (texture *TextureAtlas) AddTexture(name string, width, height int, data []uint8) *TextureRegion

func (*TextureAtlas) GetTexture

func (texture *TextureAtlas) GetTexture(name string) *TextureRegion

func (*TextureAtlas) NewLayer

func (texture *TextureAtlas) NewLayer()

type TextureMultiLayer

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

func NewTextureMultiLayer

func NewTextureMultiLayer(width, height, mipmaps, layers int) *TextureMultiLayer

func NewTextureMultiLayerFormat

func NewTextureMultiLayerFormat(width, height int, format Format, mipmaps int, layers int) *TextureMultiLayer

func (*TextureMultiLayer) Bind

func (texture *TextureMultiLayer) Bind(loc uint)

func (*TextureMultiLayer) Dispose

func (texture *TextureMultiLayer) Dispose()

func (*TextureMultiLayer) GenerateMipmaps

func (texture *TextureMultiLayer) GenerateMipmaps()

func (*TextureMultiLayer) GetHeight

func (texture *TextureMultiLayer) GetHeight() int32

func (*TextureMultiLayer) GetID

func (texture *TextureMultiLayer) GetID() uint32

func (*TextureMultiLayer) GetLayers

func (texture *TextureMultiLayer) GetLayers() int32

func (*TextureMultiLayer) GetLocation

func (texture *TextureMultiLayer) GetLocation() uint

func (*TextureMultiLayer) GetRegion

func (texture *TextureMultiLayer) GetRegion() TextureRegion

func (*TextureMultiLayer) GetWidth

func (texture *TextureMultiLayer) GetWidth() int32

func (*TextureMultiLayer) NewLayer

func (texture *TextureMultiLayer) NewLayer()

func (*TextureMultiLayer) SetData

func (texture *TextureMultiLayer) SetData(x, y, width, height, layer int, data []uint8)

func (*TextureMultiLayer) SetFiltering

func (texture *TextureMultiLayer) SetFiltering(min, mag Filter)

func (*TextureMultiLayer) SetManualMipmapping

func (texture *TextureMultiLayer) SetManualMipmapping(value bool)

type TextureRegion

type TextureRegion struct {
	Texture        Texture
	U1, U2, V1, V2 float32
	Width, Height  float32
	Layer          int32
}

type TextureSingle

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

func LoadTextureSingle

func LoadTextureSingle(img *image.RGBA, mipmaps int) *TextureSingle

func NewTextureSingle

func NewTextureSingle(width, height, mipmaps int) *TextureSingle

func NewTextureSingleFormat

func NewTextureSingleFormat(width, height int, format Format, mipmaps int) *TextureSingle

func (*TextureSingle) Bind

func (texture *TextureSingle) Bind(loc uint)

func (*TextureSingle) Dispose

func (texture *TextureSingle) Dispose()

func (*TextureSingle) GetHeight

func (texture *TextureSingle) GetHeight() int32

func (*TextureSingle) GetID

func (texture *TextureSingle) GetID() uint32

func (*TextureSingle) GetLayers

func (texture *TextureSingle) GetLayers() int32

func (*TextureSingle) GetLocation

func (texture *TextureSingle) GetLocation() uint

func (*TextureSingle) GetRegion

func (texture *TextureSingle) GetRegion() TextureRegion

func (*TextureSingle) GetWidth

func (texture *TextureSingle) GetWidth() int32

func (*TextureSingle) SetData

func (texture *TextureSingle) SetData(x, y, width, height int, data []uint8)

func (*TextureSingle) SetFiltering

func (texture *TextureSingle) SetFiltering(min, mag Filter)

Jump to

Keyboard shortcuts

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