Exemplo n.º 1
0
/* Draw frames WITH-OUT texturing one above other with blending */
void test5(struct globalStruct *globals)
{
	timeval startTime, endTime;
	unsigned long diffTime2;
	int i;

	glEnable(GL_BLEND);
	glBlendEquation(GL_FUNC_ADD);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

	float *pVertexArray, *pTexCoordArray;

	common_init_gl_vertices(globals->inNumberOfObjectsPerSide, &pVertexArray);
	common_init_gl_texcoords(globals->inNumberOfObjectsPerSide, &pTexCoordArray);

	gettimeofday(&startTime, NULL);
	for(i = 0;(i < globals->numTestIterations)&&(!globals->quitSignal);i ++)
	{
	  SGXPERF_STARTPROFILEUNIT;	
		glClear(GL_COLOR_BUFFER_BIT);
		common_gl_draw(globals, globals->inNumberOfObjectsPerSide);
		common_eglswapbuffers(globals, globals->eglDisplay, globals->eglSurface);
SGXPERF_ENDPROFILEUNIT		
	}

	gettimeofday(&endTime, NULL);
	diffTime2 = (tv_diff(&startTime, &endTime))/globals->numTestIterations;
	common_log(globals, 5, diffTime2);

	glDisableVertexAttribArray(VERTEX_ARRAY);
	glDisable(GL_BLEND);
	common_deinit_gl_vertices(pVertexArray);
}
Exemplo n.º 2
0
void test21_eglimagekhr()
{
	int matrixLocation;
	deviceClass = new TISGXStreamEGLIMAGEDevice();
	texClass = new TISGXStreamTexEGLIMAGE();


	test_eglimagekhr_init_texture_streaming();

	paArray[0] = physicalAddress;
	deviceClass->init(&tempAttrib, lastDeviceClass, paArray);
	texClass->init(lastDeviceClass);
	texClass->load_v_shader(NULL);
	texClass->load_f_shader(NULL);
	texClass->load_program();
	matrixLocation = texClass->get_uniform_location("MVPMatrix");

	set_mvp(matrixLocation);

	//initialise gl vertices
	float *pVertexArray, *pTexCoordArray;
	common_init_gl_vertices(inNumberOfObjectsPerSide, &pVertexArray);
	common_init_gl_texcoords(inNumberOfObjectsPerSide, &pTexCoordArray);

	//Rendering loop
	glClear(GL_COLOR_BUFFER_BIT);
	deviceClass->qTexImage2DBuf(&paArray);

	common_gl_draw(inNumberOfObjectsPerSide);
	common_eglswapbuffers (eglDisplay, eglSurface);

	deviceClass->signal_draw(0); //only 1 buffer
	deviceClass->dqTexImage2DBuf(&freeArray);

	deviceClass->destroy();

	test_eglimagekhr_deinit_texture_streaming();
}