surfacetexture

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package surfacetexture provides Go bindings for Android SurfaceTexture.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error int32

Error represents an NDK error code.

func (Error) Error

func (e Error) Error() string

type NativeWindow

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

NativeWindow wraps the NDK ANativeWindow handle.

func NewNativeWindowFromPointer

func NewNativeWindowFromPointer(ptr unsafe.Pointer) *NativeWindow

NewNativeWindowFromPointer wraps a raw ANativeWindow pointer.

func NewNativeWindowFromUintPtr added in v0.0.4

func NewNativeWindowFromUintPtr(ptr uintptr) *NativeWindow

NewNativeWindowFromUintPtr wraps a uintptr as a NativeWindow. The caller must ensure ptr points to a valid ANativeWindow.

func (*NativeWindow) Pointer

func (h *NativeWindow) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*NativeWindow) UintPtr added in v0.0.4

func (h *NativeWindow) UintPtr() uintptr

UintPtr returns the underlying pointer as a uintptr. This is useful for interop with gomobile bind, golang.org/x/mobile, gioui.org, and other packages that represent native handles as uintptr.

type SurfaceTexture

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

SurfaceTexture wraps the NDK ASurfaceTexture handle.

func NewSurfaceTextureFromPointer

func NewSurfaceTextureFromPointer(ptr unsafe.Pointer) *SurfaceTexture

NewSurfaceTextureFromPointer wraps a raw ASurfaceTexture pointer.

func NewSurfaceTextureFromUintPtr added in v0.0.4

func NewSurfaceTextureFromUintPtr(ptr uintptr) *SurfaceTexture

NewSurfaceTextureFromUintPtr wraps a uintptr as a SurfaceTexture. The caller must ensure ptr points to a valid ASurfaceTexture.

func (*SurfaceTexture) AcquireWindow

func (h *SurfaceTexture) AcquireWindow() *NativeWindow

AcquireWindow creates a new NativeWindow from this SurfaceTexture.

func (*SurfaceTexture) AttachToGLContext

func (h *SurfaceTexture) AttachToGLContext(texName uint32) error

AttachToGLContext calls the underlying NDK function.

func (*SurfaceTexture) Close

func (h *SurfaceTexture) Close() error

Close releases the underlying NDK handle.

func (*SurfaceTexture) DetachFromGLContext

func (h *SurfaceTexture) DetachFromGLContext() error

DetachFromGLContext calls the underlying NDK function.

func (*SurfaceTexture) Pointer

func (h *SurfaceTexture) Pointer() unsafe.Pointer

Pointer returns the underlying pointer as unsafe.Pointer.

func (*SurfaceTexture) Timestamp

func (h *SurfaceTexture) Timestamp() int64

Timestamp returns the value directly.

func (*SurfaceTexture) TransformMatrix

func (h *SurfaceTexture) TransformMatrix(mtx *[16]float32)

TransformMatrix calls the underlying NDK function.

func (*SurfaceTexture) UintPtr added in v0.0.4

func (h *SurfaceTexture) UintPtr() uintptr

UintPtr returns the underlying pointer as a uintptr. This is useful for interop with gomobile bind, golang.org/x/mobile, gioui.org, and other packages that represent native handles as uintptr.

func (*SurfaceTexture) UpdateTexImage

func (h *SurfaceTexture) UpdateTexImage() error

UpdateTexImage calls the underlying NDK function.

Jump to

Keyboard shortcuts

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