Exemple #1
0
static void render()
{
    render_shadowmap();
    render_flag();

    glutSwapBuffers();
}
Exemple #2
0
void ITEMS::on_render()
{
	int num = snap_num_items(SNAP_CURRENT);
	for(int i = 0; i < num; i++)
	{
		SNAP_ITEM item;
		const void *data = snap_get_item(SNAP_CURRENT, i, &item);

		if(item.type == NETOBJTYPE_PROJECTILE)
		{
			render_projectile((const NETOBJ_PROJECTILE *)data, item.id);
		}
		else if(item.type == NETOBJTYPE_PICKUP)
		{
			const void *prev = snap_find_item(SNAP_PREV, item.type, item.id);
			if(prev)
				render_pickup((const NETOBJ_PICKUP *)prev, (const NETOBJ_PICKUP *)data);
		}
		else if(item.type == NETOBJTYPE_LASER)
		{
			render_laser((const NETOBJ_LASER *)data);
		}
		else if(item.type == NETOBJTYPE_FLAG)
		{
			const void *prev = snap_find_item(SNAP_PREV, item.type, item.id);
			if (prev)
				render_flag((const NETOBJ_FLAG *)prev, (const NETOBJ_FLAG *)data);
		}
	}

	// render extra projectiles
	/*
	for(int i = 0; i < extraproj_num; i++)
	{
		if(extraproj_projectiles[i].start_tick < client_tick())
		{
			extraproj_projectiles[i] = extraproj_projectiles[extraproj_num-1];
			extraproj_num--;
		}
		else
			render_projectile(&extraproj_projectiles[i], 0);
	}*/
}