Exemplo n.º 1
0
func main() {
	fmt.Println("Starting")

	allegro.Init()
	allegro.InstallKeyboard()
	allegro.InstallMouse()

	runtime.GOMAXPROCS(10)

	doneChan := make(chan bool)
	var disp *allegro.Display
	alFuncs <- func() {
		disp = allegro.CreateDisplay(600, 400, allegro.WINDOWED)

		color = allegro.CreateColor(100, 0, 0, 255)
		color.Clear()
		allegro.Flip()
		doneChan <- true
	}

	<-doneChan
	fmt.Println("Created window")

	handleEvents(disp)

	fmt.Println("Ended")
}
Exemplo n.º 2
0
func InitializeAllegro() {
	allegro.Init()
	allegro.InitFont()
	allegro.InitImage()
	allegro.InitTTF()
	allegro.InstallKeyboard()
	allegro.InstallMouse()
}