Beispiel #1
0
func loadResources() (uint32, uint32) {
	texture, _, err := newOctree("cmd/packer/test.priv.oct")
	//texture, _, err := newOctree("pack/test.oct")
	if err != nil {
		panic(err)
	}

	/*
		vertexShader, err := ioutil.ReadFile("cmd/raytracer/vp.glsl")
		if err != nil {
			panic(err)
		}

		fragmentShader, err := ioutil.ReadFile("cmd/raytracer/fp.glsl")
		if err != nil {
			panic(err)
		}
	*/

	program, err := newProgram(string(vertexShader)+"\x00", string(fragmentShader)+"\x00")
	if err != nil {
		panic(err)
	}

	gl.UseProgram(program)
	return program, texture
}
Beispiel #2
0
// UseProgram implements the opengl.OpenGl interface.
func (native *OpenGl) UseProgram(program uint32) {
	gl.UseProgram(program)
}