graphicsdriver

package
v2.7.10 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidImageID  = 0
	InvalidShaderID = 0
)

Variables

View Source
var BlendClear = Blend{
	BlendFactorSourceRGB:        BlendFactorZero,
	BlendFactorSourceAlpha:      BlendFactorZero,
	BlendFactorDestinationRGB:   BlendFactorZero,
	BlendFactorDestinationAlpha: BlendFactorZero,
	BlendOperationRGB:           BlendOperationAdd,
	BlendOperationAlpha:         BlendOperationAdd,
}
View Source
var BlendCopy = Blend{
	BlendFactorSourceRGB:        BlendFactorOne,
	BlendFactorSourceAlpha:      BlendFactorOne,
	BlendFactorDestinationRGB:   BlendFactorZero,
	BlendFactorDestinationAlpha: BlendFactorZero,
	BlendOperationRGB:           BlendOperationAdd,
	BlendOperationAlpha:         BlendOperationAdd,
}
View Source
var BlendSourceOver = Blend{
	BlendFactorSourceRGB:        BlendFactorOne,
	BlendFactorSourceAlpha:      BlendFactorOne,
	BlendFactorDestinationRGB:   BlendFactorOneMinusSourceAlpha,
	BlendFactorDestinationAlpha: BlendFactorOneMinusSourceAlpha,
	BlendOperationRGB:           BlendOperationAdd,
	BlendOperationAlpha:         BlendOperationAdd,
}

Functions

This section is empty.

Types

type Blend added in v2.5.0

type Blend struct {
	BlendFactorSourceRGB        BlendFactor
	BlendFactorSourceAlpha      BlendFactor
	BlendFactorDestinationRGB   BlendFactor
	BlendFactorDestinationAlpha BlendFactor
	BlendOperationRGB           BlendOperation
	BlendOperationAlpha         BlendOperation
}

type BlendFactor added in v2.5.0

type BlendFactor byte
const (
	BlendFactorZero BlendFactor = iota
	BlendFactorOne
	BlendFactorSourceColor
	BlendFactorOneMinusSourceColor
	BlendFactorSourceAlpha
	BlendFactorOneMinusSourceAlpha
	BlendFactorDestinationColor
	BlendFactorOneMinusDestinationColor
	BlendFactorDestinationAlpha
	BlendFactorOneMinusDestinationAlpha
	BlendFactorSourceAlphaSaturated
)

type BlendOperation added in v2.5.0

type BlendOperation byte
const (
	BlendOperationAdd BlendOperation = iota
	BlendOperationSubtract
	BlendOperationReverseSubtract
	BlendOperationMin
	BlendOperationMax
)

type DstRegion added in v2.5.0

type DstRegion struct {
	Region     image.Rectangle
	IndexCount int
}

type FillRule added in v2.7.0

type FillRule int
const (
	FillAll FillRule = iota
	NonZero
	EvenOdd
)

func (FillRule) String added in v2.7.0

func (f FillRule) String() string

type Graphics

type Graphics interface {
	Initialize() error
	Begin() error
	End(present bool) error
	SetTransparent(transparent bool)
	SetVertices(vertices []float32, indices []uint32) error
	NewImage(width, height int) (Image, error)
	NewScreenFramebufferImage(width, height int) (Image, error)
	SetVsyncEnabled(enabled bool)
	NeedsClearingScreen() bool
	MaxImageSize() int

	NewShader(program *shaderir.Program) (Shader, error)

	// DrawTriangles draws an image onto another image with the given parameters.
	DrawTriangles(dst ImageID, srcs [graphics.ShaderImageCount]ImageID, shader ShaderID, dstRegions []DstRegion, indexOffset int, blend Blend, uniforms []uint32, fillRule FillRule) error
}

type Image

type Image interface {
	ID() ImageID
	Dispose()
	ReadPixels(args []PixelsArgs) error
	WritePixels(args []PixelsArgs) error
}

type ImageID

type ImageID int

type PixelsArgs added in v2.6.0

type PixelsArgs struct {
	Pixels []byte
	Region image.Rectangle
}

type Resetter added in v2.6.0

type Resetter interface {
	Reset() error
}

type Shader

type Shader interface {
	ID() ShaderID
	Dispose()
}

type ShaderID

type ShaderID int

Directories

Path Synopsis
ca
Package ca provides access to Apple's Core Animation API (https://developer.apple.com/documentation/quartzcore).
Package ca provides access to Apple's Core Animation API (https://developer.apple.com/documentation/quartzcore).
mtl
Package mtl provides access to Apple's Metal API (https://developer.apple.com/documentation/metal).
Package mtl provides access to Apple's Metal API (https://developer.apple.com/documentation/metal).
gl

Jump to

Keyboard shortcuts

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