window

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Package window provides Go bindings for Android NativeWindow.

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 Format

type Format int32
const (
	Rgba8888 Format = 1
	Rgbx8888 Format = 2
	Rgb565   Format = 4
)

func (Format) String

func (v Format) String() string

type NativeWindowTransform

type NativeWindowTransform int32
const (
	ANATIVEWINDOW_TRANSFORM_IDENTITY          NativeWindowTransform = 0
	ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL NativeWindowTransform = 1
	ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL   NativeWindowTransform = 2
	ANATIVEWINDOW_TRANSFORM_ROTATE_90         NativeWindowTransform = 4
	ANATIVEWINDOW_TRANSFORM_ROTATE_180        NativeWindowTransform = 3
	ANATIVEWINDOW_TRANSFORM_ROTATE_270        NativeWindowTransform = 7
)

type NativeWindow_Buffer

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

NativeWindow_Buffer wraps the NDK ANativeWindow_Buffer handle.

func NewNativeWindow_BufferFromPointer

func NewNativeWindow_BufferFromPointer(ptr unsafe.Pointer) *NativeWindow_Buffer

NewNativeWindow_BufferFromPointer wraps a raw ANativeWindow_Buffer pointer.

func (*NativeWindow_Buffer) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

type NativeWindow_ChangeFrameRateStrategy

type NativeWindow_ChangeFrameRateStrategy int32
const (
	ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS NativeWindow_ChangeFrameRateStrategy = 0
	ANATIVEWINDOW_CHANGE_FRAME_RATE_ALWAYS           NativeWindow_ChangeFrameRateStrategy = 1
)

type NativeWindow_FrameRateCompatibility

type NativeWindow_FrameRateCompatibility int32
const (
	ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT      NativeWindow_FrameRateCompatibility = 0
	ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE NativeWindow_FrameRateCompatibility = 1
)

type Window

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

Window wraps the NDK ANativeWindow handle.

func NewWindowFromPointer

func NewWindowFromPointer(ptr unsafe.Pointer) *Window

NewWindowFromPointer wraps a raw ANativeWindow pointer.

func (*Window) Acquire

func (h *Window) Acquire()

Acquire calls the underlying NDK function.

func (*Window) ClearFrameRate

func (h *Window) ClearFrameRate() error

ClearFrameRate calls the underlying NDK function.

func (*Window) Close

func (h *Window) Close() error

Close releases the underlying NDK handle.

func (*Window) Format

func (h *Window) Format() int32

Format returns the value directly.

func (*Window) GetBuffersDataSpace

func (h *Window) GetBuffersDataSpace() error

GetBuffersDataSpace calls the underlying NDK function.

func (*Window) GetBuffersDefaultDataSpace

func (h *Window) GetBuffersDefaultDataSpace() error

GetBuffersDefaultDataSpace calls the underlying NDK function.

func (*Window) Height

func (h *Window) Height() int32

Height returns the value directly.

func (*Window) Pointer

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

Pointer returns the underlying pointer as unsafe.Pointer.

func (*Window) SetBuffersDataSpace

func (h *Window) SetBuffersDataSpace(dataSpace int32) error

SetBuffersDataSpace calls the underlying NDK function.

func (*Window) SetBuffersGeometry

func (h *Window) SetBuffersGeometry(width int32, height int32, format Format) error

SetBuffersGeometry calls the underlying NDK function.

func (*Window) SetBuffersTransform

func (h *Window) SetBuffersTransform(transform int32) error

SetBuffersTransform calls the underlying NDK function.

func (*Window) SetFrameRate

func (h *Window) SetFrameRate(frameRate float32, compatibility int8) error

SetFrameRate calls the underlying NDK function.

func (*Window) SetFrameRateWithChangeStrategy

func (h *Window) SetFrameRateWithChangeStrategy(frameRate float32, compatibility int8, changeFrameRateStrategy int8) error

SetFrameRateWithChangeStrategy calls the underlying NDK function.

func (*Window) TryAllocateBuffers

func (h *Window) TryAllocateBuffers()

TryAllocateBuffers calls the underlying NDK function.

func (*Window) UnlockAndPost

func (h *Window) UnlockAndPost() error

UnlockAndPost calls the underlying NDK function.

func (*Window) Width

func (h *Window) Width() int32

Width returns the value directly.

Jump to

Keyboard shortcuts

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