#include "dxmultisample.h"

D3DMULTISAMPLE_TYPE_RECORD DXMultiSampleTypes[] =
{
	{MULTISAMPLE_NONE, "D3DMULTISAMPLE_NONE"},
	{MULTISAMPLE_NONMASKABLE, "D3DMULTISAMPLE_NONMASKABLE"},
	{MULTISAMPLE_2_SAMPLES, "D3DMULTISAMPLE_2_SAMPLES"},
	{MULTISAMPLE_3_SAMPLES, "D3DMULTISAMPLE_3_SAMPLES"},
	{MULTISAMPLE_4_SAMPLES, "D3DMULTISAMPLE_4_SAMPLES"},
	{MULTISAMPLE_5_SAMPLES, "D3DMULTISAMPLE_5_SAMPLES"},
	{MULTISAMPLE_6_SAMPLES, "D3DMULTISAMPLE_6_SAMPLES"},
	{MULTISAMPLE_7_SAMPLES, "D3DMULTISAMPLE_7_SAMPLES"},
	{MULTISAMPLE_8_SAMPLES, "D3DMULTISAMPLE_8_SAMPLES"},
	{MULTISAMPLE_9_SAMPLES, "D3DMULTISAMPLE_9_SAMPLES"},
	{MULTISAMPLE_10_SAMPLES, "D3DMULTISAMPLE_10_SAMPLES"},
	{MULTISAMPLE_11_SAMPLES, "D3DMULTISAMPLE_11_SAMPLES"},
	{MULTISAMPLE_12_SAMPLES, "D3DMULTISAMPLE_12_SAMPLES"},
	{MULTISAMPLE_13_SAMPLES, "D3DMULTISAMPLE_13_SAMPLES"},
	{MULTISAMPLE_14_SAMPLES, "D3DMULTISAMPLE_14_SAMPLES"},
	{MULTISAMPLE_15_SAMPLES, "D3DMULTISAMPLE_15_SAMPLES"},
	{MULTISAMPLE_16_SAMPLES, "D3DMULTISAMPLE_16_SAMPLES"}
};

CONST UINT cuiNoOfMultiSampleTypes = sizeof(DXMultiSampleTypes) / sizeof(DXMultiSampleTypes[0]);

const D3DMULTISAMPLE_TYPE_RECORD* FindMultiSampleRecord(MULTISAMPLE_TYPE mst)
{
	UINT uiMSTRecordIndex;

	for
	(
		uiMSTRecordIndex = 0;
		uiMSTRecordIndex < cuiNoOfMultiSampleTypes;
		++uiMSTRecordIndex
	)
	{
			if (DXMultiSampleTypes[uiMSTRecordIndex].mstFW == mst)
				return &(DXMultiSampleTypes[uiMSTRecordIndex]);
	}

	return NULL;
}
