module gedo.video.skybox;



public import gedo.video.texture;
public import gedo.video.staticmesh;
private import gedo.video.ggl;
private import gedo.math.vector;



public class SkyBox
{
public:
	this(StaticMesh[] meshes)
	{
		_meshes = meshes.dup;

		/*
		foreach(mesh; _meshes)
		{
			mesh.texture.wrap(1);
		}
		*/
	}


	void draw()
	{
		GGL_enableDepthBuffer(0);
		scope(exit)
		{
			GGL_enableDepthBuffer(1);
		}

		GGL_pushMatrix();
		scope(exit)
		{
			GGL_popMatrix();
		}

		Vector p;

		GGL_getCameraPosition(p.ptr);

		translate(p);

		foreach(mesh; _meshes)
		{
			mesh.draw();
		}
	}


private:
	StaticMesh[] _meshes;
}
