ebitengine

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 13 Imported by: 1

Documentation

Overview

Package ebitengine uses Ebitengine technology to run the game.

Index

Constants

This section is empty.

Variables

View Source
var AudioStream interface {
	// Read reads generated audio into p buffer.
	//
	// The format is:
	//	[data]      = [sample 0] [sample 1] [sample 2] ...
	//	[sample *]  = [channel left] [channel right] ...
	//	[channel *] = [bits 0-15]
	//
	// Sample rate must be 44100, channel count 2 (stereo) and bit depth 16.
	//
	// Byte ordering is little endian.
	//
	// See [io.Reader] for documentation how to implement this method.
	// When error is returned then game stops with the error.
	Read(p []byte) (n int, err error)
}

AudioStream is an abstraction used by ebitengine back-end to consume audio stream generated by the game. The stream will be played back to the user. By default, audio package is used. Game developers could use a different audio system though. In such case they could set the AudioStream variable to their own implementation.

Functions

func MustRun added in v0.19.0

func MustRun()

MustRun does the same as Run, but panics instead of returning an error.

Useful for writing unit tests and quick and dirty prototypes. Do not use on production ;)

func Run added in v0.19.0

func Run() error

Run opens the window and runs the game loop. It must be called from the main thread.

Types

This section is empty.

Jump to

Keyboard shortcuts

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