hid

package
v0.0.0-...-e1c21c9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Zlib Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Keys [1024]int

Functions

func CreateWindow

func CreateWindow(option *WindowOptions)

func RegisterInputCallback

func RegisterInputCallback(callback InputCallback)

func RegisterWindowCallback

func RegisterWindowCallback(callback WindowCallback)

Types

type AttrTable

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

func (*AttrTable) File

func (at *AttrTable) File(init func() string) string

func (*AttrTable) Lang

func (at *AttrTable) Lang(init func() string) string

type InputCallback

type InputCallback interface {
	OnKeyEvent(key int, pressed bool)
	OnPointEvent(key int, pressed bool, x, y float32)
}

输入系统

type WindowCallback

type WindowCallback interface {
	// 窗口创建
	OnCreate(w, h float32, pixelRatio float32)

	// Resize...
	OnResize(w, h int32)

	// 窗口循环
	OnLoop()

	// 窗口销毁
	OnDestroy()

	// 窗口切回?
	OnResume()

	// 窗口切入后台
	OnPause()

	// 窗口焦点变化
	OnFocusChanged(focused bool)
}

窗口生命周期

type WindowOptions

type WindowOptions struct {
	Title      string
	Width      int
	Height     int
	Clear      f32.Vec4
	FullScreen bool
	NoVsync    bool
	NoTitleBar bool
	Resizable  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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