Mount Fuji Engine  0.8b
Data Structures | Enumerations | Functions
Rendering State Management

Data Structures

struct  MFStateConstant_AnimationMatrices
 Animation matrices. More...
 
struct  MFStateConstant_MatrixBatch
 Animation matrix batch. More...
 
struct  MFBlendStateDesc
 Blend state description. More...
 
struct  MFSamplerStateDesc
 Texture sampler state description. More...
 
struct  MFDepthStencilStateDesc
 Depth/stencil state description. More...
 
struct  MFRasteriserStateDesc
 Rasteriser state description. More...
 
struct  MFBlendState
 Represents a frame buffer blend state. More...
 
struct  MFSamplerState
 Represents a texture sampler state. More...
 
struct  MFDepthStencilState
 Represents a depth/stencil state. More...
 
struct  MFRasteriserState
 Represents a rasteriser state. More...
 
struct  MFStateBlock
 Represents a rendering state-block. More...
 

Enumerations

enum  MFStateConstant_Matrix {
  MFSCM_Unknown = -1, MFSCM_World = 0, MFSCM_Camera, MFSCM_Projection,
  MFSCM_ShadowMap, MFSCM_Fuji0, MFSCM_Fuji1, MFSCM_User0,
  MFSCM_User1, MFSCM_User2, MFSCM_User3, MFSCM_UV0,
  MFSCM_UV1, MFSCM_UV2, MFSCM_UV3, MFSCM_View,
  MFSCM_WorldView, MFSCM_ViewProjection, MFSCM_WorldViewProjection, MFSCM_InverseWorld,
  MFSCM_InverseViewProjection, MFSCM_Max, MFSCM_FujiMatrixCount = MFSCM_User0 - MFSCM_Fuji0, MFSCM_UserMatrixCount = MFSCM_UV0 - MFSCM_User0,
  MFSCM_UVMatrixCount = MFSCM_View - MFSCM_UV0 , MFSCM_ForceInt = 0x7FFFFFFF
}
 Matrix render states. More...
 
enum  MFStateConstant_Vector {
  MFSCV_Unknown = -1, MFSCV_Time = 0, MFSCV_FogColour, MFSCV_FogParams1,
  MFSCV_FogParams2, MFSCV_RenderState, MFSCV_MaterialDiffuseColour, MFSCV_DiffuseColour,
  MFSCV_AmbientColour, MFSCV_Fuji0, MFSCV_Fuji1, MFSCV_Fuji2,
  MFSCV_Fuji3, MFSCV_Fuji4, MFSCV_Fuji5, MFSCV_Fuji6,
  MFSCV_LightCounts, MFSCV_User0, MFSCV_User1, MFSCV_User2,
  MFSCV_User3, MFSCV_User4, MFSCV_User5, MFSCV_User6,
  MFSCV_User7, MFSCV_User8, MFSCV_User9, MFSCV_User10,
  MFSCV_User11, MFSCV_User12, MFSCV_User13, MFSCV_User14,
  MFSCV_User15, MFSCV_Max, MFSCV_FujiVectorCount = MFSCV_LightCounts - MFSCV_Fuji0, MFSCV_UserVectorCount = MFSCV_Max - MFSCV_User0,
  MFSCV_ForceInt = 0x7FFFFFFF
}
 Vector render states. More...
 
enum  MFStateConstant_Texture {
  MFSCT_Unknown = -1, MFSCT_Diffuse = 0, MFSCT_NormalMap, MFSCT_SpecularMap,
  MFSCT_DetailMap, MFSCT_OpacityMap, MFSCT_EnvironmentMap, MFSCT_SpecularPowerMap,
  MFSCT_EmissiveMap, MFSCT_LightMap, MFSCT_ShadowBuffer, MFSCT_Projection,
  MFSCT_User0, MFSCT_User1, MFSCT_User2, MFSCT_User3,
  MFSCT_User4, MFSCT_Vertex0, MFSCT_Vertex1, MFSCT_Vertex2,
  MFSCT_Max, MFSCV_FujiTextureCount = 0, MFSCV_UserTextureCount = MFSCT_Vertex0 - MFSCT_User0, MFSCV_VertexTextureCount = MFSCT_Max - MFSCT_Vertex0,
  MFSCT_ForceInt = 0x7FFFFFFF
}
 Texture render states. More...
 
