//	Darkstar Engine  (c) UnderWorld Interactive Studio (all coding by Svarog    2007)
//
//      Данный файл является частью Darkstar Engine. Любое использование кода файла
//      без согласия компании, является нарушением закона об авторском праве (в слу-
//      чае если не оговорено обратное).
//
//      Имя файла: common_render_state.hpp
//      Краткое описание: Common structures and constants for render state blocks
//

#ifndef DSE_GS_RENDER_STATE_COMMON_HPP
#define DSE_GS_RENDER_STATE_COMMON_HPP

namespace gs
{
	enum DRSCMPFUNC
	{
		DRSCMP_NEVER = 1,
		DRSCMP_LESS = 2,
		DRSCMP_EQUAL = 3,
		DRSCMP_LESSEQUAL = 4,
		DRSCMP_GREATER = 5,
		DRSCMP_NOTEQUAL = 6,
		DRSCMP_GREATEREQUAL = 7,
		DRSCMP_ALWAYS = 8,
	};

	enum DBLEND
	{
		DBLEND_ZERO = 1,
		DBLEND_ONE = 2,
		DBLEND_SRC_COLOR = 3,
		DBLEND_INV_SRC_COLOR = 4,
		DBLEND_SRC_ALPHA = 5,
		DBLEND_INV_SRC_ALPHA = 6,
		DBLEND_DEST_ALPHA = 7,
		DBLEND_INV_DEST_ALPHA = 8,
		DBLEND_DEST_COLOR = 9,
		DBLEND_INV_DEST_COLOR = 10,
		DBLEND_SRC_ALPHA_SAT = 11,
		DBLEND_BLEND_FACTOR = 14,
		DBLEND_INV_BLEND_FACTOR = 15,
		DBLEND_SRC1_COLOR = 16,
		DBLEND_INV_SRC1_COLOR = 17,
		DBLEND_SRC1_ALPHA = 18,
		DBLEND_INV_SRC1_ALPHA = 19,

	};

	enum DBLENDOP
	{
		DBLENDOP_ADD = 1,
		DBLENDOP_SUBTRACT = 2,
		DBLENDOP_REVSUBTRACT = 3,
		DBLENDOP_MIN = 4,
		DBLENDOP_MAX = 5,
	};

	enum DCULL
	{
		DCULL_NONE = 1,
		DCULL_FRONT = 2,
		DCULL_BACK = 3,
	};

	enum DFILLMODE
	{
		DFILL_WIREFRAME = 2,
		DFILL_SOLID = 3,
	};

	enum DTEXADDRESS
	{
		DTEXADD_WRAP = 1,
		DTEXADD_MIRROR = 2,
		DTEXADD_CLAMP = 3,
		DTEXADD_BORDER = 4,
		DTEXADD_MIRRORONCE = 5,
	};

	enum DTEXFILTER
	{
		DTEXF_MIN_MAG_MIP_POINT = 0,
		DTEXF_MIN_MAG_POINT_MIP_LINEAR = 0x1,
		DTEXF_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4,
		DTEXF_MIN_POINT_MAG_MIP_LINEAR = 0x5,
		DTEXF_MIN_LINEAR_MAG_MIP_POINT = 0x10,
		DTEXF_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11,
		DTEXF_MIN_MAG_LINEAR_MIP_POINT = 0x14,
		DTEXF_MIN_MAG_MIP_LINEAR = 0x15,
		DTEXF_ANISOTROPIC = 0x55,
		DTEXF_COMPARISON_MIN_MAG_MIP_POINT = 0x80,
		DTEXF_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81,
		DTEXF_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
		DTEXF_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
		DTEXF_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
		DTEXF_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
		DTEXF_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
		DTEXF_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95,
		DTEXF_COMPARISON_ANISOTROPIC = 0xd5,
		DTEXF_TEXT_1BIT = 0x80000000,
	};

	enum DEDEPTHWRITEMASK
	{
		DEDWM_ZERO = 0,
		DEDWM_ALL = 1,
	};

	const unsigned int render_target_num = 8;
	const unsigned int sampler_num = 16;
	const unsigned int d3d_state_blocks_num = 4096;

	const unsigned char DCWM_RED = 1;
	const unsigned char DCWM_GREEN = 2;
	const unsigned char DCWM_BLUE = 4;
	const unsigned char DCWM_ALPHA = 8;
	const unsigned char DCWM_ALL = (DCWM_RED | DCWM_BLUE | DCWM_ALPHA | DCWM_GREEN);
};

#endif