rendering

package
v0.0.0-...-f6a54cf Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

type Frame struct {
	X, Y          int
	Width, Height int
	Data          []texture.RGB
}

Frame is a rectangle fragment of an image.

func MakeFrame

func MakeFrame(xoff, yoff, width, height int) Frame

MakeFrame creates an empty Frame.

func (*Frame) SetPixel

func (f *Frame) SetPixel(x, y int, r, g, b byte)

type OpenGLWindow

type OpenGLWindow struct {
	Name string
	// contains filtered or unexported fields
}

func MakeOpenGLWindow

func MakeOpenGLWindow(width, height int) *OpenGLWindow

func (*OpenGLWindow) GetRequestStream

func (w *OpenGLWindow) GetRequestStream() <-chan Frame

func (*OpenGLWindow) Run

func (w *OpenGLWindow) Run()

Run should only be called from the main thread.

func (*OpenGLWindow) SetInputStream

func (w *OpenGLWindow) SetInputStream(input <-chan Frame)

type Renderer

type Renderer struct {
	ResolutionX int
	ResolutionY int

	Scene *scene.Scene
	// contains filtered or unexported fields
}

func MakeRenderer

func MakeRenderer(width, height int) *Renderer

func (*Renderer) Attach

func (r *Renderer) Attach(v Visualizer)

func (*Renderer) Render

func (r *Renderer) Render()

Render starts the renderer. It will not block. Panics if Attach was not called or no Scene was given.

type Visualizer

type Visualizer interface {
	// SetInputStream takes a read only Frame channel and visualizes the Frames from it.
	SetInputStream(<-chan Frame)

	// GetRequestStream returns a read only Frame channel that is used to pass Frame requests to the renderer.
	GetRequestStream() <-chan Frame

	// Run starts the visualizer. It must cleanup before Run exists.
	Run()
}

Jump to

Keyboard shortcuts

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