Documentation ¶
Index ¶
- func CheckGLForErrors()
- func Smoothstep(t float64) float64
- type Buffer
- type Circle
- type DrawFunc
- type Graphics
- func (self *Graphics) Disable3d()
- func (self *Graphics) DisableWireframe()
- func (self *Graphics) Draw(mode uint32, verts []float32)
- func (self *Graphics) Draw3d(mode uint32, verts []float32, indexes []byte)
- func (self *Graphics) DrawColored(mode uint32, verts []float32)
- func (self *Graphics) DrawRect(x, y, w, h float32)
- func (self *Graphics) DrawShape(shape Shape)
- func (self *Graphics) Enable3d()
- func (self *Graphics) EnableWireframe()
- func (self *Graphics) SetColor(c color.RGBA)
- func (self *Graphics) SetMat(mat Mat4)
- func (self *Graphics) SetViewMat(mat Mat4)
- type LoadFunc
- type LoopWindow
- type Mat4
- func (self Mat4) Mul(other Mat4) Mat4
- func (self Mat4) Print()
- func (self Mat4) Rotate(theta float32) Mat4
- func (self Mat4) Rotate3d(theta, x, y, z float32) Mat4
- func (self Mat4) Scale(sx, sy, sz float32) Mat4
- func (self Mat4) Translate(tx, ty, tz float32) Mat4
- func (self Mat4) TranslateVec3(v Vec3) Mat4
- func (self Mat4) Transpose() Mat4
- type Program
- type ProgramSource
- type Rectangle
- type ShaderSource
- type Shape
- type SmoothPalette
- type UpdateFunc
- type Vec2
- type Vec3
- type VertexArray
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckGLForErrors ¶
func CheckGLForErrors()
func Smoothstep ¶
Types ¶
type Graphics ¶
type Graphics struct { *LoopWindow // contains filtered or unexported fields }
func NewGraphics ¶
func NewGraphics(window *LoopWindow) *Graphics
func (*Graphics) DisableWireframe ¶
func (self *Graphics) DisableWireframe()
func (*Graphics) DrawColored ¶
v = [ [x,y,r,g,b,a], ... ]
func (*Graphics) EnableWireframe ¶
func (self *Graphics) EnableWireframe()
func (*Graphics) SetViewMat ¶
type LoopWindow ¶
type LoopWindow struct { Width int Height int Update UpdateFunc Draw DrawFunc Load LoadFunc Window *glfw.Window Title string Speed float64 }
func NewLoopWindow ¶
func NewLoopWindow() *LoopWindow
func (*LoopWindow) KeyCallback ¶
func (self *LoopWindow) KeyCallback(w *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey)
func (*LoopWindow) Record ¶
func (self *LoopWindow) Record(graphics *Graphics)
func (*LoopWindow) Run ¶
func (self *LoopWindow) Run()
func (*LoopWindow) Screenshot ¶
func (self *LoopWindow) Screenshot(fname string)
type Mat4 ¶
type Mat4 [16]float32
func NewIdentityMat4 ¶
func NewIdentityMat4() Mat4
func NewPerspectiveMatrix ¶
fov: field of view in degrees aspect: width/height
func NewRotate2DMatrix ¶
func NewRotateMatrix ¶
func NewScaleMatrix ¶
func NewTranslateMatrix ¶
func (Mat4) TranslateVec3 ¶
type Program ¶
type Program struct {
Program uint32
}
func NewProgram ¶
func NewProgram(shaders ...ShaderSource) Program
func (*Program) GetAttribLocation ¶
func (*Program) GetUniformLocation ¶
type ProgramSource ¶
type ProgramSource struct {
ShaderSources []ShaderSource
}
type ShaderSource ¶
type SmoothPalette ¶
type UpdateFunc ¶
type UpdateFunc func(float64)
type VertexArray ¶
type VertexArray struct {
VertexArray uint32
}
func NewVertexArray ¶
func NewVertexArray() *VertexArray
func (*VertexArray) Bind ¶
func (self *VertexArray) Bind()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.