texture

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package texture is native.Texture: an image on the GPU that a native module's implementation draws into, as IOSurfaces on macOS, and that native UI shows as any image, with no copy through the CPU but for the CPU renderer's.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Texture

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

Texture is an image a native module presents frames into.

func Lookup

func Lookup(id uint64) *Texture

Lookup returns the texture of id, or nil once it is gone.

func New

func New() *Texture

New makes a texture, which shows nothing until a frame is presented.

func (*Texture) Frame

func (t *Texture) Frame(key any, invalidate func()) *scene.Image

Frame returns the image a frame draws, showing the surface presented last, or nil before any. invalidate asks the window of key for a frame, which the next present calls. Main thread only.

func (*Texture) ID

func (t *Texture) ID() uint64

ID identifies the texture for the platform.

func (*Texture) Present

func (t *Texture) Present(surface uintptr)

Present shows surface, an IOSurfaceRef whose reference it takes, in the next frame of the windows showing the texture, from any thread.

func (*Texture) Size

func (t *Texture) Size() (w, h float32)

Size returns the size of the frames presented last, in pixels, which Image lays the texture out at, as DIPs.

Jump to

Keyboard shortcuts

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