isJPEG = GetBoolParam("isJPEG",false)

function init()

	if isJPEG == true then
		backImage = LoadSprite("SkyboxBack.jpeg")
	else
		backImage = LoadSprite("SkyboxBack.png")
	end
	topQuat = QuatEuler(90,0,0)
	bottomQuat = QuatEuler(-90,0,0)
	frontQuat = QuatEuler(0,0,0)
	backQuat = QuatEuler(0,180,0)
	leftQuat = QuatEuler(0,90,0)
	rightQuat = QuatEuler(0,-90,0)
end

function tick()
	local ct = GetCameraTransform()
	DrawSprite(backImage,Transform(VecAdd(ct.pos, Vec(0,250,0)), topQuat),500,500,1,1,1,1,true,false)
	DrawSprite(backImage,Transform(VecAdd(ct.pos, Vec(0,-250,0)), bottomQuat),500,500,1,1,1,1,true,false)
	DrawSprite(backImage,Transform(VecAdd(ct.pos, Vec(0,0,-250)), frontQuat),500,500,1,1,1,1,true,false)
	DrawSprite(backImage,Transform(VecAdd(ct.pos, Vec(0,0,250)), backQuat),500,500,1,1,1,1,true,false)
	DrawSprite(backImage,Transform(VecAdd(ct.pos, Vec(-250,0,0)), leftQuat),500,500,1,1,1,1,true,false)
	DrawSprite(backImage,Transform(VecAdd(ct.pos, Vec(250,0,0)), rightQuat),500,500,1,1,1,1,true,false)
end
