sdlplay

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: GPL-3.0, GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sdlplay implements the GUI interface. Suitable for applications that require a minimalist screen intended for playing games/cartrdiges, rather than debugging them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SdlPlay

type SdlPlay struct {
	television.Television
	// contains filtered or unexported fields
}

SdlPlay is a simple SDL implementation of the television.PixelRenderer interface

func NewSdlPlay

func NewSdlPlay(tv television.Television, scale float32) (*SdlPlay, error)

NewSdlPlay is the preferred method of initialisation for SdlPlay.

func (*SdlPlay) Destroy

func (scr *SdlPlay) Destroy(output io.Writer)

Destroy implements GuiCreator interface

MUST ONLY be called from the #mainthread

func (*SdlPlay) EndRendering

func (scr *SdlPlay) EndRendering() error

EndRendering implements television.PixelRenderer interface

UNUSED

func (*SdlPlay) NewFrame

func (scr *SdlPlay) NewFrame(frameNum int) error

NewFrame implements television.PixelRenderer interface

MUST NOT be called from #mainthread

func (*SdlPlay) NewScanline

func (scr *SdlPlay) NewScanline(scanline int) error

NewScanline implements television.PixelRenderer interface

UNUSED

func (*SdlPlay) Resize

func (scr *SdlPlay) Resize(topScanline, numScanlines int) error

Resize implements television.PixelRenderer interface

MUST NOT be called from #mainthread

func (*SdlPlay) Service

func (scr *SdlPlay) Service()

Service implements GuiCreator interface.

MUST ONLY be called from the #mainthread

func (*SdlPlay) SetAltPixel

func (scr *SdlPlay) SetAltPixel(x, y int, red, green, blue byte, vblank bool) error

SetAltPixel implements television.PixelRenderer interface

UNUSED

func (*SdlPlay) SetFeature

func (scr *SdlPlay) SetFeature(request gui.FeatureReq, args ...interface{}) error

SetFeature implements the GUI interface

func (*SdlPlay) SetPixel

func (scr *SdlPlay) SetPixel(x, y int, red, green, blue byte, vblank bool) error

SetPixel implements television.PixelRenderer interface

MUST NOT be called from #mainthread

interesting that writing to pixel array does not trigger a race condition even though we read pixels, when updating texture, in a different thread.

!!TODO: race condition in SetPixel() in sdlplay?

Jump to

Keyboard shortcuts

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