//	Darkstar Engine  (c) UnderWorld Interactive Studio (all coding by Svarog    2007-2008)
//
//      Данный файл является частью Darkstar Engine. Любое использование кода файла
//      без согласия компании, является нарушением закона об авторском праве (в слу-
//      чае если не оговорено обратное).
//
//      Имя файла: rs_common.hpp
//      Краткое описание: common structures and enums to resource system
//

#ifndef DSE_RS_RS_COMMON_HPP
#define DSE_RS_RS_COMMON_HPP

#include <Darkstar/Graphic System/Direct3D/direct3d_include.hpp>

namespace rs
{
	enum DSEFORMAT
	{
		DFMT_R32G32B32A32_TYPELESS = 1,
		DFMT_R32G32B32A32_FLOAT = 2,
		DFMT_R32G32B32A32_UINT = 3,
		DFMT_R32G32B32A32_SINT = 4,
		DFMT_R32G32B32_TYPELESS = 5,
		DFMT_R32G32B32_FLOAT = 6,
		DFMT_R32G32B32_UINT = 7,
		DFMT_R32G32B32_SINT = 8,
		DFMT_R16G16B16A16_TYPELESS = 9,
		DFMT_R16G16B16A16_FLOAT = 10,
		DFMT_R16G16B16A16_UNORM = 11,
		DFMT_R16G16B16A16_UINT = 12,
		DFMT_R16G16B16A16_SNORM = 13,
		DFMT_R16G16B16A16_SINT = 14,
		DFMT_R32G32_TYPELESS = 15,
		DFMT_R32G32_FLOAT = 16,
		DFMT_R32G32_UINT = 17,
		DFMT_R32G32_SINT = 18,
		DFMT_R32G8X24_TYPELESS = 19,
		DFMT_R32_FLOAT_X8X24_TYPELESS = 21,
		DFMT_X32_TYPELESS_G8X24_UINT = 22,
		DFMT_R10G10B10A2_TYPELESS = 23,
		DFMT_R10G10B10A2_UNORM = 24,
		DFMT_R10G10B10A2_UINT = 25,
		DFMT_R11G11B10_FLOAT = 26,
		DFMT_R8G8B8A8_TYPELESS = 27,
		DFMT_R8G8B8A8_UNORM = 28,
		DFMT_R8G8B8A8_UNORM_SRGB = 29,
		DFMT_R8G8B8A8_UINT = 30,
		DFMT_R8G8B8A8_SNORM = 31,
		DFMT_R8G8B8A8_SINT = 32,
		DFMT_R16G16_TYPELESS = 33,
		DFMT_R16G16_FLOAT = 34,
		DFMT_R16G16_UNORM = 35,
		DFMT_R16G16_UINT = 36,
		DFMT_R16G16_SNORM = 37,
		DFMT_R16G16_SINT = 38,
		DFMT_R32_TYPELESS = 39,
		DFMT_R32_FLOAT = 41,
		DFMT_R32_SINT = 43,
		DFMT_R24G8_TYPELESS = 44,
		DFMT_R24_UNORM_X8_TYPELESS = 46,
		DFMT_X24_TYPELESS_G8_UINT = 47,
		DFMT_R8G8_TYPELESS = 48,
		DFMT_R8G8_UNORM = 49,
		DFMT_R8G8_UINT = 50,
		DFMT_R8G8_SNORM = 51,
		DFMT_R8G8_SINT = 52,
		DFMT_R16_TYPELESS = 53,
		DFMT_R16_FLOAT = 54,
		DFMT_R16_UNORM = 56,
		DFMT_R16_SNORM = 58,
		DFMT_R16_SINT = 59,
		DFMT_R8_TYPELESS = 60,
		DFMT_R8_UNORM = 61,
		DFMT_R8_UINT = 62,
		DFMT_R8_SNORM = 63,
		DFMT_R8_SINT = 64,
		DFMT_A8_UNORM = 65,
		DFMT_R1_UNORM = 66,
		DFMT_R9G9B9E5_SHAREDEXP = 67,
		DFMT_R8G8_B8G8_UNORM = 68,
		DFMT_G8R8_G8B8_UNORM = 69,
		DFMT_BC1_UNORM = 71,
		DFMT_BC2_UNORM = 74,
		DFMT_BC3_UNORM = 77,
		DFMT_B5G6R5_UNORM = 85,
		DFMT_B5G5R5A1_UNORM = 86,
		DFMT_B8G8R8A8_UNORM = 87,
		DFMT_B8G8R8X8_UNORM = 88,
		DFMT_UNKNOWN = 0,
	};

	enum DEUSAGE
	{
		DEU_DEFAULT = 0,
		DEU_IMMUTABLE = 1,
		DEU_DYNAMIC = 2,
		DEU_STAGING = 3,
	};

	enum DEMAPTYPE
	{
		DEMT_READ = 1,
		DEMT_WRITE = 2,
		DEMT_READ_WRITE = 3,
		DEMT_WRITE_DISCARD = 4,
		DEMT_WRITE_NO_OVERWRITE = 5,
	};

	enum DE_PRIMITIVE_TOPOLOGY
	{
		DEPT_UNDEFINED = 0,
		DEPT_POINTLIST = 1,
		DEPT_LINELIST = 2,
		DEPT_LINESTRIP = 3,
		DEPT_TRIANGLELIST = 4,
		DEPT_TRIANGLESTRIP = 5,
		DEPT_LINELIST_ADJ = 10,
		DEPT_LINESTRIP_ADJ = 11,
		DEPT_TRIANGLELIST_ADJ = 12,
		DEPT_TRIANGLESTRIP_ADJ = 13,
	};

	struct DEViewport
	{
		unsigned int topx;
		unsigned int topy;
		unsigned int width;
		unsigned int height;
		float min_depth;
		float max_depth;
	};

	struct INPUT_ELEMENT
	{
		std::string usage;
		unsigned int usage_index;
		unsigned int stream;
		unsigned int offset;
		DSEFORMAT format;
	};

	RTFORMAT getSpecFormat(const DSEFORMAT& darkstar_format);
};

#endif

