//=============================================================================
//
// Copyright 1998 by Captivation Digital Laboratories, Inc.
// All Rights Reserved.
//
//=============================================================================
//
// "KRAD" -- Kamui Rendering/Animation Demonstration
//
// <<< INSERT MORE INFO HERE >>>
//
//=============================================================================
//-----------------------------------------------------------------------------
// $Revision: 1 $
// $NoKeywords: $
//=============================================================================

#ifndef _KPPVERTS_H_
#define _KPPVERTS_H_

#include "krad.h"
#include "kamuipp.h"

//=============================================================================
//=============================================================================	class KVContext
//=============================================================================

class KVContext
{
	protected:
		KMVERTEXCONTEXT		mVcontext;
		KMVERTEXTYPE		mVtype;
		uint32				mVsize;
		bool				mDirty;
		bool				mDirtyVtype;

	public:
		KVContext();							// initializes to default state
		~KVContext();

		void Set(void);							// processes (if necess.); sets and calls StartVertexStrip (if necess.)

		KMVERTEXTYPE ValidateVertexType();		// based on parameters, calculates best vertex type
												// PRIORITY OF FIELDS:		PARAM_TYPE (poly, sprite, modifier)
												//							Is modified (SelectModifier)?
												//							Is it non-textured and not specular lit?
												//							COLOR_TYPE (rgb, packed, intensity)
												//							UV_FORMAT (32 bit or 16 bit)

		KMVERTEXTYPE GetVertexType()			{
													if (mDirtyVtype)
														return(ValidateVertexType());
													return(mVtype);
												}

		// -- these functions are direct access at the vertex context --
		KMCOLORTYPE 			GetColorType()			{ return mVcontext.ColorType;			};
		KMUVFORMAT				GetUVFormat()			{ return mVcontext.UVFormat;			};
		KMSHADINGMODE			GetShadingMode()		{ return mVcontext.ShadingMode;			};
		KMMODIFIER				GetSelectModifier()		{ return mVcontext.SelectModifier;		};
		KMBOOLEAN				GetUseSpecular()		{ return mVcontext.bUseSpecular;		};
		KMDEPTHMODE				GetDepthMode()			{ return mVcontext.DepthMode;			};
		KMCULLINGMODE			GetCullingMode()		{ return mVcontext.CullingMode;			};
		KMFOGMODE				GetFogMode()			{ return mVcontext.FogMode;				};
		KMBOOLEAN				GetUseAlpha()			{ return mVcontext.bUseAlpha;			};
		KMBOOLEAN				GetIgnoreTextureAlpha()	{ return mVcontext.bIgnoreTextureAlpha;	};
		KMCLAMPMODE				GetClampUV()			{ return mVcontext.ClampUV;				};
		KMFLIPMODE				GetFlipUV()				{ return mVcontext.FlipUV;				};
		KMFILTERMODE			GetFilterMode()			{ return mVcontext.FilterMode;			};
		KMBOOLEAN				GetSuperSample()		{ return mVcontext.bSuperSample;		};
		KMDWORD					GetMipMapAdjust()		{ return mVcontext.MipMapAdjust;		};
		KMTEXTURESHADINGMODE	GetTextureShadingMode()	{ return mVcontext.TextureShadingMode;	};

		// -- these functions are *almost* direct access at the vertex context --
		void SetColorType			(KMCOLORTYPE			param)	{ mDirty = true; mDirtyVtype = true;	mVcontext.ColorType			= param;	};
		void SetUVFormat			(KMUVFORMAT				param)	{ mDirty = true; mDirtyVtype = true;	mVcontext.UVFormat				= param;	};
		void SetShadingMode			(KMSHADINGMODE			param)	{ mDirty = true; mDirtyVtype = true;	mVcontext.ShadingMode			= param;	};
		void SetSelectModifier		(KMMODIFIER				param)	{ mDirty = true; mDirtyVtype = true;	mVcontext.SelectModifier		= param;	};
		void SetUseSpecular			(KMBOOLEAN				param)	{ mDirty = true; mDirtyVtype = true;	mVcontext.bUseSpecular			= param;	};
		void SetDepthMode			(KMDEPTHMODE			param)	{ mDirty = true; mVcontext.DepthMode			= param;	};
		void SetCullingMode			(KMCULLINGMODE			param)	{ mDirty = true; mVcontext.CullingMode			= param;	};
		void SetFogMode				(KMFOGMODE				param)	{ mDirty = true; mVcontext.FogMode				= param;	};
		void SetUseAlpha			(KMBOOLEAN				param)	{ mDirty = true; mVcontext.bUseAlpha			= param;	};
		void SetIgnoreTextureAlpha	(KMBOOLEAN				param)	{ mDirty = true; mVcontext.bIgnoreTextureAlpha	= param;	};
		void SetClampUV				(KMCLAMPMODE			param)	{ mDirty = true; mVcontext.ClampUV				= param;	};
		void SetFlipUV				(KMFLIPMODE				param)	{ mDirty = true; mVcontext.FlipUV				= param;	};
		void SetFilterMode			(KMFILTERMODE			param)	{ mDirty = true; mVcontext.FilterMode			= param;	};
		void SetSuperSample			(KMBOOLEAN				param)	{ mDirty = true; mVcontext.bSuperSample			= param;	};
		void SetMipMapAdjust		(KMDWORD				param)	{ mDirty = true; mVcontext.MipMapAdjust			= param;	};
		void SetTextureShadingMode	(KMTEXTURESHADINGMODE	param)	{ mDirty = true; mVcontext.TextureShadingMode	= param;	};

		//SetTransparentStyle();
		//GetTransparentStyle();
		//Transparent()

		//TexturePtr()
		//ModifierParams()
		//IntensityParams()
};

class KVContextModifier : public KVContext
{
};

class KVContextBackground : public KVContext
{
};

//=============================================================================
//=============================================================================	class KDynVertex
//=============================================================================

class KDynVertex
{
	private:
	public:
		kvector     mTrans;       // transformed version of this vertex
//		kvector     mOrig;        // un-transformed version of this vertex - not used
		//float
		//float	dynamicR, dynamicG, dynamicB, dynamicA;
		//float	staticR, staticG, staticB, staticA;

	public:
		KDynVertex() {};
		~KDynVertex() {};
};

//=============================================================================
//=============================================================================	class KDynVertexArray
//=============================================================================
class KDynVertexArray
{

};

//=============================================================================
//=============================================================================
//=============================================================================

#endif  // Headerfile Guard

//=============================================================================	END-OF-INCLUDE