
separate (adagate.drawisland)

procedure drawOcean(ibkg: integer) is
begin

--/////////// draw skybox reflections in ocean water begin ///////////////

	-- surrounding sea:
	glUseProgram(pidSkyW32);
	glUniform1i(flev32, foglev);
	glUniform1i(fcol32, fogclr);
	glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); --seems Ok
	glBindTexture(GL_TEXTURE_CUBE_MAP, mcubemap_texid);
	glUniform1i(envm32, 0);
	glUniformMatrix4fv(imvp32, 1, GL_FALSE, imvp(1,1)'address); --30nov14
	glUniform1f(time32, glfloat(currentTime) );

	glUniform3f(ieye32, glfloat(xeye),glfloat(yeye), glfloat(zeye) );

	glUniform3f(icen32, glfloat(mxpcen), 0.0, glfloat(mzpcen) );
	glUniform3f(irad32, glfloat(mrad), glfloat(myrad), glfloat(mrad) );
	glUniform1f(wlev32, glfloat(mwaterlevel));
	glUniform1f(hmax32, glfloat(hmax) );
	glUniform1f(r1id32, glfloat(r1) );
	glUniform1f(r2id32, glfloat(r2) );

	glUniform1i(ibkgd32, glint(ibkg) );

	sea.Draw(ocean,vertbuff);

--/////////// draw skybox reflections in ocean water end /////////////////



end drawOcean;


