display

package
v0.0.0-...-c4467fc Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

func GetDriver

func GetDriver(name string) Driver

GetDriver returns the driver with the given name, or nil if no driver with that name is installed.

type DriverDebugger

type DriverDebugger interface {
	AttachGameboy(*gameboy.GameBoy) // find a better way to do this
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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