driver

package
v1.10.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IsPlayground = time.Now().UnixNano() == 1257894000000000000

IsPlayground indicates whether the current environment is the Go Playground (play.golang.org) or not. The fixed time is explicitly defined. See "About the Playground" at play.golang.org.

View Source
var RegularTermination = errors.New("regular termination")

RegularTermination represents a regular termination. Run can return this error, and if this error is received, the game loop should be terminated as soon as possible.

Functions

This section is empty.

Types

type Address

type Address int
const (
	AddressClampToZero Address = iota
	AddressRepeat
)

type CompositeMode

type CompositeMode int
const (
	CompositeModeUnknown    CompositeMode = iota - 1
	CompositeModeSourceOver               // This value must be 0 (= initial value)
	CompositeModeClear
	CompositeModeCopy
	CompositeModeDestination
	CompositeModeDestinationOver
	CompositeModeSourceIn
	CompositeModeDestinationIn
	CompositeModeSourceOut
	CompositeModeDestinationOut
	CompositeModeSourceAtop
	CompositeModeDestinationAtop
	CompositeModeXor
	CompositeModeLighter

	CompositeModeMax = CompositeModeLighter
)

func (CompositeMode) Operations

func (c CompositeMode) Operations() (src Operation, dst Operation)

type Filter

type Filter int
const (
	FilterNearest Filter = iota + 1 // TODO: Remove '+ 1' when ebiten.FilterDefault can be removed.
	FilterLinear
	FilterScreen
)

type GamepadButton

type GamepadButton int
const (
	GamepadButton0 GamepadButton = iota
	GamepadButton1
	GamepadButton2
	GamepadButton3
	GamepadButton4
	GamepadButton5
	GamepadButton6
	GamepadButton7
	GamepadButton8
	GamepadButton9
	GamepadButton10
	GamepadButton11
	GamepadButton12
	GamepadButton13
	GamepadButton14
	GamepadButton15
	GamepadButton16
	GamepadButton17
	GamepadButton18
	GamepadButton19
	GamepadButton20
	GamepadButton21
	GamepadButton22
	GamepadButton23
	GamepadButton24
	GamepadButton25
	GamepadButton26
	GamepadButton27
	GamepadButton28
	GamepadButton29
	GamepadButton30
	GamepadButton31
)

type Graphics

type Graphics interface {
	SetThread(thread *thread.Thread)
	Begin()
	End()
	SetWindow(window uintptr)
	SetVertices(vertices []float32, indices []uint16)
	Flush()
	NewImage(width, height int) (Image, error)
	NewScreenFramebufferImage(width, height int) (Image, error)
	Reset() error
	Draw(indexLen int, indexOffset int, mode CompositeMode, colorM *affine.ColorM, filter Filter, address Address) error
	SetVsyncEnabled(enabled bool)
	VDirection() VDirection
	NeedsRestoring() bool
	IsGL() bool
	HasHighPrecisionFloat() bool
	MaxImageSize() int
}

type Image

type Image interface {
	Dispose()
	IsInvalidated() bool
	Pixels() ([]byte, error)
	SetAsDestination()
	SetAsSource()
	ReplacePixels(pixels []byte, x, y, width, height int)
}

type Input

type Input interface {
	CursorPosition() (x, y int)
	GamepadAxis(id int, axis int) float64
	GamepadAxisNum(id int) int
	GamepadButtonNum(id int) int
	GamepadIDs() []int
	IsGamepadButtonPressed(id int, button GamepadButton) bool
	IsKeyPressed(key Key) bool
	IsMouseButtonPressed(button MouseButton) bool
	ResetForFrame()
	RuneBuffer() []rune
	TouchIDs() []int
	TouchPosition(id int) (x, y int)
	Wheel() (xoff, yoff float64)
}

type Key

type Key int
const (
	Key0 Key = iota
	Key1
	Key2
	Key3
	Key4
	Key5
	Key6
	Key7
	Key8
	Key9
	KeyA
	KeyB
	KeyC
	KeyD
	KeyE
	KeyF
	KeyG
	KeyH
	KeyI
	KeyJ
	KeyK
	KeyL
	KeyM
	KeyN
	KeyO
	KeyP
	KeyQ
	KeyR
	KeyS
	KeyT
	KeyU
	KeyV
	KeyW
	KeyX
	KeyY
	KeyZ
	KeyAlt
	KeyApostrophe
	KeyBackslash
	KeyBackspace
	KeyCapsLock
	KeyComma
	KeyControl
	KeyDelete
	KeyDown
	KeyEnd
	KeyEnter
	KeyEqual
	KeyEscape
	KeyF1
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	KeyGraveAccent
	KeyHome
	KeyInsert
	KeyKP0
	KeyKP1
	KeyKP2
	KeyKP3
	KeyKP4
	KeyKP5
	KeyKP6
	KeyKP7
	KeyKP8
	KeyKP9
	KeyKPAdd
	KeyKPDecimal
	KeyKPDivide
	KeyKPEnter
	KeyKPEqual
	KeyKPMultiply
	KeyKPSubtract
	KeyLeft
	KeyLeftBracket
	KeyMenu
	KeyMinus
	KeyNumLock
	KeyPageDown
	KeyPageUp
	KeyPause
	KeyPeriod
	KeyPrintScreen
	KeyRight
	KeyRightBracket
	KeyScrollLock
	KeySemicolon
	KeyShift
	KeySlash
	KeySpace
	KeyTab
	KeyUp
)

type MouseButton

type MouseButton int
const (
	MouseButtonLeft MouseButton = iota
	MouseButtonRight
	MouseButtonMiddle
)

type Operation

type Operation int
const (
	Zero Operation = iota
	One
	SrcAlpha
	DstAlpha
	OneMinusSrcAlpha
	OneMinusDstAlpha
)

type UI

type UI interface {
	DeviceScaleFactor() float64
	IsCursorVisible() bool
	IsFullscreen() bool
	IsRunnableInBackground() bool
	IsVsyncEnabled() bool
	IsWindowDecorated() bool
	IsWindowResizable() bool
	Run(width, height int, scale float64, title string, context UIContext, graphics Graphics) error
	RunWithoutMainLoop(width, height int, scale float64, title string, context UIContext, graphics Graphics) <-chan error
	ScreenPadding() (x0, y0, x1, y1 float64)
	ScreenScale() float64
	ScreenSizeInFullscreen() (int, int)
	SetCursorVisible(visible bool)
	SetFullscreen(fullscreen bool)
	SetRunnableInBackground(runnableInBackground bool)
	SetScreenScale(scale float64)
	SetScreenSize(width, height int)
	SetVsyncEnabled(enabled bool)
	SetWindowDecorated(decorated bool)
	SetWindowIcon(iconImages []image.Image)
	SetWindowResizable(resizable bool)
	SetWindowTitle(title string)
	Input() Input
}

type UIContext

type UIContext interface {
	SetSize(width, height int, scale float64)
	Update(afterFrameUpdate func()) error
	SuspendAudio()
	ResumeAudio()
}

type VDirection

type VDirection int
const (
	VUpward VDirection = iota
	VDownward
)

Jump to

Keyboard shortcuts

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