cubelib

package
v0.0.0-...-1a51d22 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2013 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SizeOfFloat   = 4
	TEX_COORD_MAX = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferByte

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

func NewBufferByte

func NewBufferByte(data []byte) *BufferByte

func (*BufferByte) Data

func (b *BufferByte) Data() []byte

func (*BufferByte) Len

func (b *BufferByte) Len() int

type BufferFloat

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

func NewBufferFloat

func NewBufferFloat(data []float32) *BufferFloat

func (*BufferFloat) Data

func (b *BufferFloat) Data() []float32

func (*BufferFloat) Len

func (b *BufferFloat) Len() int

type Camera

type Camera struct {
	X, Y, Z float32
}

type Cube

type Cube struct {
	Vertices *BufferFloat
	Program  Program
	// contains filtered or unexported fields
}

func NewCube

func NewCube() *Cube

func (*Cube) AttachTexture

func (c *Cube) AttachTexture(img image.Image)

func (*Cube) AttachTextureFromBuffer

func (c *Cube) AttachTextureFromBuffer(buffer []byte, width, height int)

func (*Cube) AttachTextureFromFile

func (c *Cube) AttachTextureFromFile(filename string) error

func (*Cube) Draw

func (c *Cube) Draw()

func (*Cube) Rotate

func (c *Cube) Rotate(angle float32, axis mathgl.Vec3f)

type FragmentShader

type FragmentShader string

func (FragmentShader) Compile

func (s FragmentShader) Compile() uint32

type Program

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

FIXME - it could be of type uint32

func (*Program) GetAttribute

func (p *Program) GetAttribute(name string) uint32

func (*Program) GetUniform

func (p *Program) GetUniform(name string) uint32
func (p *Program) Link(fsh, vsh uint32)

func (*Program) Use

func (p *Program) Use()

type VertexShader

type VertexShader string

func (VertexShader) Compile

func (s VertexShader) Compile() uint32

type World

type World struct {
	// Size of the rendering viewport
	Width, Height int
	// contains filtered or unexported fields
}

func NewWorld

func NewWorld(width, height int) *World

func (*World) Attach

func (w *World) Attach(obj *Cube)

func (*World) Draw

func (w *World) Draw()

func (*World) Resize

func (w *World) Resize(width, height int)

func (*World) SetCamera

func (w *World) SetCamera(x, y, z float32)

Jump to

Keyboard shortcuts

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