Esempio n. 1
0
func main() {
	glut.Init()
	glut.CreateWindow("single triangle")
	glut.DisplayFunc(display)
	glut.ReshapeFunc(reshape)
	glut.MainLoop()
}
Esempio n. 2
0
func main() {
	glut.Init()
	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()
}
Esempio n. 3
0
func main() {
	src, err := os.OpenFile("../resource/postscript/tiger.ps", 0, 0)
	if err != nil {
		log.Println("can't find postscript file.")
		return
	}
	defer src.Close()
	bytes, err := ioutil.ReadAll(src)
	postscriptContent = string(bytes)
	glut.Init()
	glut.InitWindowSize(800, 800)
	glut.CreateWindow("Show Tiger in Opengl")

	glut.DisplayFunc(display)
	glut.ReshapeFunc(reshape)
	glut.MainLoop()
}
Esempio n. 4
0
func initWindow() {
	glut.IgnoreKeyRepeat(1)

	glut.DisplayFunc(display)
	glut.VisibilityFunc(visible)
	glut.KeyboardFunc(key)
	glut.KeyboardUpFunc(keyup)
	glut.SpecialFunc(special)
	glut.SpecialUpFunc(specialup)
	glut.JoystickFunc(joystick, 100)

	gl.MatrixMode(gl.PROJECTION)
	gl.LoadIdentity()
	gl.Ortho(0, 40, 0, 40, 0, 40)
	gl.MatrixMode(gl.MODELVIEW)
	gl.PointSize(3.0)

	currentWindow = glut.GetWindow()
}