Beispiel #1
0
void GLApp::displayWorld()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadMatrixf(camera.GetMatrix());
	gen_clipmat();
	glGetIntegerv(GL_VIEWPORT, viewPort);
	glGetDoublev(GL_MODELVIEW_MATRIX, modelViewMatrix);
	glGetDoublev(GL_PROJECTION_MATRIX, projectionMatrix);

	glEnable(GL_TEXTURE_2D);

	DrawSky();
	DrawSea();
	terrain.Render(camera.position);//();
	Environment::instance().Render();
	pman.Render();

	checkError("displayWorld");


}
Beispiel #2
0
void DrawGround(void)
{

	eyePositionSea[0]=(float)MFighter.RefPos()(0);
	eyePositionSea[1]=(float)MFighter.RefPos()(1);
	eyePositionSea[2]=(float)MFighter.RefPos()(2);


	if(ShaderWater)
	{
		glDisable(GL_ALPHA_TEST);
		glEnable(GL_BLEND);
		glColor4f(1.0f,1.0f,1.0f,1.0f);
		DrawSea();
		glPushMatrix();
			//glDisable(GL_BLEND);
			glBindTexture(GL_TEXTURE_2D,SeaTexID);
			for(int i=0;i<ModelNumLoadedWater;i++)
				m_VBMD->ShowVBMD(pModelIDWater[i],false);
		glPopMatrix();
		CGDisableProfilePixel();
		CGDisableProfileVertex();
		CGDisableTextureParameterAmbientReflectiveSea();
		glEnable(GL_ALPHA_TEST);
	}
	else
	{
		glPushMatrix();
			glEnable(GL_FOG);
			glDisable(GL_BLEND);
			glBindTexture(GL_TEXTURE_2D,SeaTexID);
			glColor4f(0.0f,0.2f,0.6f,1.0f);
			for(int i=0;i<ModelNumLoadedWater;i++)
				m_VBMD->ShowVBMD(pModelIDWater[i],false);
			glColor4f(1.0f,1.0f,1.0f,1.0f);
			glDisable(GL_FOG);
		glPopMatrix();	
	}
}