drivers

package
v0.0.0-...-b80102e Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List() (l []string)

List returns a list of available drivers

func Set

func Set(name string, f func() (Driver, error))

Set sets the driver factory function for the given name/ID

Types

type Driver

type Driver interface {
	CreateWindow(string, int, int, WindowType, Window, func(events.Event)) Window
	CreateSurface(int, int) Surface
	Release() error
}

Driver defines an interface for the drivers to implement.

func Get

func Get(name string) (Driver, error)

Get returns the driver for the given name/ID

type DriverNotFoundError

type DriverNotFoundError struct {
	Driver string
}

func (DriverNotFoundError) Error

func (d DriverNotFoundError) Error() string

type Surface

type Surface interface {
	// Implement the draw interface to enable other libraries to interact
	// with this surface.
	draw.Image
}

type Window

type Window interface {
	Title() string
	SetTitle(string)

	Size() (int, int)
	SetSize(int, int)

	Position() (int, int)
	SetPosition(int, int)

	Render(Surface, int, int)

	Close()
}

type WindowType

type WindowType byte
const (
	NormalWindow WindowType = iota
	DialogWindow
	SplashWindow
	MenuWindow
)

Directories

Path Synopsis
Package dummy contains the dummy driver.
Package dummy contains the dummy driver.

Jump to

Keyboard shortcuts

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