Created
December 29, 2013 01:55
-
-
Save reiver/8166608 to your computer and use it in GitHub Desktop.
A very very basic #golang program that opens up a window using glfw ( https://github.com/jteeuwen/glfw ) that *could* (potentially) be used for OpenGL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
import "github.com/jteeuwen/glfw" | |
import "os" | |
import "time" | |
func main() { | |
// Open up a Window (that would potentially be used for OpenGL) with glfw | |
if err := glfw.Init(); err != nil { | |
fmt.Fprintf(os.Stderr, "[e] %v\n", err) | |
return | |
} | |
defer glfw.Terminate() | |
if err := glfw.OpenWindow(300, 300, 0, 0, 0, 0, 0, 0, glfw.Windowed); err != nil { | |
fmt.Fprintf(os.Stderr, "[e] %v\n", err) | |
return | |
} | |
// Wait a bit before exiting the program (and thus closing the window). | |
time.Sleep(5000 * time.Millisecond) // Wait for 5 seconds | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment