
separate (gameutils)

procedure release_textures is -- prepare to close down
	use gl.binding;
begin

	glext.binding.glDeleteBuffers(1, normbuff'address);
	glext.binding.glDeleteBuffers(1, vertbuff'address);
	glext.binding.glDeleteBuffers(1, rgbbuff'address);
	glext.binding.glDeleteBuffers(1, uvbuff'address);
	glext.binding.glDeleteBuffers(1, elembuff'address);

	glDeleteTextures(1, albedo34a'address);
	glDeleteTextures(1, normal34a'address);
	glDeleteTextures(1, metallic34a'address);
	glDeleteTextures(1, roughness34a'address);
	glDeleteTextures(1, ao34a'address);

	gldeletetextures(1, ball_texid'address);
	gldeletetextures(1, room_texid'address);
	gldeletetextures(1, pic_texid'address);

	gldeletetextures(1, xbox1_texid'address);
	gldeletetextures(1, xbox2_texid'address);
	gldeletetextures(1, lining_texid'address);
	gldeletetextures(1, barloc0_texid'address);
	gldeletetextures(1, barloc1_texid'address);
	gldeletetextures(1, granite_texid'address);
	gldeletetextures(1, port_texid'address);
	gldeletetextures(1, cubemap_texid'address);
	gldeletetextures(1, circubemap_texid'address);
	gldeletetextures(1, pfish_texid'address);

------- from beach -----------------------------------
	gldeletetextures(1, frek_texid'address);
	gldeletetextures(1, crab_texid'address);
	gldeletetextures(1, star_texid'address);
	gldeletetextures(1, cgrass_texid'address);
	gldeletetextures(1, tgrass_texid'address);
	gldeletetextures(1, bamb_texid'address);
	gldeletetextures(1, palm_texid'address);
	gldeletetextures(1, tpalm_texid'address);
	gldeletetextures(1, pillar1_texid'address);
	gldeletetextures(1, pillar2_texid'address);
	gldeletetextures(1, rock_texid'address);
	gldeletetextures(1, coco_texid'address);
	gldeletetextures(1, arm_texid'address);
	gldeletetextures(1, island_texid'address);
	gldeletetextures(1, gard_texid'address);
	gldeletetextures(1, nose_texid'address);
	gldeletetextures(1, cpit_texid'address);
	gldeletetextures(1, fishbones_texid'address);
	gldeletetextures(1, mfish_texid'address);
	gldeletetextures(1, bfish_texid'address);
	gldeletetextures(1, rfish_texid'address);
	gldeletetextures(1, sfish_texid'address);
	gldeletetextures(1, snake_texid'address);
	gldeletetextures(1, serpent_texid'address);

	gldeletetextures(1, lean2_texid'address);
	gldeletetextures(1, sos_texid'address);
	gldeletetextures(1, gate0_texid'address);
	gldeletetextures(1, gate_texid'address);
	gldeletetextures(1, pillar1_texid'address);
	gldeletetextures(1, pillar2_texid'address);
	gldeletetextures(1, dhdo_texid'address);
	gldeletetextures(1, dhd0_texid'address);
	gldeletetextures(1, dhd1_texid'address);
	gldeletetextures(1, dhd2_texid'address);
	gldeletetextures(1, dhd3_texid'address);
	gldeletetextures(1, dhd4_texid'address);
	gldeletetextures(1, adobe_texid'address);
	gldeletetextures(1, wood_texid'address);
	gldeletetextures(1, wood2_texid'address);
	gldeletetextures(1, woodt_texid'address);
	gldeletetextures(1, woodw_texid'address);
	gldeletetextures(1, brick_texid'address);
	gldeletetextures(1, turtle_texid'address);
	gldeletetextures(1, turhead_texid'address);

	gldeletetextures(1, opaqueport_texid'address);
	gldeletetextures(1, offport_texid'address);
	gldeletetextures(1, offportr_texid'address);
	gldeletetextures(1, offportg_texid'address);

	gldeletetextures(1, grunge_texid'address);
	gldeletetextures(1, glassw_texid'address);
	gldeletetextures(1, ava_texid'address);

	gldeletetextures(1, tropical_cubemap_texid'address);
	gldeletetextures(1, blue_cubemap_texid'address);
	gldeletetextures(1, moon_cubemap_texid'address);
	gldeletetextures(1, sunset_cubemap_texid'address);
	gldeletetextures(1, sargas_cubemap_texid'address);


	gldeletetextures(1, marstex'address);
	gldeletetextures(1, juptex'address);

---------- end from beach --------------------------------

	glext.binding.glDeleteProgram( pidfire01 );
	glext.binding.glDeleteProgram( pidkw02 );
	glext.binding.glDeleteProgram( pidpic03 );
	glext.binding.glDeleteProgram( pidpic04 );
	glext.binding.glDeleteProgram( pidpic05 );
	glext.binding.glDeleteProgram( pidpic06 );
	glext.binding.glDeleteProgram( pidpic07 );
	glext.binding.glDeleteProgram( pidpic08 );

	glext.binding.glDeleteProgram( pidstar09 );
	glext.binding.glDeleteProgram( pidstar10 );
	glext.binding.glDeleteProgram( pidfish11 );
	glext.binding.glDeleteProgram( pidpool12 );
	glext.binding.glDeleteProgram( pidpool13 );
	glext.binding.glDeleteProgram( pidpool14 );
	glext.binding.glDeleteProgram( pidpool15 );
	glext.binding.glDeleteProgram( pidpgm16 );
	glext.binding.glDeleteProgram( pidpgm17 );
	glext.binding.glDeleteProgram( pidskyb18 );
	glext.binding.glDeleteProgram( pidskyw19 );
	glext.binding.glDeleteProgram( pidava20 );
	glext.binding.glDeleteProgram( pidzpm21 );


	glext.binding.glDeleteProgram( tunshadid3 );
	glext.binding.glDeleteProgram( tunshadid2 );
	glext.binding.glDeleteProgram( tunshadid1 );



	glext.binding.glDeleteProgram( pidskyb31 );
	glext.binding.glDeleteProgram( pidskyw32 );

	glext.binding.glDeleteProgram( pidgate33 );
	glext.binding.glDeleteProgram( pidzpm34 );
	glext.binding.glDeleteProgram( pidzpm34a );
	glext.binding.glDeleteProgram( pidpgm35 );
	glext.binding.glDeleteProgram( pidrock36 );
	glext.binding.glDeleteProgram( pidpalm37 );
	glext.binding.glDeleteProgram( pidlean38 );
	glext.binding.glDeleteProgram( pidlog39 );
	glext.binding.glDeleteProgram( pidcrab40 );
	glext.binding.glDeleteProgram( pidnose41 );
	glext.binding.glDeleteProgram( pidcpit42 );





	glext.binding.glDeleteVertexArrays(1, vertexarrayid'address);

end release_textures;


