Exemple #1
0
enum piglit_result
piglit_display(void)
{
	GLboolean pass = GL_TRUE;
	float white[] = {1.0, 1.0, 1.0, 1.0};
	int i;

	glClear(GL_COLOR_BUFFER_BIT);

	glBindVertexArray(vao);
	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indexBuffer);

	for (i = 0; i < NUM_QUADS; ++i)
		glDrawElementsBaseVertexOES(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, NULL, i * 4);

	for (i = 0; i < NUM_QUADS; ++i)
	{
		GLfloat xoffset[2], yoffset[2];

		xoffset[0] = inc_amount * i / 2.0 * window_width;
		xoffset[1] = inc_amount * (i + 1) / 2.0 * window_width;
		yoffset[0] = (i % 2 ? 0.0 : 0.5) * window_height;
		yoffset[1] = yoffset[0] + window_height / 2;

		pass = piglit_probe_rect_rgba(xoffset[0], yoffset[0],
			xoffset[1] - xoffset[0], yoffset[1] - yoffset[0], white) && pass;
	}

	piglit_present_results();

	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}
EXTERN_C_ENTER

JNIEXPORT void JNICALL Java_org_lwjgl_opengles_OESDrawElementsBaseVertex_nglDrawElementsBaseVertexOES(JNIEnv *__env, jclass clazz, jint mode, jint count, jint type, jlong indicesAddress, jint basevertex) {
    glDrawElementsBaseVertexOESPROC glDrawElementsBaseVertexOES = (glDrawElementsBaseVertexOESPROC)tlsGetFunction(764);
    intptr_t indices = (intptr_t)indicesAddress;
    UNUSED_PARAM(clazz)
    glDrawElementsBaseVertexOES(mode, count, type, indices, basevertex);
}