Exemplo n.º 1
0
int main(int argc, char *argv[])
{
	TEST_START();

	display = get_display();

	/* get an appropriate EGL frame buffer configuration */
	ECHK(eglChooseConfig(display, config_attribute_list, &config, 1, &num_config));
	DEBUG_MSG("num_config: %d", num_config);

	/* create an EGL rendering context */
	ECHK(context = eglCreateContext(display, config, EGL_NO_CONTEXT, context_attribute_list));

	TEST(test_tex(0, 0, 0));
	TEST(test_tex(0, 1, 0));
	TEST(test_tex(1, 0, 0));
	TEST(test_tex(1, 1, 0));
	TEST(test_tex(1, 2, 0));
	TEST(test_tex(2, 1, 0));
	TEST(test_tex(2, 2, 0));
	TEST(test_tex(0, 3, 0));
	TEST(test_tex(3, 2, 0));

	TEST(test_tex(3, 0, 1));
	TEST(test_tex(0, 3, 1));
	TEST(test_tex(3, 3, 1));
	TEST(test_tex(1, 2, 1));
	TEST(test_tex(2, 1, 1));

	ECHK(eglTerminate(display));
	TEST_END();

	return 0;
}
Exemplo n.º 2
0
void CITY_update(float dt)
{
	int i,j;
	if(GetAsyncKeyState(VK_MBUTTON))	
	{
		seed++;
		test_tex();

		for( i = 0; i < HM_X; ++i)
		{
			for( j = 0; j < HM_Y; ++j)
			{
				int idx = j*HM_X + i;
				float f = distBuffer[idx];
				hm[idx] = step(0.07f,f)*f*powf(f + 1.1f*rand01(),2);
				
			}
		}

	//	ACTOR_init(actor_pool);
		//lauch doids
		/*for(i = 0; i < MAX_ACTOR>>1;++i)
		{
			actor* a = ACTOR_get();
			if(a)
			{
				int xx, yy, idx;
				do 
				{	
					xx = 10 + randi(X-15);
					yy = 10 + randi(Y-15);
					idx = yy*HM_X + xx;
				}				
				while(angles[idx] > 0.5f);
				


				a->pos[0] = (float)xx;//xcoords[rpos];
				a->pos[1] = (float)yy;//ycoords[rpos];
				a->pos[2] = 0.1f;		
				a->ang = 2*PI* 0.125f*(float)randi(16);
				a->collide_size[0] = randi(2) == 0? -1.0f: 1.0f;
				a->collide_size[1] = 1.2f + rand01();
				a->update = doid_update;
			}
		}*/
		
	}

	/*
	intro_cam_pos[0] += 0.1f*GetAsyncKeyState(VK_UP) ? 1:0;
	intro_cam_pos[0] -= 0.1f*GetAsyncKeyState(VK_DOWN) ? 1:0;

	intro_cam_pos[1] += 0.1f*GetAsyncKeyState(VK_LEFT) ? 1:0;
	intro_cam_pos[1] -= 0.1f*GetAsyncKeyState(VK_RIGHT) ? 1:0;

	intro_cam_pos[2] += 0.1f*GetAsyncKeyState('Q') ? 1:0;
	intro_cam_pos[2] -= 0.1f*GetAsyncKeyState('A') ? 1:0;
	*/
	//ACTOR_update(actor_pool, dt);
	
}