Exemplo n.º 1
0
Arquivo: gla.go Projeto: spate/gla
// NormalSlice uses glNormalPointer to bind an element of the currently
// bound buffer at the given index. See VertexAttribSlice for more details.
//
// Precondition: VBO bound to ARRAY_BUFFER target containing data of array type dummy
func NormalSlice(dummy interface{}, dummy_index int) error {
	data, err := sliceAttrib(dummy, dummy_index)
	if err != nil {
		return err
	}
	if data.Elements != 3 {
		return fmt.Errorf("gla: invalid number of elements")
	}

	C.glNormalPointer(C.GLenum(data.Gltype), C.GLsizei(data.Stride), unsafe.Pointer(data.Offset))
	return nil
}
Exemplo n.º 2
0
Arquivo: gl.go Projeto: james4k/gl
//void glNormalPointer (GLenum type, int stride, const GLvoid *pointer)
func NormalPointer(typ GLenum, stride int, pointer interface{}) {
	C.glNormalPointer(C.GLenum(typ), C.GLsizei(stride), ptr(pointer))
}