enum  MFStateConstant_Bool {
  MFSCB_Unknown = -1, MFSCB_Animated = 0, MFSCB_ZPrime, MFSCB_ShadowGeneration,
  MFSCB_ShadowReceiving, MFSCB_Opaque, MFSCB_AlphaTest, MFSCB_Fuji0,
  MFSCB_Fuji1, MFSCB_Fuji2, MFSCB_User0, MFSCB_User1,
  MFSCB_User2, MFSCB_User3, MFSCB_DiffuseSet, MFSCB_NormalMapSet,
  MFSCB_SpecularMapSet, MFSCB_DetailMapSet, MFSCB_OpacityMapSet, MFSCB_EnvironmentMapSet,
  MFSCB_SpecularPowerMapSet, MFSCB_EmissiveMapSet, MFSCB_LightMapSet, MFSCB_ShadowBufferSet,
  MFSCB_ProjectorSet, MFSCB_UserTex0Set, MFSCB_UserTex1Set, MFSCB_UserTex2Set,
  MFSCB_UserTex3Set, MFSCB_UserTex4Set, MFSCB_VertexTex0Set, MFSCB_VertexTex1Set,
  MFSCB_VertexTex2Set, MFSCB_Max, MFSCB_FujiBoolCount = MFSCB_User0 - MFSCB_Fuji0, MFSCB_UserBoolCount = MFSCB_DiffuseSet - MFSCB_User0,
  MFSCB_ForceInt = 0x7FFFFFFF
}
 Bool render states. More...
 
enum  MFStateConstant_RenderState {
  MFSCRS_Unknown = -1, MFSCRS_BlendState = 0, MFSCRS_DepthStencilState, MFSCRS_RasteriserState,
  MFSCRS_DiffuseSamplerState, MFSCRS_NormalMapSamplerState, MFSCRS_SpecularMapSamplerState, MFSCRS_DetailMapSamplerState,
  MFSCRS_OpacityMapSamplerState, MFSCRS_EnvironmentMapSamplerState, MFSCRS_SpecularPowerMapSamplerState, MFSCRS_EmissiveMapSamplerState,
  MFSCRS_LightMapSamplerState, MFSCRS_ShadowBufferSamplerState, MFSCRS_ProjectorSamplerState, MFSCRS_UserTex0SamplerState,
  MFSCRS_UserTex1SamplerState, MFSCRS_UserTex2SamplerState, MFSCRS_UserTex3SamplerState, MFSCRS_UserTex4SamplerState,
  MFSCRS_VertexTex0SamplerState, MFSCRS_VertexTex1SamplerState, MFSCRS_VertexTex2SamplerState, MFSCRS_VertexDeclaration,
  MFSCRS_VertexBuffer0, MFSCRS_VertexBuffer1, MFSCRS_VertexBuffer2, MFSCRS_VertexBuffer3,
  MFSCRS_VertexBuffer4, MFSCRS_VertexBuffer5, MFSCRS_VertexBuffer6, MFSCRS_VertexBuffer7,
  MFSCRS_IndexBuffer, MFSCRS_Max, MFSCRS_VertexBufferCount = MFSCRS_VertexBuffer0 - MFSCRS_IndexBuffer, MFSCRS_ForceInt = 0x7FFFFFFF
}
 Render states. More...
 
enum  MFStateConstant_Miscellaneous {
  MFSCMisc_Unknown = -1, MFSCMisc_AnimationMatrices, MFSCMisc_MatrixBatch, MFSCMisc_Light0,
  MFSCMisc_Light1, MFSCMisc_Light2, MFSCMisc_Light3, MFSCMisc_Light4,
  MFSCMisc_Light5, MFSCMisc_Light6, MFSCMisc_Light7, MFSCMisc_Light8,
  MFSCMisc_Light9, MFSCMisc_Light10, MFSCMisc_Light11, MFSCMisc_Light12,
  MFSCMisc_Light13, MFSCMisc_Light14, MFSCMisc_Light15, MFSCMisc_GPUEvent,
  MFSCMisc_Max, MFSCMisc_LightCount = MFSCMisc_GPUEvent - MFSCMisc_Light0, MFSCMisc_ForceInt = 0x7FFFFFFF
}
 Miscellaneous render states. More...
 
