- Sync with trunk r58248 to bring the latest changes from Amine (headers) and others...
[reactos.git] / dll / directx / wine / d3dx9_36 / d3dx9_36_private.h
1 /*
2 * Copyright (C) 2002 Raphael Junqueira
3 * Copyright (C) 2008 David Adam
4 * Copyright (C) 2008 Tony Wasserka
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 *
20 */
21
22 #ifndef __WINE_D3DX9_36_PRIVATE_H
23 #define __WINE_D3DX9_36_PRIVATE_H
24
25 #define WIN32_NO_STATUS
26 #define _INC_WINDOWS
27 #define COM_NO_WINDOWS_H
28
29 #include <stdarg.h>
30
31 #define COBJMACROS
32 #include <windef.h>
33 #include <winbase.h>
34 #include <wingdi.h>
35 #include <winnls.h>
36 #include <winuser.h>
37 #include <d3dx9.h>
38
39 /* for internal use */
40 typedef enum _FormatType {
41 FORMAT_ARGB, /* unsigned */
42 FORMAT_UNKNOWN
43 } FormatType;
44
45 typedef struct _PixelFormatDesc {
46 D3DFORMAT format;
47 BYTE bits[4];
48 BYTE shift[4];
49 UINT bytes_per_pixel;
50 FormatType type;
51 } PixelFormatDesc;
52
53 HRESULT map_view_of_file(LPCWSTR filename, LPVOID *buffer, DWORD *length);
54 HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer, DWORD *length);
55
56 const PixelFormatDesc *get_format_info(D3DFORMAT format);
57
58
59 extern const ID3DXBufferVtbl D3DXBuffer_Vtbl;
60
61 /* ID3DXBUFFER */
62 typedef struct ID3DXBufferImpl
63 {
64 /* IUnknown fields */
65 const ID3DXBufferVtbl *lpVtbl;
66 LONG ref;
67
68 /* ID3DXBuffer fields */
69 DWORD *buffer;
70 DWORD bufferSize;
71 } ID3DXBufferImpl;
72
73
74 /* ID3DXFont */
75 typedef struct ID3DXFontImpl
76 {
77 /* IUnknown fields */
78 const ID3DXFontVtbl *lpVtbl;
79 LONG ref;
80
81 /* ID3DXFont fields */
82 IDirect3DDevice9 *device;
83 D3DXFONT_DESCW desc;
84
85 HDC hdc;
86 HFONT hfont;
87 } ID3DXFontImpl;
88
89 /* ID3DXMatrixStack */
90 typedef struct ID3DXMatrixStackImpl
91 {
92 /* IUnknown fields */
93 const ID3DXMatrixStackVtbl *lpVtbl;
94 LONG ref;
95
96 /* ID3DXMatrixStack fields */
97 unsigned int current;
98 unsigned int stack_size;
99 D3DXMATRIX *stack;
100 } ID3DXMatrixStackImpl;
101
102 /*ID3DXSprite */
103 typedef struct _SPRITE {
104 LPDIRECT3DTEXTURE9 texture;
105 UINT texw, texh;
106 RECT rect;
107 D3DXVECTOR3 center;
108 D3DXVECTOR3 pos;
109 D3DCOLOR color;
110 } SPRITE;
111
112 typedef struct ID3DXSpriteImpl
113 {
114 /* IUnknown fields */
115 const ID3DXSpriteVtbl *lpVtbl;
116 LONG ref;
117
118 /* ID3DXSprite fields */
119 IDirect3DDevice9 *device;
120 IDirect3DVertexDeclaration9 *vdecl;
121 IDirect3DStateBlock9 *stateblock;
122 D3DXMATRIX transform;
123 D3DXMATRIX view;
124 DWORD flags;
125 BOOL ready;
126
127 /* Store the relevant caps to prevent multiple GetDeviceCaps calls */
128 DWORD texfilter_caps;
129 DWORD maxanisotropy;
130 DWORD alphacmp_caps;
131
132 SPRITE *sprites;
133 int sprite_count; /* number of sprites to be drawn */
134 int allocated_sprites; /* number of (pre-)allocated sprites */
135 } ID3DXSpriteImpl;
136
137
138 #endif /* __WINE_D3DX9_36_PRIVATE_H */