Versions in this module Expand all Collapse all v0 v0.5.0 Mar 19, 2022 Changes in this version + const ComputeShader + const Float32 + const FragmentShader + const GeometryShader + const Int32 + const Int8 + const Lines + const Points + const SizeOfByte + const SizeOfFloat + const SizeOfInt + const SizeOfM4 + const SizeOfV3 + const SizeOfV4 + const TriangleFan + const TriangleStrip + const Triangles + const Uint32 + const Uint8 + const VertexShader + func CheckError() error + func Destroy() + func ExecuteSets(sets []ChordSet, win *glfw.Window) + func Init() error + func OpenImages(filenames ...string) ([]*image.RGBA, error) + func SetGLDefaults() + func UseDefaultFramebuffer() + type Animation func(float32) bool + type AnimationMap map[string]Animation + func (am AnimationMap) Float32(name string, value *float32, durationSec, from, to float32) + func (am AnimationMap) Has(name string) bool + func (am AnimationMap) Update(dt float32) + func (am AnimationMap) Vec3f(name string, value *mgl32.Vec3, durationSec float32, from, to mgl32.Vec3) + type Attribute struct + ID uint32 + Name string + Offset int + Size int32 + Stride int32 + Type uint32 + func (a *Attribute) Enable() + type Character struct + type CharacterDict struct + func NewCharacterDict(font *basicfont.Face) *CharacterDict + func (cd CharacterDict) Delete() + func (cd CharacterDict) DrawString(text string, x, y, scale float32, color mgl32.Vec3, width, height float32) + type Chord struct + Execute func() + Keys []glfw.Key + Mouse []glfw.MouseButton + Stop bool + Wait float64 + func (c *Chord) Match(win *glfw.Window, now time.Time) bool + type ChordSet []Chord + func CombineSets(sets ...ChordSet) []ChordSet + func (cs ChordSet) Execute(win *glfw.Window) + func (cs ChordSet) Len() int + func (cs ChordSet) Less(i int, j int) bool + func (cs ChordSet) Match(win *glfw.Window) *Chord + func (cs ChordSet) Sort() ChordSet + func (cs ChordSet) Swap(i int, j int) + type Cycler struct + Current int + Things []interface{} + Title string + func NewCycler(items ...interface{}) *Cycler + func (c *Cycler) Get() interface{} + func (c *Cycler) Next() + func (c *Cycler) Previous() + type Fbo struct + ColorBuffer *Texture2D + Height int32 + ID uint32 + Width int32 + func NewFbo(width, height int) (*Fbo, error) + func (fbo *Fbo) Delete() + func (fbo *Fbo) Use() + type FontMap map[string]struct + func (fm FontMap) Names() []interface{} + type GlError map[uint32]string + func (e GlError) Error() string + type NamedItems []selecteritem + func MakeItems(items ...interface{}) NamedItems + func (items NamedItems) Sort() NamedItems + type Program struct + ID uint32 + Shaders map[uint32]*Shader + func NewProgram() *Program + func (prog *Program) AddShader(shaderType uint32, source string, uniformNames []string, attribs ...Attribute) + func (prog *Program) Build() error + func (prog *Program) Compile() error + func (prog *Program) Compute() *Shader + func (prog *Program) Delete() + func (prog *Program) Fragment() *Shader + func (prog *Program) Geometry() *Shader + func (prog *Program) Link() error + func (prog *Program) Use() + func (prog *Program) Vertex() *Shader + type Selecter struct + Current int + Names []string + Things []interface{} + Title string + func NewSelecter(items NamedItems) *Selecter + func (s *Selecter) Get() selecteritem + func (s *Selecter) Next() + func (s *Selecter) Previous() + func (s *Selecter) Selected(index int) bool + func (s *Selecter) SelectedName(name string) bool + func (s *Selecter) Set(index int) + func (s *Selecter) SetName(name string) + type Shader struct + Attribs map[string]*Attribute + ID uint32 + Source string + Type uint32 + Uniforms map[string]int32 + func (s *Shader) Attributes() (copy []Attribute) + func (s *Shader) SetFloat(uniformName string, count int32, val *float32) + func (s *Shader) SetInt(uniformName string, count int32, val *int32) + func (s *Shader) SetMat4(uniformName string, count int32, val *mgl32.Mat4) + func (s *Shader) SetVec2(uniformName string, count int32, val *mgl32.Vec2) + func (s *Shader) SetVec3(uniformName string, count int32, val *mgl32.Vec3) + func (s *Shader) SetVec4(uniformName string, count int32, val *mgl32.Vec4) + type Skybox struct + TextureID uint32 + Vao *Vao + func NewSkybox(faces []*image.RGBA) (*Skybox, error) + func (sky *Skybox) Delete() + func (sky *Skybox) Draw(view, projection mgl32.Mat4) + type Texture2D struct + Height int32 + ID uint32 + Width int32 + func NewTexture2D(rgba *image.RGBA) (*Texture2D, error) + func (tex *Texture2D) Delete() + func (tex *Texture2D) ReadImage() *image.RGBA + func (tex *Texture2D) Reload(img *image.RGBA) + type Timer struct + DeltaT float64 + Now time.Time + Start time.Time + TotalFrames uint64 + TotalTime float64 + func (t *Timer) AvgFps() float64 + func (t *Timer) Fps() float64 + func (t *Timer) IsNthFrame(n uint64) bool + func (t *Timer) Reset() + func (t *Timer) Update() + type Vao struct + DrawMode uint32 + Ebo uint32 + Prog *Program + Tex []*Texture2D + VaoID uint32 + Vbo uint32 + func NewVao(drawMode uint32, program *Program) *Vao + func (v *Vao) CountVerts() int32 + func (v *Vao) Delete() + func (v *Vao) Draw() + func (v *Vao) DrawOptions(mode uint32, first, count int32) + func (v *Vao) SetEbo(data []uint32) + func (v *Vao) SetEboOptions(sizeInBytes int, data []uint32, usage uint32) + func (v *Vao) SetTexture(uniformName string, texture *Texture2D) + func (v *Vao) SetVbo(data []float32) + func (v *Vao) SetVboOptions(sizeInBytes int, data []float32, usage uint32) + type Window struct + Clock Timer + Dimensions WindowMetric + GlVersion string + GlfwWindow *glfw.Window + Gui *imguiData + func NewWindow(title string, size WindowMetric, options ...WindowOption) (*Window, error) + func (platform *Window) AddCharCallback(callback glfw.CharCallback) + func (platform *Window) AddKeyCallback(callback glfw.KeyCallback) + func (platform *Window) AddMouseButtonCallback(callback glfw.MouseButtonCallback) + func (platform *Window) AddScrollCallback(callback glfw.ScrollCallback) + func (platform *Window) Aspect() float32 + func (platform *Window) BeginFrame() (continueRendering bool) + func (platform *Window) CanUseGui() bool + func (platform *Window) CapturesKeyboard() bool + func (platform *Window) CapturesMouse() bool + func (platform *Window) ClearBuffers() + func (platform *Window) ClipboardText() string + func (platform *Window) DisplaySize() [2]float32 + func (platform *Window) Dispose() + func (platform *Window) FramebufferSize() [2]float32 + func (platform *Window) Fullscreen(full bool, width, height int) (setWidth, setHeight int) + func (platform *Window) InitLoop() + func (platform *Window) MakeContextCurrent() + func (platform *Window) PollEvents() + func (platform *Window) RenderImgui(gui func()) + func (platform *Window) ScreenCapture() image.Image + func (platform *Window) SetClipboardText(text string) + func (platform *Window) ShouldClose() bool + func (platform *Window) SwapBuffers() + type WindowMetric struct + Fullscreen bool + H int + Resizable bool + W int + X int + Y int + type WindowOption func(*Window) error + func SetIcons(paths ...string) WindowOption + func UseImgui(fonts FontMap) WindowOption