enum  MFBlendOp {
  MFBlendOp_Unknown = -1, MFBlendOp_Add = 0, MFBlendOp_Subtract, MFBlendOp_RevSubtract,
  MFBlendOp_Min, MFBlendOp_Max, MFBlendOp_BlendOpCount, MFBlendOp_ForceInt = 0x7FFFFFFF
}
 Blend operation. More...
 
enum  MFBlendArg {
  MFBlendArg_Unknown = -1, MFBlendArg_Zero = 0, MFBlendArg_One, MFBlendArg_SrcColour,
  MFBlendArg_InvSrcColour, MFBlendArg_SrcAlpha, MFBlendArg_InvSrcAlpha, MFBlendArg_DestColour,
  MFBlendArg_InvDestColour, MFBlendArg_DestAlpha, MFBlendArg_InvDestAlpha, MFBlendArg_SrcAlphaSaturate,
  MFBlendArg_BlendFactor, MFBlendArg_InvBlendFactor, MFBlendArg_Src1Colour, MFBlendArg_InvSrc1Colour,
  MFBlendArg_Src1Alpha, MFBlendArg_InvSrc1Alpha, MFBlendArg_Max, MFBlendArg_ForceInt = 0x7FFFFFFF
}
 Blend arguments. More...
 
enum  MFColourWriteEnable {
  MFColourWriteEnable_None = 0, MFColourWriteEnable_Red = 1, MFColourWriteEnable_Green = 2, MFColourWriteEnable_Blue = 4,
  MFColourWriteEnable_Alpha = 8, MFColourWriteEnable_All = (MFColourWriteEnable_Red | MFColourWriteEnable_Green | MFColourWriteEnable_Blue | MFColourWriteEnable_Alpha), MFColourWriteEnable_RGB = (MFColourWriteEnable_Red | MFColourWriteEnable_Green | MFColourWriteEnable_Blue)
}
 Colour write flags. More...
 
enum  MFTexFilter {
  MFTexFilter_Unknown = -1, MFTexFilter_None, MFTexFilter_Point, MFTexFilter_Linear,
  MFTexFilter_Anisotropic, MFTexFilter_Max, MFTexFilter_ForceInt = 0x7FFFFFFF
}
 Texture filter mode. More...
 
enum  MFTexAddressMode {
  MFTexAddressMode_Unknown = -1, MFTexAddressMode_Wrap = 0, MFTexAddressMode_Mirror, MFTexAddressMode_Clamp,
  MFTexAddressMode_Border, MFTexAddressMode_MirrorOnce, MFTexAddressMode_Max, MFTexAddressMode_ForceInt = 0x7FFFFFFF
}
 Texture address mode. More...
 
enum  MFComparisonFunc {
  MFComparisonFunc_Unknown = -1, MFComparisonFunc_Never = 0, MFComparisonFunc_Less, MFComparisonFunc_Equal,
  MFComparisonFunc_LessEqual, MFComparisonFunc_Greater, MFComparisonFunc_NotEqual, MFComparisonFunc_GreaterEqual,
  MFComparisonFunc_Always, MFComparisonFunc_Max, MFComparisonFunc_ForceInt = 0x7FFFFFFF
}
 Comparison function. More...
 
enum  MFDepthWriteMask {
  MFDepthWriteMask_Unknown = -1, MFDepthWriteMask_Zero = 0, MFDepthWriteMask_All = 1, MFDepthWriteMask_Max,
  MFDepthWriteMask_ForceInt = 0x7FFFFFFF
}
 Depth write mask. More...
 
enum  MFStencilOp {
  MFStencilOp_Unknown = -1, MFStencilOp_Keep = 0, MFStencilOp_Zero, MFStencilOp_Replace,
  MFStencilOp_IncrementClamp, MFStencilOp_DecrementClamp, MFStencilOp_Invert, MFStencilOp_Increment,
  MFStencilOp_Decrement, MFStencilOp_Max, MFStencilOp_ForceInt = 0x7FFFFFFF
}
 Stencil operation. More...
 
enum  MFFillMode {
  MFFillMode_Unknown = -1, MFFillMode_Solid = 0, MFFillMode_Wireframe, MFFillMode_Point,
  MFFillMode_Max, MFFillMode_ForceInt = 0x7FFFFFFF
}
 Fill mode. More...
 
