using System;
using System.Collections.Generic;
using System.Text;

namespace Vortex.Drawing {

	/// <summary>
	/// Describes per pixel Z effect, determining z-writing and z-test modes
	/// </summary>
	public class ZEffect {
		private TestFunction _function;
		private bool _writeZ;

		/// <summary>
		/// Initializes a new instance of the <see cref="ZEffect"/>.
		/// </summary>
		/// <param name="function">The function for Z-test.</param>
		/// <param name="writeZ">if set to <c>true</c> write of Z value is enabled.</param>
		public ZEffect(TestFunction function, bool writeZ) {
			_function = function;
			_writeZ = writeZ;
		}

		/// <summary>
		/// Gets the function for Z-Test.
		/// </summary>
		/// <value>The function.</value>
		public TestFunction Function {
			get { return _function; }
		}

		/// <summary>
		/// Gets a value indicating whether write of Z-value is enabled.
		/// </summary>
		/// <value><c>true</c> if write Z value is enabled; otherwise, <c>false</c>.</value>
		public bool WriteZ {
			get { return _writeZ; }
		}

		#region Presets

		/// <summary>Disables Z-Effect at all</summary>
		public static readonly ZEffect None = new ZEffect(TestFunction.Always, false);

		///<summary>Enables z writing for each rendered pixel without any test</summary>
		public static readonly ZEffect WriteOnly = new ZEffect(TestFunction.Always, true);



		#endregion
	}
}
