Beispiel #1
0
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL14C_nglMultiDrawElements__IJIJI(JNIEnv *__env, jclass clazz, jint mode, jlong countAddress, jint type, jlong indicesAddress, jint primcount) {
    glMultiDrawElementsPROC glMultiDrawElements = (glMultiDrawElementsPROC)tlsGetFunction(427);
    intptr_t count = (intptr_t)countAddress;
    intptr_t indices = (intptr_t)indicesAddress;
    UNUSED_PARAM(clazz)
    glMultiDrawElements(mode, count, type, indices, primcount);
}
inline void multiDrawElements(
	MultiDrawElementsMode mode,
	const GLsizei * count,
	MultiDrawElementsType type,
	const GLvoid * const * indices,
	GLsizei drawcount) {
	glMultiDrawElements(
		GLenum(mode),
		count,
		GLenum(type),
		indices,
		drawcount);
}
Beispiel #3
0
Datei: gl.c Projekt: Mon-Ouie/ray
/*
 * @overload multi_draw_elements(primitive, count, index)
 *   @param primitive (see #draw_arrays)
 *   @param count     (see #multi_draw_arrays)
 *   @param [Ray::GL::IntArray] index First indices from the element array for
 *     each draw
 */
static
VALUE ray_gl_multi_draw_elements(VALUE self, VALUE primitive, VALUE rb_count,
                                 VALUE rb_index) {
  mo_array *index = ray_rb2int_array(rb_index);
  mo_array *count = ray_rb2int_array(rb_count);

  if (index->size != count->size)
    rb_raise(rb_eArgError, "index and count arrays should have the same size");

  glMultiDrawElements(NUM2INT(rb_hash_aref(ray_gl_primitives, primitive)),
                      mo_array_at(count, 0),
                      GL_UNSIGNED_INT, (const GLvoid**)mo_array_at(index, 0),
                      index->size);
  return Qnil;
}
static bool
test_MultiDrawElements(GLenum dlmode)
{
	const GLushort indices[] = { 3, 2, 1, 0 };
	const GLushort *multiIndices[] = { indices };
	GLint count = 4;
	GLuint list;

	glClear(GL_COLOR_BUFFER_BIT);

	list = glGenLists(1);
	glNewList(list, dlmode);
	glEnableClientState(GL_VERTEX_ARRAY);
	glVertexPointer(2, GL_FLOAT, 0, verts);
	glMultiDrawElements(GL_TRIANGLE_FAN, &count, GL_UNSIGNED_SHORT,
			    (const GLvoid * const *) multiIndices, 1);
	glEndList();

	return test_list(list, dlmode, "glMultiDrawElements");
}
Beispiel #5
0
void VertexArray::multiDrawElements(const GLenum mode, const GLsizei* count, const GLenum type, const void** indices, const GLsizei drawCount) const
{
    bind();
    glMultiDrawElements(mode, count, type, indices, drawCount);
}
Beispiel #6
0
void VertexArrayObject::multiDrawElements(GLenum mode, const GLsizei* count, GLenum type, const void** indices, GLsizei drawCount)
{
    bind();
    glMultiDrawElements(mode, count, type, indices, drawCount);
    CheckGLError();
}