enum  MFCullMode {
  MFCullMode_Unknown = -1, MFCullMode_None = 0, MFCullMode_CCW, MFCullMode_CW,
  MFCullMode_Max, MFCullMode_ForceInt = 0x7FFFFFFF
}
 Cull mode. More...
 
enum  MFStateBlockConstantType {
  MFSB_CT_Bool = 0, MFSB_CT_Vector, MFSB_CT_Matrix, MFSB_CT_Texture,
  MFSB_CT_RenderState, MFSB_CT_Misc, MFSB_CT_Unknown = 7, MFSB_CT_TypeCount,
  MFSB_CT_ForceInt = 0x7FFFFFFF
}
 State block constant type. More...
 

Functions

MF_API MFBlendStateMFBlendState_Create (MFBlendStateDesc *pDesc)
 Create a blend state object. More...
 
MF_API int MFBlendState_Release (MFBlendState *pBlendState)
 Release a blend state object. More...
 
MF_API MFSamplerStateMFSamplerState_Create (MFSamplerStateDesc *pDesc)
 Create a texture sampler state object. More...
 
MF_API int MFSamplerState_Release (MFSamplerState *pSamplerState)
 Release a texture sampler state object. More...
 
MF_API MFDepthStencilStateMFDepthStencilState_Create (MFDepthStencilStateDesc *pDesc)
 Create a depth/stencil state object. More...
 
MF_API int MFDepthStencilState_Release (MFDepthStencilState *pDepthStencilState)
 Release a depth/stencil state object. More...
 
MF_API MFRasteriserStateMFRasteriserState_Create (MFRasteriserStateDesc *pDesc)
 Create a rasteriser state object. More...
 
MF_API int MFRasteriserState_Release (MFRasteriserState *pRasteriserState)
 Release a rasteriser state object. More...
 
MF_API MFStateBlockMFStateBlock_Create (uint32 size)
 Create a state block. More...
 
MF_API MFStateBlockMFStateBlock_CreateTemporary (uint32 size)
 Create a temporary state block. More...
 
MF_API void MFStateBlock_Destroy (MFStateBlock *pStateBlock)
 Destroy a state block. More...
 
MF_API MFStateBlockMFStateBlock_Clone (MFStateBlock *pSource)
 Clone a state block. More...
 
MF_API void MFStateBlock_Copy (MFStateBlock *pSource, MFStateBlock *pDest)
 Copy a state block. More...
 
MF_API MFStateBlockMFStateBlock_Merge (MFStateBlock *pSource1, MFStateBlock *pSource2)
 Merge 2 state blocks. More...
 
MF_API void MFStateBlock_Clear (MFStateBlock *pStateBlock)
 Clear a state block. More...
 
MF_API size_t MFStateBlock_GetAllocatedBytes (MFStateBlock *pStateBlock)
 Get the allocation size of a state block. More...
 
MF_API size_t MFStateBlock_GetUsedBytes (MFStateBlock *pStateBlock)
 Get the size of a state block. More...
 
MF_API size_t MFStateBlock_GetFreeBytes (MFStateBlock *pStateBlock)
 Get the number of available bytes in a state block. More...
 
MF_API const char * MFStateBlock_GetRenderStateName (MFStateBlockConstantType constantType, int constant)
 Get a render state name. More...
 
MF_API bool MFStateBlock_SetBool (MFStateBlock *pStateBlock, MFStateConstant_Bool constant, bool state)
 Set a bool render state. More...
 
MF_API bool MFStateBlock_SetVector (MFStateBlock *pStateBlock, MFStateConstant_Vector constant, const MFVector &state)
 Set a vector render state. More...
 
MF_API bool MFStateBlock_SetMatrix (MFStateBlock *pStateBlock, MFStateConstant_Matrix constant, const MFMatrix &state)
 Set a matrix render state. More...
 
MF_API bool MFStateBlock_SetTexture (MFStateBlock *pStateBlock, MFStateConstant_Texture constant, MFTexture *pTexture)
 Set a texture render state. More...
 
MF_API bool MFStateBlock_SetRenderState (MFStateBlock *pStateBlock, MFStateConstant_RenderState renderState, void *pState)
 Set a render state. More...
 
MF_API bool MFStateBlock_SetMiscState (MFStateBlock *pStateBlock, MFStateConstant_Miscellaneous miscState, const void *pStateData, size_t dataSize)
 Set a miscellaneous render state. More...
 
