texture

package
v0.0.0-...-4142f2f Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var INDICES = [...]uint16{
	0, 1, 2,
	2, 1, 3,
}
View Source
var TextureShaderCode string
View Source
var VERTICES = [...]Vertex{
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
	{
		// contains filtered or unexported fields
	},
}
View Source
var VertexBufferLayout = wgpu.VertexBufferLayout{
	ArrayStride: uint64(unsafe.Sizeof(Vertex{})),
	StepMode:    wgpu.VertexStepMode_Vertex,
	Attributes: []wgpu.VertexAttribute{
		{
			Offset:         0,
			ShaderLocation: 0,
			Format:         wgpu.VertexFormat_Float32x3,
		},
		{
			Offset:         uint64(unsafe.Sizeof([3]float32{})),
			ShaderLocation: 1,
			Format:         wgpu.VertexFormat_Float32x2,
		},
	},
}

Functions

This section is empty.

Types

type Texture

type Texture struct {
	*wgpu.SwapChainDescriptor
	*wgpu.Device
	*wgpu.Texture
	*wgpu.TextureView
	*wgpu.Sampler
	*wgpu.BindGroup
	*wgpu.BindGroupLayout
	*wgpu.RenderPipeline

	*common.Transform
	// contains filtered or unexported fields
}

func TextureFromImage

func TextureFromImage(surface common.Surface, d *wgpu.Device, scd *wgpu.SwapChainDescriptor, img image.Image, label string) (t *Texture, err error)

func (*Texture) Destroy

func (t *Texture) Destroy()

func (*Texture) FlipHorizontal

func (t *Texture) FlipHorizontal()

func (*Texture) FlipVertical

func (t *Texture) FlipVertical()

func (*Texture) GetCurrentClipSize

func (t *Texture) GetCurrentClipSize() (float32, float32)

func (*Texture) GetCurrentSize

func (t *Texture) GetCurrentSize() (float32, float32)

func (*Texture) IsDisposed

func (t *Texture) IsDisposed() bool

func (*Texture) RenderPass

func (t *Texture) RenderPass(pass *wgpu.RenderPassEncoder)

func (*Texture) SetClipRect

func (t *Texture) SetClipRect(minX, minY, maxX, maxY float32)

func (*Texture) SetDefaultClip

func (t *Texture) SetDefaultClip()

func (*Texture) UpdateImage

func (t *Texture) UpdateImage(img image.Image) error

type Vertex

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

Jump to

Keyboard shortcuts

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