
separate (adagate.drawisland)

procedure drawsand is
begin

	-- draw sandy island:
	glUseProgram(pidpgm35);
	glUniformMatrix4fv(imvp35, 1, GL_FALSE, imvp(1,1)'address);
	glUniform3f(ieye35, glfloat(xeye),glfloat(yeye),glfloat(zeye));


	glUniform1i(flev35, foglev); -- lagoonFog 0=>none, 1=>show
	glUniform1i(fcol35, fogclr); -- lagoonFog 0=>none, 1=>show
	glUniform1i(samp35, 0);
	glUniform1i(dark35, darkness);
	glBindTexture(GL_TEXTURE_2D, island_texid);
	isandy.Draw(island,vertbuff,uvbuff,elembuff);


	-- draw a planet:
	glUniformMatrix4fv(imvp35, 1, GL_FALSE, satmvp(1,1)'address);
	glUniform1i(flev35, 0); -- lagoonFog 0=>none, 1=>show
	glUniform1i(dark35, 0);
	if bkg=4 or bkg=1 then
		glBindTexture( GL_TEXTURE_2D, marstex );
		ellobj.draw(mars,vertbuff,uvbuff,elembuff); --EquiRect
	else
		glBindTexture( GL_TEXTURE_2D, juptex );
		ellobj.draw(jupit,vertbuff,uvbuff,elembuff); --EquiRect
	end if;


end drawsand;


