core

package
v0.0.0-...-814368e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPNG

func LoadPNG(path string) (img image.Image, err error)

func WritePNG

func WritePNG(path string, img image.Image) (err error)

Types

type ArrayBuffer

type ArrayBuffer struct {
	*GLBuffer
}

func NewArrayBuffer

func NewArrayBuffer() (b *ArrayBuffer)

type Buffer

type Buffer interface {
}

type Camera

type Camera struct {
	WorldCenter mgl32.Vec3
	WorldSize   mgl32.Vec3
	ScreenSize  mgl32.Vec2
	PxPerUnit   mgl32.Vec2
	Projection  mgl32.Mat4
	View        mgl32.Mat4
	Inverse     mgl32.Mat4
}

func NewCamera

func NewCamera(worldCenter, worldSize mgl32.Vec3, screenSize mgl32.Vec2) (c *Camera, err error)

func (*Camera) ScreenToWorldCoords

func (c *Camera) ScreenToWorldCoords(screenCoords mgl32.Vec2) mgl32.Vec2

func (*Camera) SetScreenSize

func (c *Camera) SetScreenSize(screenSize mgl32.Vec2)

func (*Camera) SetWorldBounds

func (c *Camera) SetWorldBounds(worldCenter, worldSize mgl32.Vec3) (err error)

func (*Camera) WorldToScreenCoords

func (c *Camera) WorldToScreenCoords(pt mgl32.Vec2) mgl32.Vec2

type Context

type Context struct {
	OpenGLVersion string
	ShaderVersion string

	Events *Events
	// contains filtered or unexported fields
}

func NewContext

func NewContext() (context *Context, err error)

func (*Context) Camera

func (c *Context) Camera(worldCenter, worldSize mgl32.Vec3) (*Camera, error)

func (*Context) Clear

func (c *Context) Clear()

func (*Context) CreateWindow

func (c *Context) CreateWindow(w, h int, name string) (err error)

func (*Context) Delete

func (c *Context) Delete()

func (*Context) SetCursor

func (c *Context) SetCursor(val bool)

func (*Context) SetFullscreen

func (c *Context) SetFullscreen(val bool) error

func (*Context) SetResizable

func (c *Context) SetResizable(val bool)

func (*Context) SetSwapInterval

func (c *Context) SetSwapInterval(val int)

func (*Context) ShouldClose

func (c *Context) ShouldClose() bool

func (*Context) SwapBuffers

func (c *Context) SwapBuffers()

type Events

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

func (Events) Poll

func (e Events) Poll()

type GLBuffer

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

func NewGLBuffer

func NewGLBuffer(target uint32) (b *GLBuffer)

func (*GLBuffer) Bind

func (b *GLBuffer) Bind()

func (*GLBuffer) BufferID

func (b *GLBuffer) BufferID() uint32

func (*GLBuffer) Delete

func (b *GLBuffer) Delete()

func (*GLBuffer) Size

func (b *GLBuffer) Size() int

func (*GLBuffer) Upload

func (b *GLBuffer) Upload(data interface{}, size int)

type Program

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

func NewProgram

func NewProgram() *Program

func (*Program) Attrib

func (p *Program) Attrib(name string, stride uintptr) *VertexAttribute

func (*Program) Bind

func (p *Program) Bind()

func (*Program) Delete

func (p *Program) Delete()

func (*Program) ID

func (p *Program) ID() uint32

func (*Program) Load

func (p *Program) Load(vertex, fragment string) (err error)

func (*Program) Unbind

func (p *Program) Unbind()

func (*Program) Uniform

func (p *Program) Uniform(name string) *Uniform

func (*Program) UniformBlock

func (p *Program) UniformBlock(name string, binding uint32) *UniformBlock

type Texture

type Texture struct {
	Size         mgl32.Vec2
	OriginalSize mgl32.Vec2
	// contains filtered or unexported fields
}

func GetTexture

func GetTexture(img image.Image, smoothing TextureSmoothing) (texture *Texture, err error)

func LoadTexture

func LoadTexture(path string, smoothing TextureSmoothing) (texture *Texture, err error)

func (*Texture) Bind

func (t *Texture) Bind()

func (*Texture) Delete

func (t *Texture) Delete()

func (*Texture) Unbind

func (t *Texture) Unbind()

type TextureSmoothing

type TextureSmoothing int
const (
	SmoothingNearest TextureSmoothing = gl.NEAREST
	SmoothingLinear  TextureSmoothing = gl.LINEAR
)

type Uniform

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

func (*Uniform) Mat4

func (u *Uniform) Mat4(m mgl32.Mat4)

type UniformBlock

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

func (*UniformBlock) Bind

func (b *UniformBlock) Bind(bufferID uint32, size int)

type UniformBuffer

type UniformBuffer struct {
	*GLBuffer
}

func NewUniformBuffer

func NewUniformBuffer() (b *UniformBuffer)

type VertexAttribute

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

func (*VertexAttribute) Float

func (a *VertexAttribute) Float(offset uintptr, divisor uint32)

func (*VertexAttribute) Mat4

func (a *VertexAttribute) Mat4(offset uintptr, divisor uint32)

func (*VertexAttribute) Vec2

func (a *VertexAttribute) Vec2(offset uintptr, divisor uint32)

func (*VertexAttribute) Vec3

func (a *VertexAttribute) Vec3(offset uintptr, divisor uint32)

func (*VertexAttribute) Vec4

func (a *VertexAttribute) Vec4(offset uintptr, divisor uint32)

Jump to

Keyboard shortcuts

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