bool MFStateBlock_SetAnimMatrices (MFStateBlock *pStateBlock, const MFStateConstant_AnimationMatrices &matrices)
 Set the animation matrices render state. More...
 
bool MFStateBlock_SetMatrixBatch (MFStateBlock *pStateBlock, const MFStateConstant_MatrixBatch &batch)
 Set the animation matrix batch render state. More...
 
MF_API bool MFStateBlock_GetBool (MFStateBlock *pStateBlock, MFStateConstant_Bool constant, bool *pState)
 Get a bool render state. More...
 
MF_API bool MFStateBlock_GetVector (MFStateBlock *pStateBlock, MFStateConstant_Vector constant, MFVector *pState)
 Get a vector render state. More...
 
MF_API bool MFStateBlock_GetMatrix (MFStateBlock *pStateBlock, MFStateConstant_Matrix constant, MFMatrix *pState)
 Get a matrix render state. More...
 
MF_API bool MFStateBlock_GetTexture (MFStateBlock *pStateBlock, MFStateConstant_Texture constant, MFTexture **ppTexture)
 Get a texture render state. More...
 
MF_API bool MFStateBlock_GetRenderState (MFStateBlock *pStateBlock, MFStateConstant_RenderState renderState, void **ppState)
 Get a render state. More...
 
MF_API bool MFStateBlock_GetMiscState (MFStateBlock *pStateBlock, MFStateConstant_Miscellaneous miscState, void **ppStateData)
 Get a miscellaneous render state. More...
 
MF_API void MFStateBlock_ClearBool (MFStateBlock *pStateBlock, MFStateConstant_Bool constant)
 Clear a bool render state. More...
 
MF_API void MFStateBlock_ClearVector (MFStateBlock *pStateBlock, MFStateConstant_Vector constant)
 Clear a vector render state. More...
 
MF_API void MFStateBlock_ClearMatrix (MFStateBlock *pStateBlock, MFStateConstant_Matrix constant)
 Clear a matrix render state. More...
 
MF_API void MFStateBlock_ClearTexture (MFStateBlock *pStateBlock, MFStateConstant_Texture constant)
 Clear a texture render state. More...
 
MF_API void MFStateBlock_ClearRenderState (MFStateBlock *pStateBlock, MFStateConstant_RenderState renderState)
 Clear a render state. More...
 
MF_API void MFStateBlock_ClearMiscState (MFStateBlock *pStateBlock, MFStateConstant_Miscellaneous miscState)
 Clear a miscellaneous render state. More...
 
MFStateConstant_Matrix MFSCM_Fuji (int index)
 Get MFSCM_Fuji# constant by index. More...
 
MFStateConstant_Matrix MFSCM_User (int index)
 Get MFSCM_User# constant by index. More...
 
MFStateConstant_Matrix MFSCM_UV (int index)
 Get MFSCM_UV# constant by index. More...
 
MFStateConstant_Vector MFSCV_Fuji (int index)
 Get MFSCV_Fuji# constant by index. More...
 
MFStateConstant_Vector MFSCV_User (int index)
 Get MFSCV_User# constant by index. More...
 
MFStateConstant_Texture MFSCT_Fuji (int index)
 Get MFSCT_Fuji# constant by index. More...
 
MFStateConstant_Texture MFSCT_User (int index)
 Get MFSCT_User# constant by index. More...
 
MFStateConstant_Texture MFSCT_Vertex (int index)
 Get MFSCT_Vertex# constant by index. More...
 
MFStateConstant_Bool MFSCB_Fuji (int index)
 Get MFSCB_Fuji# constant by index. More...
 
MFStateConstant_Bool MFSCB_User (int index)
 Get MFSCB_User# constant by index. More...
 
MFStateConstant_Bool MFSCB_TexSet (MFStateConstant_Texture type)
 Get MFSCB_XXXXSet constant by type. More...
 
MFStateConstant_RenderState MFSCRS_SamplerState (MFStateConstant_Texture type)
 Get MFSCRS_XXXXSamplerState constant by type. More...
 
MFStateConstant_RenderState MFSCRS_VertexBuffer (int index)
 Get MFSCRS_VertexBuffer# constant by index. More...
 
MFStateConstant_Miscellaneous MFSCMisc_Light (int index)
 Get MFSCMisc_Light# constant by index. More...
 

Detailed Description