Exemplo n.º 1
0
Arquivo: gl_test.go Projeto: shogg/gl
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")
	}
}
Exemplo n.º 2
0
Arquivo: main.go Projeto: shogg/glvox
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()
}