Documentation ¶
Index ¶
- type BGR555
- type EbitenRenderer
- func (er *EbitenRenderer) Draw(screen *ebiten.Image)
- func (er *EbitenRenderer) Layout(outsideWidth, outsideHeight int) (int, int)
- func (er *EbitenRenderer) Render(screen *Screen)
- func (er *EbitenRenderer) Run()
- func (er *EbitenRenderer) SetRomTitle(title string)
- func (er *EbitenRenderer) Stop()
- func (er *EbitenRenderer) Update() error
- type ImageRenderer
- type NoOpRenderer
- type Pixel
- type Renderer
- type Screen
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BGR555 ¶
BGR555 represents 16-bit opaque color, each channel uses 5 bits with red in the least significant bits
func (BGR555) ApplyBrightness ¶
ApplyBrightness apply the given brightness from 0 to 15 If the brightness is 0 we return a black color otherwise we replace the colors by color * brightness + 1 / 16
func (BGR555) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
type EbitenRenderer ¶
type EbitenRenderer struct {
// contains filtered or unexported fields
}
EbitenRenderer is a Renderer implementation using ebiten
func (*EbitenRenderer) Draw ¶
func (er *EbitenRenderer) Draw(screen *ebiten.Image)
update copies the content of the offscreenBuffer to the screen
func (*EbitenRenderer) Layout ¶
func (er *EbitenRenderer) Layout(outsideWidth, outsideHeight int) (int, int)
func (*EbitenRenderer) Render ¶
func (er *EbitenRenderer) Render(screen *Screen)
Render updates the offscreen buffer with the new SNES screen content
func (*EbitenRenderer) Run ¶
func (er *EbitenRenderer) Run()
Run starts the ebiten main loop should be called on the main thread
func (*EbitenRenderer) SetRomTitle ¶
func (er *EbitenRenderer) SetRomTitle(title string)
SetRomTitle stores the new title if ebiten is not yet running or set the title directly
func (*EbitenRenderer) Stop ¶
func (er *EbitenRenderer) Stop()
Stop implements the Renderer interface
func (*EbitenRenderer) Update ¶
func (er *EbitenRenderer) Update() error
type ImageRenderer ¶
func NewImageRenderer ¶
func NewImageRenderer(width, height int, path string) *ImageRenderer
func (*ImageRenderer) Render ¶
func (i *ImageRenderer) Render(screen *Screen)
func (ImageRenderer) Run ¶
func (i ImageRenderer) Run()
func (ImageRenderer) SetRomTitle ¶
func (i ImageRenderer) SetRomTitle(string)
func (ImageRenderer) Stop ¶
func (i ImageRenderer) Stop()
type NoOpRenderer ¶
type NoOpRenderer struct{}
func (NoOpRenderer) Render ¶
func (n NoOpRenderer) Render(*Screen)
func (NoOpRenderer) Run ¶
func (n NoOpRenderer) Run()
func (NoOpRenderer) SetRomTitle ¶
func (n NoOpRenderer) SetRomTitle(string)
func (NoOpRenderer) Stop ¶
func (n NoOpRenderer) Stop()
type Renderer ¶
Renderer defines the interface required to render pixels
func NewRenderer ¶
NewRenderer returns one of the available renderers
type Screen ¶
type Screen struct { Pixels []Pixel Width uint16 Height uint16 // contains filtered or unexported fields }