separate (adagate.drawisland)

procedure drawStargate is
begin

	glUseProgram(pidgate33);
	glUniformMatrix4fv(imvp33, 1, GL_FALSE, imvp(1,1)'address);
	glUniform1i(samp33,0);
	glUniform1i(dark33, darkness); --14nov15

	glBindTexture(GL_TEXTURE_2D, pillar1_texid);
	pictobj.Draw(pillar1, vertbuff,uvbuff,elembuff);
	pictobj.Draw(pillar2, vertbuff,uvbuff,elembuff);

	glBindTexture(GL_TEXTURE_2D, pillar2_texid);
	pictobj.Draw(pillar3, vertbuff,uvbuff,elembuff);
	pictobj.Draw(pillar4, vertbuff,uvbuff,elembuff);
	pictobj.Draw(pillar5, vertbuff,uvbuff,elembuff);



	glBindTexture(GL_TEXTURE_2D, gate0_texid);
	pictobj.Draw(gate, vertbuff,uvbuff,elembuff);

	--if dhdstate>0 and mseated then
	-- note: new 3rd condition only an issue when debugging!
	if dhdstate>0 and mseated and not worming then --29nov19
		et:=1.5*( float(currenttime-dhdtime)-halfpi);
		extension:=0.75+0.75*fmath.sin(et);
		if et>twopi-halfpi then
			extension:=0.0;
		end if;
		kz := kwradz + kwmaxz*glfloat( extension );
		drawKawhoosh(xxkwh,yykwh,zzkwh,kwradx,kwrady,kz,0,imvp);
	end if;

end drawStargate;

