d3dx8core.h 4.8 KB
Newer Older
Raphael Junqueira's avatar
Raphael Junqueira committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (C) 2002 Raphael Junqueira
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Raphael Junqueira's avatar
Raphael Junqueira committed
17 18 19 20 21
 */

#ifndef __WINE_D3DX8CORE_H
#define __WINE_D3DX8CORE_H

22
#include <d3d8.h>
Raphael Junqueira's avatar
Raphael Junqueira committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

/*****************************************************************************
 * #defines and error codes
 */
#define D3DXASM_DEBUG           1
#define D3DXASM_SKIPVALIDATION  2

#define _FACD3D  0x876
#define MAKE_D3DXHRESULT( code )  MAKE_HRESULT( 1, _FACD3D, code )

/*
 * Direct3D Errors
 */
#define D3DXERR_CANNOTATTRSORT                  MAKE_D3DXHRESULT(2158)
#define D3DXERR_CANNOTMODIFYINDEXBUFFER         MAKE_D3DXHRESULT(2159)
#define D3DXERR_INVALIDMESH                     MAKE_D3DXHRESULT(2160)
#define D3DXERR_SKINNINGNOTSUPPORTED            MAKE_D3DXHRESULT(2161)
#define D3DXERR_TOOMANYINFLUENCES               MAKE_D3DXHRESULT(2162)
#define D3DXERR_INVALIDDATA                     MAKE_D3DXHRESULT(2163)

/*****************************************************************************
 * Predeclare the interfaces
 */
DEFINE_GUID(IID_ID3DXBuffer,             0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x12);/* FIXME */
47
typedef struct ID3DXBuffer *LPD3DXBUFFER;
Raphael Junqueira's avatar
Raphael Junqueira committed
48
DEFINE_GUID(IID_ID3DXFont,               0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x13);/* FIXME */
49
typedef struct ID3DXFont *LPD3DXFONT;
Raphael Junqueira's avatar
Raphael Junqueira committed
50 51 52 53

/*****************************************************************************
 * ID3DXBuffer interface
 */
54
#define INTERFACE ID3DXBuffer
55 56 57 58 59 60 61 62
DECLARE_INTERFACE_(ID3DXBuffer,IUnknown)
{
    /*** IUnknown methods ***/
    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    STDMETHOD_(ULONG,Release)(THIS) PURE;
    /*** ID3DXBuffer methods ***/
    STDMETHOD_(LPVOID,GetBufferPointer)(THIS) PURE;
63
    STDMETHOD_(DWORD,GetBufferSize)(THIS) PURE;
64
};
65
#undef INTERFACE
Raphael Junqueira's avatar
Raphael Junqueira committed
66

67
#if !defined(__cplusplus) || defined(CINTERFACE)
Raphael Junqueira's avatar
Raphael Junqueira committed
68
/*** IUnknown methods ***/
69 70 71
#define ID3DXBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ID3DXBuffer_AddRef(p)             (p)->lpVtbl->AddRef(p)
#define ID3DXBuffer_Release(p)            (p)->lpVtbl->Release(p)
Raphael Junqueira's avatar
Raphael Junqueira committed
72
/*** ID3DXBuffer methods ***/
73 74 75
#define ID3DXBuffer_GetBufferPointer(p)   (p)->lpVtbl->GetBufferPointer(p)
#define ID3DXBuffer_GetBufferSize(p)      (p)->lpVtbl->GetBufferSize(p)
#endif
Raphael Junqueira's avatar
Raphael Junqueira committed
76 77 78 79

/*****************************************************************************
 * ID3DXFont interface
 */
80
#define INTERFACE ID3DXFont
81 82 83 84 85 86 87 88 89
DECLARE_INTERFACE_(ID3DXFont,IUnknown)
{
    /*** IUnknown methods ***/
    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
    STDMETHOD_(ULONG,Release)(THIS) PURE;
    /*** ID3DXFont methods ***/
    STDMETHOD(Begin)(THIS) PURE;
    STDMETHOD(DrawTextA)(THIS) PURE;
90
    STDMETHOD(End)(THIS) PURE;
91
};
92
#undef INTERFACE
Raphael Junqueira's avatar
Raphael Junqueira committed
93

94
#if !defined(__cplusplus) || defined(CINTERFACE)
Raphael Junqueira's avatar
Raphael Junqueira committed
95
/*** IUnknown methods ***/
96 97 98
#define ID3DXFont_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ID3DXFont_AddRef(p)             (p)->lpVtbl->AddRef(p)
#define ID3DXFont_Release(p)            (p)->lpVtbl->Release(p)
Raphael Junqueira's avatar
Raphael Junqueira committed
99
/*** ID3DXFont methods ***/
100 101 102 103
#define ID3DXFont_Begin(p)              (p)->lpVtbl->Begin(p)
#define ID3DXFont_DrawTextA(p,a,b,c,d,e)(p)->lpVtbl->DrawText(p,a,b,c,d,e)
#define ID3DXFont_End(p)                (p)->lpVtbl->End(p)
#endif
Raphael Junqueira's avatar
Raphael Junqueira committed
104 105 106 107

/*************************************************************************************
 * Define entrypoints 
 */
108 109 110 111
#ifdef __cplusplus
extern "C" {
#endif

112 113
HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont);
HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, 
Raphael Junqueira's avatar
Raphael Junqueira committed
114 115 116
			   LPD3DXBUFFER* ppConstants, 
			   LPD3DXBUFFER* ppCompiledShader,
			   LPD3DXBUFFER* ppCompilationErrors);
117
HRESULT WINAPI D3DXAssembleShaderFromFileA(LPCSTR pSrcFile, DWORD Flags,
Raphael Junqueira's avatar
Raphael Junqueira committed
118 119 120
				    LPD3DXBUFFER* ppConstants,
				    LPD3DXBUFFER* ppCompiledShader,
				    LPD3DXBUFFER* ppCompilationErrors);
121
HRESULT WINAPI D3DXAssembleShaderFromFileW(LPCWSTR pSrcFile, DWORD Flags,
Raphael Junqueira's avatar
Raphael Junqueira committed
122 123 124 125
				    LPD3DXBUFFER* ppConstants,
				    LPD3DXBUFFER* ppCompiledShader,
				    LPD3DXBUFFER* ppCompilationErrors);

126 127 128 129
#ifdef __cplusplus
}
#endif

Raphael Junqueira's avatar
Raphael Junqueira committed
130
#endif /* __WINE_D3DX8CORE_H */