IGameFX.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 *<
00003 FILE: IGameFX.h
00004 
00005 DESCRIPTION: D3D Effect interfaces for IGame
00006 
00007 CREATED BY: Neil Hazzard,  Autodesk Ltd
00008 
00009 HISTORY: created 06/25/05
00010 
00011 IGame Version: 1.122
00012 
00013 *>  Copyright (c) 2005, All Rights Reserved.
00014 **********************************************************************/
00015 #pragma once
00016 
00017 #include "..\maxheap.h"
00018 #include "..\BuildWarnings.h"
00019 #include "..\strclass.h"
00020 
00021 // forward declarations
00022 class IGameNode;
00023 class IGameProperty;
00024 class IGameFXProperty;
00025 class IGameFXTechnique;
00026 class IGameFXFunction;
00027 namespace MaxSDK
00028 {
00029     namespace AssetManagement
00030     {
00031         class AssetUser;
00032     }
00033 }
00034 class Mtl;
00035 
00037 
00040 class IGameFX: public MaxHeapOperators
00041 {
00042 
00043 public:
00044 
00046     enum EffectSource{
00047         kFile,          
00048         kBuffer         
00049     };
00050 
00052     enum IGameFXProfile{
00053         kVSPS_20,       
00054         kVSPS_2X,       
00055         kVSPS_30        
00056     };
00058     virtual ~IGameFX() {;}
00059 
00061     virtual bool Initialize(const MaxSDK::AssetManagement::AssetUser& effect, EffectSource input)=0;
00062 
00064     virtual bool ParseData(Mtl * effectMtl)=0;
00065 
00066     virtual const MCHAR* GetError()=0;
00067 
00069     virtual int GetNumberOfProperties()=0;
00070 
00072     virtual IGameFXProperty * GetIGameFXProperty(int index)=0;
00073 
00075     virtual int GetNumberOfTechniques()=0;
00076 
00078     virtual IGameFXTechnique* GetIGameFXTechnique(int index)=0;
00079 
00081     virtual int GetNumberOfFunctions() =0 ;
00082 
00084     virtual IGameFXFunction * GetIGameFXFunction(int index) = 0;
00085 
00087     virtual const MaxSDK::AssetManagement::AssetUser & GetEffectFile() = 0;
00088 };
00089 
00090 
00092 
00097 class IGameFXProperty: public MaxHeapOperators
00098 {
00099 public:
00100 
00101     enum IGameFXPropUsage{
00102         IGAMEFX_GENERAL,    
00103         IGAMEFX_SAMPLER,    
00104         IGAMEFX_LIGHT,      
00105         IGAMEFX_TEXTURE     
00106     };
00108     virtual ~IGameFXProperty() {;}
00109 
00111 
00114     virtual IGameProperty * GetIGameProperty() =0;
00115 
00117     virtual IGameFXPropUsage GetPropertyUsage()=0;
00118 
00120     virtual const MCHAR * GetFXSemantic()=0;
00121 
00123     virtual int GetNumberOfFXAnnotations()=0;
00124 
00126     virtual bool GetFXAnnotation(int index, MSTR * languageType, MSTR * key, MSTR * value)=0;
00127 
00129     virtual const MCHAR * GetFXDefaultValue()=0;
00130 
00132     virtual int GetNumberofFXPipeStates()=0;
00133 
00135     virtual bool GetPipeStates(int index, MSTR * key, MSTR *value)=0;
00136 
00138     virtual const MCHAR * GetPropertyName()=0;
00139 
00141     virtual const MCHAR * GetPropertyType() = 0;
00142 
00144     virtual IGameNode * GetBindingNode() = 0;
00145 };
00146 
00148 
00150 class IGameFXPass: public MaxHeapOperators{
00151 public:
00153     virtual ~IGameFXPass() {;}
00154 
00156     virtual const MCHAR * GetPassName()=0;
00157 
00159     virtual int GetNumberOfFXAnnotations()=0;
00160 
00162     virtual bool GetFXAnnotation(int index, MSTR * languageType, MSTR * key, MSTR * value)=0;
00163 
00165     virtual int GetNumberofFXPipeStates()=0;
00166 
00168     virtual bool GetPipeStates(int index, MSTR * key, MSTR *value)=0;
00169 
00171 
00176     virtual bool GetVertexShader(MSTR * entry, MSTR * code)=0;
00177     
00179 
00184     virtual bool GetPixelShader(MSTR * entry, MSTR * code)=0;
00185 
00187     virtual IGameFX::IGameFXProfile GetTargetProfile()=0;
00188 };
00189 
00191 class IGameFXTechnique: public MaxHeapOperators
00192 {
00193 public:
00195     virtual ~IGameFXTechnique() {;}
00196 
00198     virtual int GetNumberOfPasses()=0;
00199 
00201     virtual const MCHAR * GetTechniqueName()=0;
00202 
00204     virtual int GetNumberOfFXAnnotations()=0;
00205 
00207     virtual bool GetFXAnnotation(int index, MSTR * languageType, MSTR * key, MSTR * value)=0;
00208 
00210     virtual IGameFXPass * GetIGameFXPass(int index)=0;
00211 };
00212 
00214 class IGameFXFunction: public MaxHeapOperators
00215 {
00216 public:
00218     virtual ~IGameFXFunction() {;}
00219 
00221     virtual const MCHAR * GetFunctionBody()=0;
00222 
00224     virtual const MCHAR * GetFunctionName()=0;
00225 };