render

package
v0.0.0-...-9b4341a Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2016 License: Apache-2.0 Imports: 5 Imported by: 5

Documentation

Index

Constants

View Source
const FRAGMENT = `` /* 353-byte string literal not displayed */
View Source
const VERTEX = `` /* 691-byte string literal not displayed */

Variables

View Source
var Square = []Point{
	Point{
		Position: mgl32.Vec3{-0.5, -0.5, 0},
		Texture:  mgl32.Vec2{0, 0},
		Frame:    0,
	},
	Point{
		Position: mgl32.Vec3{0.5, 0.5, 0},
		Texture:  mgl32.Vec2{1, 1},
		Frame:    0,
	},
	Point{
		Position: mgl32.Vec3{-0.5, 0.5, 0},
		Texture:  mgl32.Vec2{0, 1},
		Frame:    0,
	},
	Point{
		Position: mgl32.Vec3{-0.5, -0.5, 0},
		Texture:  mgl32.Vec2{0, 0},
		Frame:    0,
	},
	Point{
		Position: mgl32.Vec3{0.5, -0.5, 0},
		Texture:  mgl32.Vec2{1, 0},
		Frame:    0,
	},
	Point{
		Position: mgl32.Vec3{0.5, 0.5, 0},
		Texture:  mgl32.Vec2{1, 1},
		Frame:    0,
	},
}

Functions

This section is empty.

Types

type Geometry

type Geometry struct {
	Points []Point
	Dirty  bool
	// contains filtered or unexported fields
}

func NewGeometry

func NewGeometry(capacity int) (out *Geometry)

func NewGeometryFromPoints

func NewGeometryFromPoints(points []Point) (out *Geometry)

func (*Geometry) Bind

func (g *Geometry) Bind()

func (*Geometry) Delete

func (g *Geometry) Delete()

func (*Geometry) Upload

func (g *Geometry) Upload()

type Instance

type Instance struct {
	Frame int
	Key   string // TODO: move to an interface{} data pointer.
	// contains filtered or unexported fields
}

func (*Instance) Color

func (i *Instance) Color() mgl32.Vec4

func (*Instance) GetModel

func (i *Instance) GetModel() mgl32.Mat4

func (*Instance) InsertAfter

func (i *Instance) InsertAfter(inst *Instance)

func (*Instance) MarkChanged

func (i *Instance) MarkChanged()

func (*Instance) Next

func (i *Instance) Next() *Instance

func (*Instance) Remove

func (i *Instance) Remove()

func (*Instance) SetColor

func (i *Instance) SetColor(r, g, b, a float32)

func (*Instance) SetPosition

func (i *Instance) SetPosition(p mgl32.Vec3)

func (*Instance) SetRotation

func (i *Instance) SetRotation(r float32)

func (*Instance) SetScale

func (i *Instance) SetScale(s mgl32.Vec3)

type InstanceList

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

func NewInstanceList

func NewInstanceList() (l *InstanceList)

func (*InstanceList) Head

func (l *InstanceList) Head() *Instance

func (*InstanceList) NewInstance

func (l *InstanceList) NewInstance() (inst *Instance)

func (*InstanceList) Prepend

func (l *InstanceList) Prepend(inst *Instance)

type Instances

type Instances interface {
	Head() *Instance
	Prepend(inst *Instance)
	NewInstance() (inst *Instance)
}

type Point

type Point struct {
	Position mgl32.Vec3
	Texture  mgl32.Vec2
	Frame    float32
}

type Renderer

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

func NewRenderer

func NewRenderer(bufferSize int) (r *Renderer, err error)

func (*Renderer) Bind

func (r *Renderer) Bind()

func (*Renderer) Delete

func (r *Renderer) Delete()

func (*Renderer) Render

func (r *Renderer) Render(
	camera *core.Camera,
	sheet UniformBufferSheet,
	geometry *Geometry,
	instances Instances,
) (err error)

func (*Renderer) Unbind

func (r *Renderer) Unbind()

type UniformBufferSheet

type UniformBufferSheet interface {
	Size() int
	BufferID() uint32
}

type UniformSprite

type UniformSprite [4]float32

func NewUniformSprite

func NewUniformSprite(texW, texH, texX, texY float32) UniformSprite

Jump to

Keyboard shortcuts

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