func init() { sdl.Init(sdl.INIT_VIDEO) screen := sdl.SetVideoMode(320, 200, 32, sdl.OPENGL) if screen == nil { panic("Couldn't set video mode: " + sdl.GetError() + "\n") } if err := gl.Init(); err != 0 { panic("glInit error") } }
func main() { sdl.Init(sdl.INIT_VIDEO) defer sdl.Quit() screen := sdl.SetVideoMode(width, height, 32, sdl.OPENGL) if screen == nil { panic("Couldn't set video mode: " + sdl.GetError() + "\n") } sdl.EnableKeyRepeat(200, 20) if err := gl.Init(); err != 0 { panic("gl error") } cam.Yaw(3.14) initGl() initShaders() initVoxels() mainLoop() }