Exemple #1
0
func initWindow(sys system.System, width int, height int) {
	sys.CreateWindow(10, 10, width, height)
	sys.EnableVSync(true)
	err := gl.Init()
	if err != nil {
		panic(err)
	}
	// gl.Ortho(gl.Double(0), gl.Double(width), gl.Double(0), gl.Double(height),
	// 	1000, -1000)
}
Exemple #2
0
func initWindow(sys system.System, width int, height int) {
	sys.CreateWindow(10, 10, width, height)
	sys.EnableVSync(false)

	err := gl.Init()
	if err != nil {
		panic(err)
	}

	gl.Enable(gl.BLEND)
	gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
	gl.EnableClientState(gl.VERTEX_ARRAY)
	gl.EnableClientState(gl.COLOR_ARRAY)
	gl.Enable(gl.CULL_FACE)
	gl.FrontFace(gl.CW)

	gl.ClearColor(0, 0, 0, 1)
}