All pastes #903760 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-02-14 13:44 UTC
rendered paste body
void Drawer::Draw(int iT)
{       
	if(iScreenHeight*iScreenWidth == 0)
	float faObjectMap[iScreenHeight*iScreenWidth];
	
	int j = 0;
	int i = 0;
	while(i < iScreenHeight - 1)
    {
		j=0;
		while(j < iScreenWidth)
		{
			faObjectMap[i*iScreenWidth + j] = Wrangle((float)(i-iOriginX),(float)(0-iOriginY),iT);
			j++;
		}
		i++;
	}
	i = 0;
	glColor3f(0.0f,0.0f,1.0f);
	while(i < iScreenHeight - 1)
	{
		float fResult;
		j = 0;
		glBegin(GL_TRIANGLE_STRIP);
		//glColor3f(1.0f-(float)i/128.0f,0.0f,0.0f);
		//Draws function map on the screen from the array created earlier
		glVertex3f(fMinX + (j * fDistX),fMinY + ((i+1) * fDistY),faObjectMap[i*iScreenWidth+j]);
		glVertex3f(fMinX + (j * fDistX),fMinY + (i * fDistY),faObjectMap[i*iScreenWidth+j]); 
		j=1;
			while(j < iScreenWidth)
			{
				glVertex3f(fMinX + (j * fDistX),fMinY + ((i+1) * fDistY),faObjectMap[i*iScreenWidth+j]);
				glVertex3f(fMinX + (j * fDistX),fMinY + ((i) * fDistY),faObjectMap[i*iScreenWidth+j]);
				j++;
			}
		glEnd();     
		i++;
	}
}