sdl

package
v0.0.0-...-226917b Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(f func(*ui.State))

Do queues a function for execution on the ui goroutine. Do should not be called before Show.

func Show

func Show(opt Options)

Show opens a window and blocks until it is closed.

Types

type Options

type Options struct {

	// Title is the window's title.
	Title string
	// Width and Height set the window's size.
	// If either is 0, it will be replaced by the root component's preferred size.
	Width, Height int
	// Root is the root component of the window.
	// Must not be nil
	Root ui.Component
	//
	Theme ui.Theme
	// FontLookup should create a font lookup for the specified DPI setting. It will only be called once.
	// Must not be nil
	FontLookup gldraw.FontLookup
	//
	IconLookup gldraw.IconLookup
	// Init will be called once after the window is created. It can be used for any setup that requires access to a *ui.State.
	Init func(*ui.State)
	// Update will be called every time the application is updated.
	Update func(*ui.State)
	// Close
	Close func(*ui.State)
	// SDLInit will be called after the window is created, but before it is shown.
	// Can be used for any SDL-specific initialisation.
	SDLInit func(*sdl.Window)
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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