diff -up d3dx9-orig/d3dx9core.h d3dx9/include/d3dx9core.h --- d3dx9-orig/d3dx9core.h 2010-01-31 23:01:46.000000000 +0100 +++ d3dx9/include/d3dx9core.h 2010-01-31 21:45:55.000000000 +0100 @@ -120,8 +120,8 @@ typedef struct _D3DXFONT_DESCW WCHAR FaceName[LF_FACESIZE]; } D3DXFONT_DESCW, *LPD3DXFONT_DESCW; -DECL_WINELIB_TYPE_AW(D3DXFONT_DESC) -DECL_WINELIB_TYPE_AW(LPD3DXFONT_DESC) +/*DECL_WINELIB_TYPE_AW(D3DXFONT_DESC) +DECL_WINELIB_TYPE_AW(LPD3DXFONT_DESC)*/ #define INTERFACE ID3DXFont DECLARE_INTERFACE_(ID3DXFont, IUnknown) diff -up d3dx9-orig/d3dx9math.inl d3dx9/include/d3dx9math.inl --- d3dx9-orig/d3dx9math.inl 2010-01-31 23:01:47.000000000 +0100 +++ d3dx9/include/d3dx9math.inl 2010-01-31 21:44:36.000000000 +0100 @@ -23,6 +23,9 @@ /* constructors & operators */ #ifdef __cplusplus +template T max(T a, T b) { return a > b ? a : b; } +template T min(T a, T b) { return a < b ? a : b; } + inline D3DXVECTOR2::D3DXVECTOR2() { } diff -up d3dx9-orig/d3dx9shader.h d3dx9/include/d3dx9shader.h --- d3dx9-orig/d3dx9shader.h 2010-01-31 23:01:48.000000000 +0100 +++ d3dx9/include/d3dx9shader.h 2010-01-31 23:26:50.000000000 +0100 @@ -92,6 +92,15 @@ typedef enum _D3DXINCLUDE_TYPE D3DXINC_FORCE_DWORD = 0x7fffffff, } D3DXINCLUDE_TYPE, *LPD3DXINCLUDE_TYPE; +typedef enum D3DXREGISTER_SET +{ + D3DXRS_BOOL, + D3DXRS_INT4, + D3DXRS_FLOAT4, + D3DXRS_SAMPLER, + D3DXPS_FORCE_DWORD = 0x7fffffff, +} D3DXREGISTER_SET, *LPD3DXREGISTER_SET; + #undef INTERFACE #define INTERFACE ID3DXInclude @@ -106,6 +115,49 @@ DECLARE_INTERFACE(ID3DXInclude) typedef struct ID3DXInclude *LPD3DXINCLUDE; +#undef INTERFACE +#define INTERFACE ID3DXConstantTable + +typedef struct _D3DXCONSTANTTABLE_DESC +{ + LPCSTR Creator; + DWORD Version; + UINT Constants; +} D3DXCONSTANTTABLE_DESC, *LPD3DXCONSTANTTABLE_DESC; + +typedef struct _D3DXCONSTANT_DESC +{ + LPCSTR Name; + D3DXREGISTER_SET RegisterSet; + UINT RegisterIndex; + UINT RegisterCount; + D3DXPARAMETER_CLASS Class; + D3DXPARAMETER_TYPE Type; + UINT Rows; + UINT Columns; + UINT Elements; + UINT StructMembers; + UINT Bytes; + LPCVOID DefaultValue; +} D3DXCONSTANT_DESC, *LPD3DXCONSTANT_DESC; + +DECLARE_INTERFACE(ID3DXConstantTable) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; + STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; + STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; + STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE; + STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; +}; + +typedef struct ID3DXConstantTable *LPD3DXCONSTANTTABLE; + #ifdef __cplusplus extern "C" { #endif @@ -153,6 +205,17 @@ HRESULT WINAPI D3DXAssembleShader(LPCSTR LPD3DXBUFFER* shader, LPD3DXBUFFER* error_messages); +HRESULT WINAPI D3DXCompileShader(LPCSTR pSrcData, + UINT srcDataLen, + CONST D3DXMACRO* pDefines, + LPD3DXINCLUDE pInclude, + LPCSTR pFunctionName, + LPCSTR pProfile, + DWORD Flags, + LPD3DXBUFFER* ppShader, + LPD3DXBUFFER* ppErrorMsgs, + LPD3DXCONSTANTTABLE* ppConstantTable); + #ifdef __cplusplus } #endif