grid

package module
v0.0.0-...-c1c2c82 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2015 License: MIT Imports: 11 Imported by: 0

README

grid

Small 2D game framework written in Go

Documentation

Index

Constants

View Source
const (
	OpenGlVerMajor = 3
	OpenGLVerMinor = 3
)

Variables

This section is empty.

Functions

func Run

func Run(g *Game) error

Types

type Game

type Game struct {
	Width      int32
	Height     int32
	Fullscreen bool
	Resizable  bool
	Title      string
	Scene      Scene
}

type Scene

type Scene interface {
	Setup()
	Draw(dt float32)
	Update(dt float32)
}

type Shader

type Shader struct {
	Program uint32
}

func CreateShader

func CreateShader(vertexShaderSource, fragmentShaderSource string) (Shader, error)

func (Shader) AttribLocation

func (s Shader) AttribLocation(name string) (uint32, error)

func (Shader) SetAttrib

func (s Shader) SetAttrib(name string, count int32, xtype uint32, strideInByte int32, offsetInByte int) error

func (Shader) UniformLocation

func (s Shader) UniformLocation(name string) (int32, error)

func (Shader) Use

func (s Shader) Use()

type Sprite

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

func CreateSprite

func CreateSprite(t Texture) (s Sprite, err error)

func (*Sprite) Draw

func (s *Sprite) Draw()

type Texture

type Texture struct {
	Id     uint32
	Width  int32
	Height int32
}

func CreateTexture

func CreateTexture(file string) (Texture, error)

func (Texture) Bind

func (t Texture) Bind()

Jump to

Keyboard shortcuts

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