texture

package
v0.0.0-...-124f97e Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Diffuse = Slot("diffuse")
View Source
const FilterLinear = Filter(core1_0.FilterLinear)
View Source
const FilterNearest = Filter(core1_0.FilterNearest)
View Source
const Normal = Slot("normal")

Variables

View Source
var Checker = PathRef("textures/uv_checker.png")

Functions

This section is empty.

Types

type Args

type Args struct {
	Filter Filter
	Wrap   Wrap
	Aspect core1_0.ImageAspectFlags
	Usage  core1_0.ImageUsageFlags
	Border core1_0.BorderColor
}

type Filter

type Filter core1_0.Filter

type Ref

type Ref interface {
	Key() string
	Version() int

	// ImageData is called by texture caches and loaders, and should return the image data.
	// todo: This interface is a bit too simple as it does not allow us to pass
	//       formats, filters and aspects.
	ImageData() *image.Data
	TextureArgs() Args
}

func PathArgsRef

func PathArgsRef(path string, args Args) Ref

func PathRef

func PathRef(path string) Ref

type Slot

type Slot string

type T

type T interface {
	device.Resource[core1_0.Sampler]
	Key() string
	Image() image.T
	View() image.View
	Size() vec3.T
}

func FromImage

func FromImage(device device.T, key string, img image.T, args Args) (T, error)

func FromView

func FromView(device device.T, key string, view image.View, args Args) (T, error)

func New

func New(device device.T, key string, width, height int, format core1_0.Format, args Args) (T, error)

Jump to

Keyboard shortcuts

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