MidiVid Home 

MidiVidInterface.h

Go to the documentation of this file.
00001 /* 00002 00003 MidiVidInterface.h - Interface class to give plug-ins access to MidiVid 00004 00005 */ 00006 00007 #pragma once 00008 #ifndef MIDIVIDINTERFACE_H 00009 #define MIDIVIDINTERFACE_H 00010 00011 #include <Windows.h> 00012 #include <MMSystem.h> 00013 #include <DSound.h> 00014 #include <D3D9.h> 00015 #include <D3DX9.h> 00016 00025 template <class Type> void ReleasePtr(Type &pPtr) 00026 { 00027 if(pPtr != 0) (pPtr)->Release(); 00028 pPtr = 0; 00029 } 00030 00031 00032 typedef IDirect3DTexture9 *Texture; 00033 typedef IDirect3DSurface9 *Surface; 00034 typedef IDirect3DVertexShader9 *VertexShader; 00035 typedef IDirect3DPixelShader9 *PixelShader; 00036 typedef ID3DXConstantTable *ConstantTable; 00037 00038 class MVSourcePlug; 00039 00040 void Log(const char *pString, ...); 00041 00042 00043 00044 struct CompileShaderInfo 00045 { 00046 CompileShaderInfo() : pShaderSource(0), SourceLen(0), pDefines(0), pInclude(0), pFuncName(0), pProfile(0), Flags( 0/*D3DXSHADER_PARTIALPRECISION*/), ppConsts(0) {;} 00047 00048 const char *pShaderSource; 00049 UINT SourceLen; 00050 00051 D3DXMACRO *pDefines; 00052 LPD3DXINCLUDE pInclude; 00053 00054 const char *pFuncName; 00055 const char *pProfile; 00056 DWORD Flags; 00057 00058 LPD3DXCONSTANTTABLE *ppConsts; 00059 }; 00060 00061 00062 00072 class MidiVidInterface 00073 { 00074 public: 00075 MidiVidInterface(); 00076 00077 virtual HWND GetHWnd(void); 00078 virtual HINSTANCE GetHInst(void); 00079 00080 virtual IDirect3DDevice9 *GetDevice(void) {return pDevice;} 00081 virtual D3DSURFACE_DESC &GetDesc(void) {return Desc;} 00082 00083 virtual IDirectSound8 *GetDS(void); 00084 virtual Surface GetTarget(void); 00085 00086 virtual bool CPUIDPresent(void) const {return bCPUIDPresent;} 00087 virtual bool MMXPresent(void) const {return bMMXPresent;} 00088 virtual bool CMOVPresent(void) const {return bCMOVPresent;} 00089 virtual long CPUSpeed(void) const {return dwCPUSpeed;} 00090 virtual long GetRAMKB(void) const {return KBRAM;} 00091 00092 virtual bool NonPow2Textures(void) const {return bNonPow2Textures;} 00093 virtual bool ChooseNearestTexSize(void) const {return bChooseNearest;} 00094 00096 virtual const char *GetVertexShaderProfile(void) {return szVertProfile;} 00097 00099 virtual const char *GetPixelShaderProfile(void) {return szPixProfile;} 00100 00102 virtual BYTE GetMIDIControl(BYTE Channel, BYTE Which); 00103 00105 virtual DWORD GetMIDIClock(void); 00106 00108 virtual long ValidateFilename(char *pFilename, long BufLen); 00109 00111 virtual bool IsPowerOfTwo(DWORD Value); 00112 00114 virtual DWORD ChooseNearPowerOfTwo(DWORD Value); 00115 00117 virtual Texture CreateOffscreenBuffer(long XSize, long YSize, D3DFORMAT Format = D3DFMT_UNKNOWN, DWORD Usage = D3DUSAGE_DYNAMIC, D3DPOOL MemPool = D3DPOOL_DEFAULT); 00118 00120 virtual Surface CreateOffscreenSurface(long XSize, long YSize, D3DFORMAT Format = D3DFMT_UNKNOWN, D3DPOOL MemPool = D3DPOOL_SYSTEMMEM); 00121 00122 virtual void GetTargetDesc(D3DSURFACE_DESC &desc, bool bForce = false); 00123 00125 virtual char *ChooseSource(HWND hCallWnd, char *pName); 00126 00128 virtual MVSourcePlug *CreateSource(char *pName, bool bForcePow2 = false); 00129 00130 virtual VertexShader CompileVertexShader(CompileShaderInfo &Info); 00131 virtual PixelShader CompilePixelShader(CompileShaderInfo &Info); 00132 00133 virtual float * GetFreqTable(void); 00134 virtual int GetFreqTableSize(void); 00135 00136 virtual bool BassKick(void); 00137 virtual float BassKickValue(void); 00138 virtual float BassKickValue(int Index); 00139 virtual int GetNumberOfBassKickValues(void); 00140 00141 private: 00142 HWND hWnd; 00143 HINSTANCE hInst; 00144 00145 IDirect3DDevice9 *pDevice; 00146 IDirectSound8 *pDS; 00147 00148 Surface lpSurf; 00149 D3DSURFACE_DESC Desc; 00150 00151 BYTE MidiCont[16][128]; 00152 DWORD MidiClock; 00153 00154 bool bCPUIDPresent; 00155 bool bMMXPresent; 00156 bool bCMOVPresent; 00157 long dwCPUSpeed; 00158 long KBRAM; 00159 00160 bool bNonPow2Textures; 00161 bool bChooseNearest; 00162 00163 char szVertProfile[256]; 00164 char szPixProfile[256]; 00165 00166 friend class StartupHandler; 00167 friend class MidiPerformer; 00168 }; 00169 00170 #endif


MidiVid GPU Version 1.0
Copyright (c) 2005 Jason Dorie and VUTAG
Generated on: Sun Jan 25 23:45:41 2009