Example #1
0
File: gl_test.go Project: 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")
	}
}
Example #2
0
File: main.go Project: 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()
}