visualize

package
v0.0.0-...-410e261 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DestroyShaderProgram

func DestroyShaderProgram(shaderProgram ShaderProgram)

Destroying a ShaderProgram.

func DestroyTexture

func DestroyTexture(texture Texture)

Destroying a Texture.

func RunVisualization

func RunVisualization(notes *synth.NoteArrangement, oNoteChannel chan synth.DelayedNoteData) error

Runs the visualization with a set of DelayedNoteData. The DelayedNote data is used to push information to the synth as well as represent the data visually.

func Testing

func Testing() error

Testing stuff to do with opening an OpenGL context.

Types

type Assets

type Assets struct {
	Programs map[string]ShaderProgram
	Textures map[string]Texture
}

An amalgimation of assets one can use to

func NewAssets

func NewAssets(sPaths []string, tPaths []string) (*Assets, error)

Constructing a new Assets out of the list of ShaderProgram paths and Texture paths.

func (*Assets) Destroy

func (a *Assets) Destroy()

Destroying the set of assets contained within an Assets.

func (*Assets) GetProgram

func (a *Assets) GetProgram(path string) (ShaderProgram, error)

Accessing a program within the asset manager.

func (*Assets) GetTexture

func (a *Assets) GetTexture(path string) (Texture, error)

Accessing a texture within the asset manager.

type Color

type Color struct {
	Red   float32
	Green float32
	Blue  float32
	Alpha float32
}

A type to define color.

func GetPastel

func GetPastel(index int) Color

func HSVA

func HSVA(hue, saturation, value, alpha float32) Color

Creating a color from hue, saturation, value, and alpha bytes.

func RGBA

func RGBA(red, green, blue, alpha float32) Color

Creating a color from red, green, blue, and alpha bytes.

type LineRender

type LineRender struct {
	// contains filtered or unexported fields
}

Type LineRender holds all of the data necessary to render a set of lines.

func NewLineReaderEmpty

func NewLineReaderEmpty(shaderProgram ShaderProgram, color Color, static bool, weight float32) *LineRender

Creating an empty LineReader.

func NewLineRender

func NewLineRender(shaderProgram ShaderProgram, color Color, static bool, weight float32, points []Point) *LineRender

Creating a LineReader with an initial list of points.

func (*LineRender) Destroy

func (lr *LineRender) Destroy()

Cleaning up the memory from a LineReader.

func (*LineRender) Render

func (lr *LineRender) Render()

Rendering this LineRender.

func (*LineRender) UpdatePoints

func (lr *LineRender) UpdatePoints(points []Point)

Updating the list of Points that this LineRender should be rendering.

type Point

type Point struct {
	X float32
	Y float32
}

Type Point refers to an (x, y) pair representing location in 2d space.

func DefaultGenerateSinePoints

func DefaultGenerateSinePoints(freq, initialPhase float32) []Point

Only for testing purposes.

func GenerateSinePoints

func GenerateSinePoints(freq, initialPhase, fidelity float32, pointsLength, width int) []Point

Generating a slice of points from a set of information.

freq     - The frequency of the sine wave.
initialY - The initial y-axis value of the sine wave.
fidelity - The sample rate to emulate.

pointsLength - The number of points to generate.
width        - The width of the render window.

type RenderObject

type RenderObject struct {
	// contains filtered or unexported fields
}

Type RenderObject is used to concisely represent information necessary to perform a 2 dimensional textured render.

func CreateRenderObject

func CreateRenderObject(shaderProgram ShaderProgram, texture Texture, vertices []float32) *RenderObject

Creating a RenderObject with a given shaderProgram, texture, and set of vertices.

func (*RenderObject) Destroy

func (renderObject *RenderObject) Destroy()

Destroying the resources of a RenderObject.

func (*RenderObject) Render

func (renderObject *RenderObject) Render()

type Shader

type Shader uint32

Type synonyms for more self-documenting code.

func LoadShader

func LoadShader(path string, shaderType uint32) (Shader, error, bool)

Attempting to load a single shader.

type ShaderProgram

type ShaderProgram uint32

func LoadShaderProgram

func LoadShaderProgram(path string) (ShaderProgram, error)

Attempting to load a ShaderProgram from a given location on the disk. It looks for file starting at the path, and then with the respective suffixes of .vert, .frag, and .geom.

type Texture

type Texture uint32

func LoadTexture

func LoadTexture(path string) (Texture, error)

Attempting to load a Texture from a given location on the disk.

Jump to

Keyboard shortcuts

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