Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var InstalledDrivers []*InstalledDriver
InstalledDrivers is a list of all the installed drivers. This variable is exported so that it can be used by the main program to determine which drivers can be used. Drivers should call display.Install in their init() function.
Functions ¶
func Init ¶
func Init()
Init initializes the display drivers and ensures at least one has been installed.
func Install ¶
func Install(name string, driver Driver, options []DriverOption)
Install registers a display driver with the given name.
func RegisterFlags ¶
func RegisterFlags()
RegisterFlags iterates through all the display driver options and registers them with the flag package.
Types ¶
type Driver ¶
type Driver interface { // Start the display driver. Start(c emulator.Controller, fb <-chan []byte, pressed, released chan<- io.Button) error // Stop the display driver. Stop() error }
Driver is the interface that wraps the basic methods for a display driver.
type DriverDebugger ¶
type DriverOption ¶
type DriverOption struct { Name string // name of the option Default any // default value of the option Value any // pointer to the value of the option Description string // description of the option Type string // "int", "bool", "string", "float" }
DriverOption is a display driver option. This is used to configure a display driver.
type InstalledDriver ¶
type InstalledDriver struct { Name string Options []DriverOption Driver }
InstalledDriver is a driver that has been installed. This is used to allow drivers to register their name.