void GlutWinObj::DisplayFunc()
{		
	static float alpha = 0.0;	
	static int iFrameCount = 0;
	static float fz = 0.00;
	static int i = 0;
	
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glLoadIdentity();			

	//Perform ops based on the GlutWinObj's state variables
	glTranslatef(fTranX,fTranY,fTranZ);
	glRotatef(-fRotX,1,0,0);
	glRotatef(-fRotY,0,1,0);
	glRotatef(-fRotZ,0,0,1);
	glScalef(fScaleX,fScaleY,fScaleZ);		

	if(GlutWinObj::bToggleDefAnim == true)
		trkTrack1.MoveCam(&cam1);
	else
		cam1.CamLook();
		
	ltSun.ActivateLight();

	RenderWorld();
	glCallList(TrackList);		
					
	glFlush();
	glutSwapBuffers();	
}
int GlutWinObj::GlutCreateWindow(const char *pszTitle)
{
	//Create window here and also set required flags
	this->iWinHandle = glutCreateWindow_ATEXIT_HACK(pszTitle);		
	glClearColor (0.0, 0.0, 0.0, 0.0);
	
	void InitLights();
	
	ltSun.ActivateLight();

	glEnable(GL_DEPTH_TEST);		
	glShadeModel(GL_SMOOTH);	
	glEnable( GL_NORMALIZE );
	
	txrEarth.GenTexture();
	txrMoon.GenTexture();
	txrGround.GenTexture();
	txrSky.GenTexture();
	txrRail.GenTexture();

	this->bGlutReady = true;

	TrackList = glGenLists(1);
	glNewList(TrackList,GL_COMPILE);
	DrawTrack();
	glEndList();

	InitSphereList();

	return this->iWinHandle;
}