コード例 #1
0
ファイル: simple.go プロジェクト: KUGDC/GoServe
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()
}
コード例 #2
0
ファイル: fontdemo.go プロジェクト: himanshushekhar/glut
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()
}
コード例 #3
0
ファイル: asteroids.go プロジェクト: tmc/glut
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()
}
コード例 #4
0
ファイル: simple.go プロジェクト: tmc/glut
func main() {
	glut.CreateWindow("single triangle")
	glut.DisplayFunc(display)
	glut.ReshapeFunc(reshape)
	glut.MainLoop()
}