IDxMaterial.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 *<
00003 FILE: IDxMaterial.h
00004 
00005 DESCRIPTION:    Interface for accessing the bitmaps used by effects in the DxMaterial
00006 
00007 CREATED BY:     Neil Hazzard
00008 
00009 HISTORY:        Created:  07/08/03
00010 
00011 
00012 *>  Copyright (c) 2003, All Rights Reserved.
00013 **********************************************************************/
00014 #pragma once
00015 
00016 #include "iFnPub.h"
00017 #include "AssetManagement/AssetUser.h"
00018 
00019 // forward declarations
00020 class IEffectParser;
00021 class IParameterManager;
00022 class ILightManager;
00023 
00024 typedef interface ID3DXEffect * LPD3DXEFFECT;
00025 typedef LPCSTR D3DXHANDLE;
00026 typedef D3DXHANDLE *LPD3DXHANDLE;
00027 
00028 
00029 #define IDXMATERIAL_INTERFACE Interface_ID(0x55b3201d, 0x29ab7fc3)
00030 #define IDXMATERIAL2_INTERFACE Interface_ID(0x54e4202f, 0x30ab6bc4)
00031 #define IDXMATERIAL3_INTERFACE Interface_ID(0xde24e62f, 0x1a8fd412)
00032 
00034 
00044 class IDxMaterial : public FPMixinInterface
00045 {
00046 
00047 public:
00048     enum LightSemantics
00049     {
00050         LIGHT_COLOR,
00051         LIGHT_DIRECTION,
00052         LIGHT_POSITION,
00053         LIGHT_FALLOFF,
00054         LIGHT_HOTSPOT,
00055         LIGHT_ATTENUATION
00056     };
00057 
00059     virtual void ReloadDXEffect()=0;
00060 
00062 
00068     virtual int GetNumberOfEffectBitmaps()=0;
00069 
00071 
00075     virtual PBBitmap * GetEffectBitmap(int index)=0;
00076 
00078 
00082     virtual void SetEffectBitmap(int index,PBBitmap * bmap)=0;
00083 
00085 
00088     virtual const MaxSDK::AssetManagement::AssetUser&  GetEffectFile() = 0;
00089     
00091 
00094     virtual void SetEffectFile(const MaxSDK::AssetManagement::AssetUser& file) = 0;
00095     
00097 
00100     virtual PBBitmap * GetSoftwareRenderBitmap() = 0;
00101 
00103 
00106     virtual void SetSoftwareRenderBitmap(PBBitmap * bmap) = 0;
00107 
00108     //************************************************************************************
00109     // The following method are not exposed through function publishing
00110     //************************************************************************************
00111 
00113 
00117     virtual int GetNumberOfLightParams()=0;
00118 
00120 
00127     virtual INode * GetLightNode(int index)=0;
00128 
00130     /*
00131      \param index The index of the light to retrieve
00132      \return A MCHAR* containing the name
00133      */
00134     virtual MCHAR * GetLightParameterName(int index)=0;
00135 
00137     /*
00138      \param index THe index of the light to retrieve    
00139      \return The semantic represented as a LightSemantics
00140      */
00141     virtual LightSemantics GetLightSemantic(int index)=0;
00142 
00143 };
00144 
00150 class IDxMaterial2 : public IDxMaterial
00151 {
00152 
00153 public:
00154     enum BitmapTypes
00155     {
00156         UNKNOWN_MAP,
00157         DIFFUSE_MAP,
00158         BUMP_MAP,
00159         SPECULAR_MAP,
00160         OPACITY_MAP,
00161         DISPLACEMENT_MAP,
00162         LIGHTMAP_MAP,
00163         NORMAL_MAP,
00164         REFLECTION_MAP
00165     };
00166 
00168 
00173     virtual int GetBitmapMappingChannel(int index) = 0;
00174 
00176 
00181     virtual BitmapTypes GetBitmapUsage(int index) = 0;
00182 
00184 
00188     virtual void SetMappingChannel(int bitmapIndex, int mapChannel)=0;
00189 
00190 };
00191 
00192 class IDxMaterial3 : public IDxMaterial2
00193 {
00194 public:
00196 
00199     virtual IEffectParser * GetCurrentParser()=0;
00200 
00202 
00206     virtual INode * GetLightNode(D3DXHANDLE handle)=0;
00207 
00209 
00212     virtual IParameterManager* GetCurrentParameterManager() =0;
00213 
00215 
00218     virtual int GetNumberOfTechniques() =0;
00219 
00221     /* Returns the technique name based on the index supplied
00222     \param index The index of the technique
00223     \return The name of the technique
00224     */
00225     virtual const MCHAR * GetTechniqueName(int index)=0;
00226 
00228     /* Returns the name of the current active technique
00229     \return The technique name
00230     */
00231     virtual const MCHAR * GetCurrentTechniqueName()=0;
00232 
00234 
00238     virtual ILightManager * GetCurrentLightManager() =0;
00239 
00240 };
00241