blob: d57e3e96c5a8a54317c103fd6a30ca1001f004ab [file] [log] [blame]
Raphael Junqueirae31ae922002-12-17 01:15:15 +00001/*
2 * Copyright (C) 2002 Raphael Junqueira
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __WINE_D3DX8CORE_H
20#define __WINE_D3DX8CORE_H
21
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +000022#include <objbase.h>
Raphael Junqueirae31ae922002-12-17 01:15:15 +000023
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +000024#include <d3d8.h>
25#include <d3d8types.h>
26#include <d3d8caps.h>
Raphael Junqueirae31ae922002-12-17 01:15:15 +000027
28/*****************************************************************************
29 * #defines and error codes
30 */
31#define D3DXASM_DEBUG 1
32#define D3DXASM_SKIPVALIDATION 2
33
34#define _FACD3D 0x876
35#define MAKE_D3DXHRESULT( code ) MAKE_HRESULT( 1, _FACD3D, code )
36
37/*
38 * Direct3D Errors
39 */
40#define D3DXERR_CANNOTATTRSORT MAKE_D3DXHRESULT(2158)
41#define D3DXERR_CANNOTMODIFYINDEXBUFFER MAKE_D3DXHRESULT(2159)
42#define D3DXERR_INVALIDMESH MAKE_D3DXHRESULT(2160)
43#define D3DXERR_SKINNINGNOTSUPPORTED MAKE_D3DXHRESULT(2161)
44#define D3DXERR_TOOMANYINFLUENCES MAKE_D3DXHRESULT(2162)
45#define D3DXERR_INVALIDDATA MAKE_D3DXHRESULT(2163)
46
47/*****************************************************************************
48 * Predeclare the interfaces
49 */
50DEFINE_GUID(IID_ID3DXBuffer, 0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x12);/* FIXME */
Alexandre Julliardb8d30752005-07-26 18:32:53 +000051typedef struct ID3DXBuffer *LPD3DXBUFFER;
Raphael Junqueirae31ae922002-12-17 01:15:15 +000052DEFINE_GUID(IID_ID3DXFont, 0x1,0x1,0x4,0xB0,0xCF,0x98,0xFE,0xFD,0xFF,0x95,0x13);/* FIXME */
Alexandre Julliardb8d30752005-07-26 18:32:53 +000053typedef struct ID3DXFont *LPD3DXFONT;
Raphael Junqueirae31ae922002-12-17 01:15:15 +000054
55/*****************************************************************************
56 * ID3DXBuffer interface
57 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000058#define INTERFACE ID3DXBuffer
Alexandre Julliard5d0160e2004-10-05 04:38:15 +000059DECLARE_INTERFACE_(ID3DXBuffer,IUnknown)
60{
61 /*** IUnknown methods ***/
62 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
63 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
64 STDMETHOD_(ULONG,Release)(THIS) PURE;
65 /*** ID3DXBuffer methods ***/
66 STDMETHOD_(LPVOID,GetBufferPointer)(THIS) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000067 STDMETHOD_(DWORD,GetBufferSize)(THIS) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +000068};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000069#undef INTERFACE
Raphael Junqueirae31ae922002-12-17 01:15:15 +000070
Francois Gouget52ecbf72004-10-04 19:35:40 +000071#if !defined(__cplusplus) || defined(CINTERFACE)
Raphael Junqueirae31ae922002-12-17 01:15:15 +000072/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +000073#define ID3DXBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
74#define ID3DXBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
75#define ID3DXBuffer_Release(p) (p)->lpVtbl->Release(p)
Raphael Junqueirae31ae922002-12-17 01:15:15 +000076/*** ID3DXBuffer methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +000077#define ID3DXBuffer_GetBufferPointer(p) (p)->lpVtbl->GetBufferPointer(p)
78#define ID3DXBuffer_GetBufferSize(p) (p)->lpVtbl->GetBufferSize(p)
79#endif
Raphael Junqueirae31ae922002-12-17 01:15:15 +000080
81/*****************************************************************************
82 * ID3DXFont interface
83 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000084#define INTERFACE ID3DXFont
Alexandre Julliard5d0160e2004-10-05 04:38:15 +000085DECLARE_INTERFACE_(ID3DXFont,IUnknown)
86{
87 /*** IUnknown methods ***/
88 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
89 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
90 STDMETHOD_(ULONG,Release)(THIS) PURE;
91 /*** ID3DXFont methods ***/
92 STDMETHOD(Begin)(THIS) PURE;
93 STDMETHOD(DrawTextA)(THIS) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000094 STDMETHOD(End)(THIS) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +000095};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +000096#undef INTERFACE
Raphael Junqueirae31ae922002-12-17 01:15:15 +000097
Francois Gouget52ecbf72004-10-04 19:35:40 +000098#if !defined(__cplusplus) || defined(CINTERFACE)
Raphael Junqueirae31ae922002-12-17 01:15:15 +000099/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000100#define ID3DXFont_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
101#define ID3DXFont_AddRef(p) (p)->lpVtbl->AddRef(p)
102#define ID3DXFont_Release(p) (p)->lpVtbl->Release(p)
Raphael Junqueirae31ae922002-12-17 01:15:15 +0000103/*** ID3DXFont methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +0000104#define ID3DXFont_Begin(p) (p)->lpVtbl->Begin(p)
105#define ID3DXFont_DrawTextA(p,a,b,c,d,e)(p)->lpVtbl->DrawText(p,a,b,c,d,e)
106#define ID3DXFont_End(p) (p)->lpVtbl->End(p)
107#endif
Raphael Junqueirae31ae922002-12-17 01:15:15 +0000108
109/*************************************************************************************
110 * Define entrypoints
111 */
Patrik Stridvall46304a72003-01-02 19:28:09 +0000112HRESULT WINAPI D3DXCreateBuffer(DWORD NumBytes, LPD3DXBUFFER* ppBuffer);
113HRESULT WINAPI D3DXCreateFont(LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT* ppFont);
114UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF);
115HRESULT WINAPI D3DXAssembleShader(LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags,
Raphael Junqueirae31ae922002-12-17 01:15:15 +0000116 LPD3DXBUFFER* ppConstants,
117 LPD3DXBUFFER* ppCompiledShader,
118 LPD3DXBUFFER* ppCompilationErrors);
Patrik Stridvall46304a72003-01-02 19:28:09 +0000119HRESULT WINAPI D3DXAssembleShaderFromFileA(LPSTR pSrcFile, DWORD Flags,
Raphael Junqueirae31ae922002-12-17 01:15:15 +0000120 LPD3DXBUFFER* ppConstants,
121 LPD3DXBUFFER* ppCompiledShader,
122 LPD3DXBUFFER* ppCompilationErrors);
Patrik Stridvall46304a72003-01-02 19:28:09 +0000123HRESULT WINAPI D3DXAssembleShaderFromFileW(LPSTR pSrcFile, DWORD Flags,
Raphael Junqueirae31ae922002-12-17 01:15:15 +0000124 LPD3DXBUFFER* ppConstants,
125 LPD3DXBUFFER* ppCompiledShader,
126 LPD3DXBUFFER* ppCompilationErrors);
127
128#endif /* __WINE_D3DX8CORE_H */