PixelShaderCompiler.h

00001 /* 
00002  *      Copyright (C) 2003-2005 Gabest
00003  *      http://www.gabest.org
00004  *
00005  *  This Program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2, or (at your option)
00008  *  any later version.
00009  *   
00010  *  This Program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  *  GNU General Public License for more details.
00014  *   
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with GNU Make; see the file COPYING.  If not, write to
00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
00018  *  http://www.gnu.org/copyleft/gpl.html
00019  *
00020  */
00021 
00022 #pragma once
00023 
00024 #include <d3dx9shader.h>
00025 
00026 class CPixelShaderCompiler
00027 {
00028         typedef HRESULT (WINAPI * D3DXCompileShaderPtr) (
00029         LPCSTR                          pSrcData,
00030         UINT                            SrcDataLen,
00031         CONST D3DXMACRO*                pDefines,
00032         LPD3DXINCLUDE                   pInclude,
00033         LPCSTR                          pFunctionName,
00034         LPCSTR                          pProfile,
00035         DWORD                           Flags,
00036         LPD3DXBUFFER*                   ppShader,
00037         LPD3DXBUFFER*                   ppErrorMsgs,
00038         LPD3DXCONSTANTTABLE*            ppConstantTable);
00039 
00040         typedef HRESULT (WINAPI * D3DXDisassembleShaderPtr) (
00041         CONST DWORD*                    pShader, 
00042         BOOL                            EnableColorCode, 
00043         LPCSTR                          pComments, 
00044         LPD3DXBUFFER*                   ppDisassembly);
00045 
00046         HMODULE m_hDll;
00047         D3DXCompileShaderPtr m_pD3DXCompileShader;
00048         D3DXDisassembleShaderPtr m_pD3DXDisassembleShader;
00049 
00050         CComPtr<IDirect3DDevice9> m_pD3DDev;
00051 
00052 public:
00053         CPixelShaderCompiler(IDirect3DDevice9* pD3DDev, bool fStaySilent = false);
00054         virtual ~CPixelShaderCompiler();
00055 
00056         HRESULT CompileShader(
00057         LPCSTR pSrcData,
00058         LPCSTR pFunctionName,
00059         LPCSTR pProfile,
00060         DWORD Flags,
00061         IDirect3DPixelShader9** ppPixelShader,
00062                 CString* disasm = NULL,
00063                 CString* errmsg = NULL);
00064 };

Generated on Tue Dec 13 14:46:57 2005 for guliverkli by  doxygen 1.4.5