func initWindow() { // Function called to do the re-rendering glut.DisplayFunc(display) // Called when the visibility of the program changes glut.VisibilityFunc(visible) // Called when a regular ascii character is pressed glut.KeyboardFunc(keyboardIn) // Called when any non-ascii character is pressed glut.SpecialFunc(specialIn) // Called when the size of the window changes glut.ReshapeFunc(reshape) // affect our projection matrix gl.MatrixMode(gl.PROJECTION) gl.LoadIdentity() // Load an identity matrix -> projection // Specify the bounds of the of our scene gl.Ortho(0, 40, 0, 40, 0, 40) // Now affect our modelview matrix gl.MatrixMode(gl.MODELVIEW) // Make points be rendererd larger gl.PointSize(3.0) currentWindow = glut.GetWindow() }
func main() { glut.InitDisplayMode(glut.SINGLE | glut.RGB) glut.InitWindowSize(465, 250) glut.CreateWindow("GLUT bitmap & stroke font example") gl.ClearColor(1.0, 1.0, 1.0, 1.0) gl.Color3f(0, 0, 0) gl.LineWidth(3.0) glut.DisplayFunc(display) glut.ReshapeFunc(reshape) glut.MainLoop() }
func main() { glut.CreateWindow("single triangle") glut.DisplayFunc(display) glut.ReshapeFunc(reshape) glut.MainLoop() }