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 */
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.
49 ICOM_VFIELD_MULTI(IDirect3D7
);
50 ICOM_VFIELD_MULTI(IDirect3D3
);
51 ICOM_VFIELD_MULTI(IDirect3D2
);
52 ICOM_VFIELD_MULTI(IDirect3D
);
54 /* IDirect3D fields */
55 IDirectDrawImpl
* ddraw
;
58 /*****************************************************************************
59 * IDirect3DLight implementation structure
61 struct IDirect3DLightImpl
63 ICOM_VFIELD_MULTI(IDirect3DLight
);
65 /* IDirect3DLight fields */
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
);
88 /* IDirect3DMaterial2 fields */
90 IDirect3DDeviceImpl
*active_device
;
94 void (*activate
)(IDirect3DMaterialImpl
* this);
97 /*****************************************************************************
98 * IDirect3DTexture implementation structure
100 struct IDirect3DTextureImpl
102 ICOM_VFIELD_MULTI(IDirect3DTexture2
);
103 ICOM_VFIELD_MULTI(IDirect3DTexture
);
105 /* IDirect3DTexture fields */
107 IDirect3DDeviceImpl
*d3ddevice
;
108 IDirectDrawSurfaceImpl
*surface
;
112 /*****************************************************************************
113 * IDirect3DViewport implementation structure
115 struct IDirect3DViewportImpl
117 ICOM_VFIELD_MULTI(IDirect3DViewport3
);
119 /* IDirect3DViewport fields */
121 /* If this viewport is active for one device, put the device here */
122 IDirect3DDeviceImpl
*active_device
;
130 /* Activation function */
131 void (*activate
)(IDirect3DViewportImpl
*);
133 /* Field used to chain viewports together */
134 IDirect3DViewportImpl
*next
;
137 IDirect3DLightImpl
*lights
;
140 /*****************************************************************************
141 * IDirect3DExecuteBuffer implementation structure
143 struct IDirect3DExecuteBufferImpl
145 ICOM_VFIELD_MULTI(IDirect3DExecuteBuffer
);
147 /* IDirect3DExecuteBuffer fields */
149 IDirect3DDeviceImpl
* d3ddev
;
151 D3DEXECUTEBUFFERDESC desc
;
154 /* This buffer will store the transformed vertices */
156 D3DVERTEXTYPE vertex_type
;
158 /* This flags is set to TRUE if we allocated ourselves the
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
);
177 /* IDirect3DDevice fields */
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
);
197 D3DVERTEXBUFFERDESC desc
;
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 */