vsdl

package module
v0.0.0-...-09811d8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2018 License: MPL-2.0 Imports: 10 Imported by: 0

README

Very Simple Direct Media Library

Documentation

Index

Constants

View Source
const (
	NoMod         uint16 = 0x0000
	LeftShiftMod  uint16 = 0x0001
	RightShiftMod uint16 = 0x0002
	LeftCtrlMod   uint16 = 0x0040
	RightCtrlMod  uint16 = 0x0080
	LeftAltMod    uint16 = 0x0100
	RightAltMod   uint16 = 0x0200
	LeftGuiMod    uint16 = 0x0400
	RightGuiMod   uint16 = 0x0800
	NumMod        uint16 = 0x1000
	CapsMod       uint16 = 0x2000
	ModeMod       uint16 = 0x4000
)

Variables

This section is empty.

Functions

func Events

func Events() <-chan Event

func Initialize

func Initialize(f func() error, configs ...Config) error

func Present

func Present(img image.Image) (*sync.WaitGroup, error)

func ToggleFullscreen

func ToggleFullscreen() (bool, error)

Types

type Config

type Config func() error

func ConfigWithLibrary

func ConfigWithLibrary(p string) Config

func ConfigWithLogger

func ConfigWithLogger(l *logpkg.Logger) Config

func ConfigWithRenderer

func ConfigWithRenderer(size, logical image.Point) Config

type Error

type Error struct {
	String   string
	Internal error
}

func (*Error) Error

func (e *Error) Error() string

type Event

type Event interface {
	Release()
}

type KeyDownEvent

type KeyDownEvent struct {
	State  uint8
	Repeat uint8

	Keysym Keysym
	// contains filtered or unexported fields
}

func (*KeyDownEvent) Release

func (e *KeyDownEvent) Release()

type KeyUpEvent

type KeyUpEvent struct {
	State  uint8
	Repeat uint8

	Keysym Keysym
	// contains filtered or unexported fields
}

func (*KeyUpEvent) Release

func (e *KeyUpEvent) Release()

type Keycode

type Keycode int32

Keycode (https://wiki.libsdl.org/SDL_Keycode)

const (
	ReturnKey    Keycode = '\r'
	EscKey       Keycode = '\033'
	BackSpaceKey Keycode = '\b'
	TabKey       Keycode = '\t'
	SpaceKey     Keycode = ' '
	DeleteKey    Keycode = '\177'
)

type Keysym

type Keysym struct {
	Sym Keycode
	Mod uint16
	// contains filtered or unexported fields
}

Keysym (https://wiki.libsdl.org/SDL_Keysym)

func (Keysym) IsKey

func (ks Keysym) IsKey(k Keycode) bool

func (Keysym) IsMod

func (ks Keysym) IsMod(m uint16) bool

func (Keysym) String

func (ks Keysym) String() string

type MouseButtonEvent

type MouseButtonEvent struct {
	Which  uint32
	Button uint8
	State  uint8

	X int32
	Y int32
	// contains filtered or unexported fields
}

MouseButtonEvent (https://wiki.libsdl.org/SDL_MouseButtonEvent)

func (*MouseButtonEvent) Release

func (e *MouseButtonEvent) Release()

type MouseMotionEvent

type MouseMotionEvent struct {
	Which uint32
	State uint32
	X     int32
	Y     int32
	XRel  int32
	YRel  int32
	// contains filtered or unexported fields
}

MouseMotionEvent (https://wiki.libsdl.org/SDL_MouseMotionEvent)

func (*MouseMotionEvent) Release

func (e *MouseMotionEvent) Release()

type MouseWheelEvent

type MouseWheelEvent struct {
	Which     uint32
	X         int32
	Y         int32
	Direction uint32
	// contains filtered or unexported fields
}

MouseWheelEvent (https://wiki.libsdl.org/SDL_MouseWheelEvent)

func (*MouseWheelEvent) Release

func (e *MouseWheelEvent) Release()

type QuitEvent

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

func (*QuitEvent) Release

func (e *QuitEvent) Release()

type WindowEvent

type WindowEvent struct {
	Event uint8

	Data1 int32
	Data2 int32
	// contains filtered or unexported fields
}

WindowEvent (https://wiki.libsdl.org/SDL_WindowEvent)

func (*WindowEvent) Release

func (e *WindowEvent) Release()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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