Documentation ¶
Overview ¶
view sets up and handles a glfw window.
Example ¶
package main import ( "github.com/goxjs/gl" "github.com/goxjs/glfw" "github.com/omustardo/gome/view" "log" "time" ) func main() { if err := view.Initialize(1280, 720, "Demo"); err != nil { log.Fatal(err) } defer view.Terminate() framerate := time.Second / 60 ticker := time.NewTicker(framerate) for !view.Window.ShouldClose() { glfw.PollEvents() // Reads window events, like keyboard and mouse input. Necessary to do basic things, like resize the window. gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) // TODO: Draw stuff here. view.Window.SwapBuffers() <-ticker.C // wait up to the framerate cap. } }
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Window *glfw.Window
Window is the singleton glfw window. It should be initialized with view.Initialize(), and then all window related logic can access it directly. It should be closed with view.Terminate()
Functions ¶
func Initialize ¶
Initialize sets up the singleton view.Window.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.