Esempio n. 1
0
File: gl_test.go Progetto: shogg/gl
func TestDrawElements(t *testing.T) {

	gl.EnableClientState(gl.VERTEX_ARRAY)
	gl.VertexPointer(2, gl.INT, 0, slice)

	indices := []uint32{0, 1, 2, 3}

	gl.DrawElements(gl.TRIANGLE_STRIP, 4, gl.UNSIGNED_INT, indices)
	if gl.GetError() != gl.NO_ERROR {
		t.Error("slice failed")
	}

	gl.DisableClientState(gl.VERTEX_ARRAY)
}
Esempio n. 2
0
File: gl_test.go Progetto: shogg/gl
func TestVertexPointer(t *testing.T) {

	gl.EnableClientState(gl.VERTEX_ARRAY)

	gl.VertexPointer(3, gl.INT, 0, &array)
	if gl.GetError() != gl.NO_ERROR {
		t.Error("pointer to array failed")
	}

	gl.VertexPointer(3, gl.INT, 0, slice)
	if gl.GetError() != gl.NO_ERROR {
		t.Error("slice failed")
	}

	gl.DisableClientState(gl.VERTEX_ARRAY)
	buf := newBuffer(16 * 4)
	defer buf.Delete()

	gl.VertexPointer(3, gl.INT, 0, uintptr(0))
	if gl.GetError() != gl.NO_ERROR {
		t.Error("buffer offset failed")
	}
}