- actually use the VertexBuffer stubs
[wine.git] / dlls / ddraw / d3d_private.h
blob340c92515aceec03e4725be53d8380c86e64e00a
1 /* Direct3D private include file
2 * Copyright (c) 1998 Lionel ULMER
4 * This file contains all the structure that are not exported
5 * through d3d.h and all common macros.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __GRAPHICS_WINE_D3D_PRIVATE_H
23 #define __GRAPHICS_WINE_D3D_PRIVATE_H
25 /* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */
27 #include "d3d.h"
29 /*****************************************************************************
30 * Predeclare the interface implementation structures
32 typedef struct IDirect3DImpl IDirect3DImpl;
33 typedef struct IDirect3DLightImpl IDirect3DLightImpl;
34 typedef struct IDirect3DMaterialImpl IDirect3DMaterialImpl;
35 typedef struct IDirect3DTextureImpl IDirect3DTextureImpl;
36 typedef struct IDirect3DViewportImpl IDirect3DViewportImpl;
37 typedef struct IDirect3DExecuteBufferImpl IDirect3DExecuteBufferImpl;
38 typedef struct IDirect3DDeviceImpl IDirect3DDeviceImpl;
39 typedef struct IDirect3DVertexBufferImpl IDirect3DVertexBufferImpl;
41 #include "ddraw_private.h"
43 /*****************************************************************************
44 * IDirect3D implementation structure.
45 * This is common for interfaces 1, 2, 3 and 7.
47 struct IDirect3DImpl
49 ICOM_VFIELD_MULTI(IDirect3D7);
50 ICOM_VFIELD_MULTI(IDirect3D3);
51 ICOM_VFIELD_MULTI(IDirect3D2);
52 ICOM_VFIELD_MULTI(IDirect3D);
53 DWORD ref;
54 /* IDirect3D fields */
55 IDirectDrawImpl* ddraw;
58 /*****************************************************************************
59 * IDirect3DLight implementation structure
61 struct IDirect3DLightImpl
63 ICOM_VFIELD_MULTI(IDirect3DLight);
64 DWORD ref;
65 /* IDirect3DLight fields */
66 IDirect3DImpl *d3d;
68 D3DLIGHT2 light;
70 /* Chained list used for adding / removing from viewports */
71 IDirect3DLightImpl *next;
73 /* Activation function */
74 void (*activate)(IDirect3DLightImpl*);
75 void (*desactivate)(IDirect3DLightImpl*);
76 void (*update)(IDirect3DLightImpl*);
79 /*****************************************************************************
80 * IDirect3DMaterial implementation structure
82 struct IDirect3DMaterialImpl
84 ICOM_VFIELD_MULTI(IDirect3DMaterial3);
85 ICOM_VFIELD_MULTI(IDirect3DMaterial2);
86 ICOM_VFIELD_MULTI(IDirect3DMaterial);
87 DWORD ref;
88 /* IDirect3DMaterial2 fields */
89 IDirect3DImpl *d3d;
90 IDirect3DDeviceImpl *active_device;
92 D3DMATERIAL mat;
94 void (*activate)(IDirect3DMaterialImpl* this);
97 /*****************************************************************************
98 * IDirect3DTexture implementation structure
100 struct IDirect3DTextureImpl
102 ICOM_VFIELD_MULTI(IDirect3DTexture2);
103 ICOM_VFIELD_MULTI(IDirect3DTexture);
104 DWORD ref;
105 /* IDirect3DTexture fields */
106 IDirect3DImpl *d3d;
107 IDirect3DDeviceImpl *d3ddevice;
108 IDirectDrawSurfaceImpl *surface;
109 BOOL loaded;
112 /*****************************************************************************
113 * IDirect3DViewport implementation structure
115 struct IDirect3DViewportImpl
117 ICOM_VFIELD_MULTI(IDirect3DViewport3);
118 DWORD ref;
119 /* IDirect3DViewport fields */
120 IDirect3DImpl *d3d;
121 /* If this viewport is active for one device, put the device here */
122 IDirect3DDeviceImpl *active_device;
124 int use_vp2;
125 union {
126 D3DVIEWPORT vp1;
127 D3DVIEWPORT2 vp2;
128 } viewports;
130 /* Activation function */
131 void (*activate)(IDirect3DViewportImpl*);
133 /* Field used to chain viewports together */
134 IDirect3DViewportImpl *next;
136 /* Lights list */
137 IDirect3DLightImpl *lights;
140 /*****************************************************************************
141 * IDirect3DExecuteBuffer implementation structure
143 struct IDirect3DExecuteBufferImpl
145 ICOM_VFIELD_MULTI(IDirect3DExecuteBuffer);
146 DWORD ref;
147 /* IDirect3DExecuteBuffer fields */
148 IDirect3DImpl *d3d;
149 IDirect3DDeviceImpl* d3ddev;
151 D3DEXECUTEBUFFERDESC desc;
152 D3DEXECUTEDATA data;
154 /* This buffer will store the transformed vertices */
155 void* vertex_data;
156 D3DVERTEXTYPE vertex_type;
158 /* This flags is set to TRUE if we allocated ourselves the
159 data buffer */
160 BOOL need_free;
162 void (*execute)(IDirect3DExecuteBufferImpl* this,
163 IDirect3DDeviceImpl* dev,
164 IDirect3DViewportImpl* vp);
167 /*****************************************************************************
168 * IDirect3DDevice implementation structure
170 struct IDirect3DDeviceImpl
172 ICOM_VFIELD_MULTI(IDirect3DDevice7);
173 ICOM_VFIELD_MULTI(IDirect3DDevice3);
174 ICOM_VFIELD_MULTI(IDirect3DDevice2);
175 ICOM_VFIELD_MULTI(IDirect3DDevice);
176 DWORD ref;
177 /* IDirect3DDevice fields */
178 IDirect3DImpl *d3d;
179 IDirectDrawSurfaceImpl *surface;
181 IDirect3DViewportImpl *viewport_list;
182 IDirect3DViewportImpl *current_viewport;
183 IDirect3DTextureImpl *current_texture;
185 void (*set_context)(IDirect3DDeviceImpl*);
188 /*****************************************************************************
189 * IDirect3DVertexBuffer implementation structure
191 struct IDirect3DVertexBufferImpl
193 ICOM_VFIELD_MULTI(IDirect3DVertexBuffer7);
194 ICOM_VFIELD_MULTI(IDirect3DVertexBuffer);
195 DWORD ref;
196 IDirect3DImpl *d3d;
197 D3DVERTEXBUFFERDESC desc;
198 LPVOID *vertices;
199 DWORD vertex_buffer_size;
202 /* Various dump functions */
203 extern const char *_get_renderstate(D3DRENDERSTATETYPE type);
205 #define dump_mat(mat) \
206 TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
207 TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
208 TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
209 TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44);
211 #endif /* __GRAPHICS_WINE_D3D_PRIVATE_H */