2 * Direct3DRM private interfaces (D3DRM.DLL)
4 * Copyright 2010 Christian Costa
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.
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.
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
21 #ifndef __D3DRM_PRIVATE_INCLUDED__
22 #define __D3DRM_PRIVATE_INCLUDED__
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
32 #include "wine/debug.h"
33 #include "wine/list.h"
37 float _11
, _12
, _13
, _14
;
38 float _21
, _22
, _23
, _24
;
39 float _31
, _32
, _33
, _34
;
40 float _41
, _42
, _43
, _44
;
43 static inline struct d3drm_matrix
*d3drm_matrix(D3DRMMATRIX4D m
)
45 return (struct d3drm_matrix
*)m
;
52 struct list destroy_callbacks
;
53 const char *classname
;
59 struct d3drm_object obj
;
60 IDirect3DRMTexture IDirect3DRMTexture_iface
;
61 IDirect3DRMTexture2 IDirect3DRMTexture2_iface
;
62 IDirect3DRMTexture3 IDirect3DRMTexture3_iface
;
65 IDirectDrawSurface
*surface
;
72 D3DVALUE decal_height
;
77 struct d3drm_object obj
;
78 IDirect3DRMFrame IDirect3DRMFrame_iface
;
79 IDirect3DRMFrame2 IDirect3DRMFrame2_iface
;
80 IDirect3DRMFrame3 IDirect3DRMFrame3_iface
;
83 struct d3drm_frame
*parent
;
86 IDirect3DRMFrame3
**children
;
89 IDirect3DRMVisual
**visuals
;
92 IDirect3DRMLight
**lights
;
93 struct d3drm_matrix transform
;
94 D3DCOLOR scenebackground
;
95 DWORD traversal_options
;
108 struct d3drm_viewport
110 struct d3drm_object obj
;
111 struct d3drm_device
*device
;
112 IDirect3DRMFrame
*camera
;
113 IDirect3DRMViewport IDirect3DRMViewport_iface
;
114 IDirect3DRMViewport2 IDirect3DRMViewport2_iface
;
115 IDirect3DViewport
*d3d_viewport
;
116 IDirect3DMaterial
*material
;
118 struct d3drm_box clip
;
119 D3DRMPROJECTIONTYPE projection
;
124 struct d3drm_object obj
;
125 IDirect3DRMDevice IDirect3DRMDevice_iface
;
126 IDirect3DRMDevice2 IDirect3DRMDevice2_iface
;
127 IDirect3DRMDevice3 IDirect3DRMDevice3_iface
;
128 IDirect3DRMWinDevice IDirect3DRMWinDevice_iface
;
131 IDirectDrawSurface
*primary_surface
, *render_target
;
132 IDirectDrawClipper
*clipper
;
133 IDirect3DDevice
*device
;
135 D3DRMRENDERQUALITY quality
;
143 struct d3drm_object obj
;
144 IDirect3DRMFace IDirect3DRMFace_iface
;
145 IDirect3DRMFace2 IDirect3DRMFace2_iface
;
150 struct d3drm_mesh_builder
152 struct d3drm_object obj
;
153 IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface
;
154 IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface
;
158 SIZE_T vertices_size
;
164 DWORD face_data_size
;
167 struct coords_2d
*pCoords2d
;
169 IDirect3DRMMaterial2
*material
;
170 IDirect3DRMTexture3
*texture
;
172 struct mesh_material
*materials
;
173 DWORD
*material_indices
;
174 D3DRMRENDERQUALITY quality
;
179 unsigned nb_vertices
;
180 D3DRMVERTEX
* vertices
;
182 unsigned vertex_per_face
;
183 DWORD face_data_size
;
186 IDirect3DRMMaterial2
* material
;
187 IDirect3DRMTexture3
* texture
;
192 struct d3drm_object obj
;
193 IDirect3DRMMesh IDirect3DRMMesh_iface
;
198 struct mesh_group
*groups
;
203 struct d3drm_object obj
;
204 IDirect3DRMLight IDirect3DRMLight_iface
;
210 D3DVALUE cattenuation
;
211 D3DVALUE lattenuation
;
212 D3DVALUE qattenuation
;
224 struct d3drm_material
226 struct d3drm_object obj
;
227 IDirect3DRMMaterial2 IDirect3DRMMaterial2_iface
;
230 struct color_rgb emissive
;
231 struct color_rgb specular
;
233 struct color_rgb ambient
;
236 struct d3drm_animation_key
243 D3DRMQUATERNION rotate
;
247 struct d3drm_animation_keys
249 struct d3drm_animation_key
*keys
;
254 struct d3drm_animation
256 struct d3drm_object obj
;
257 IDirect3DRMAnimation2 IDirect3DRMAnimation2_iface
;
258 IDirect3DRMAnimation IDirect3DRMAnimation_iface
;
261 IDirect3DRMFrame3
*frame
;
262 D3DRMANIMATIONOPTIONS options
;
263 struct d3drm_animation_keys position
;
264 struct d3drm_animation_keys scale
;
265 struct d3drm_animation_keys rotate
;
270 struct d3drm_object obj
;
271 IDirect3DRMWrap IDirect3DRMWrap_iface
;
275 HRESULT
d3drm_device_create(struct d3drm_device
**device
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
276 HRESULT
d3drm_device_create_surfaces_from_clipper(struct d3drm_device
*object
, IDirectDraw
*ddraw
,
277 IDirectDrawClipper
*clipper
, int width
, int height
, IDirectDrawSurface
**surface
) DECLSPEC_HIDDEN
;
278 void d3drm_device_destroy(struct d3drm_device
*device
) DECLSPEC_HIDDEN
;
279 HRESULT
d3drm_device_init(struct d3drm_device
*device
, UINT version
, IDirectDraw
*ddraw
,
280 IDirectDrawSurface
*surface
, BOOL create_z_surface
) DECLSPEC_HIDDEN
;
282 void d3drm_object_init(struct d3drm_object
*object
, const char *classname
) DECLSPEC_HIDDEN
;
283 HRESULT
d3drm_object_add_destroy_callback(struct d3drm_object
*object
, D3DRMOBJECTCALLBACK cb
, void *ctx
) DECLSPEC_HIDDEN
;
284 HRESULT
d3drm_object_delete_destroy_callback(struct d3drm_object
*object
, D3DRMOBJECTCALLBACK cb
, void *ctx
) DECLSPEC_HIDDEN
;
285 HRESULT
d3drm_object_get_class_name(struct d3drm_object
*object
, DWORD
*size
, char *name
) DECLSPEC_HIDDEN
;
286 HRESULT
d3drm_object_get_name(struct d3drm_object
*object
, DWORD
*size
, char *name
) DECLSPEC_HIDDEN
;
287 HRESULT
d3drm_object_set_name(struct d3drm_object
*object
, const char *name
) DECLSPEC_HIDDEN
;
288 void d3drm_object_cleanup(IDirect3DRMObject
*iface
, struct d3drm_object
*object
) DECLSPEC_HIDDEN
;
290 struct d3drm_frame
*unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame
*iface
) DECLSPEC_HIDDEN
;
291 struct d3drm_frame
*unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3
*iface
) DECLSPEC_HIDDEN
;
293 struct d3drm_device
*unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3
*iface
) DECLSPEC_HIDDEN
;
295 HRESULT
d3drm_texture_create(struct d3drm_texture
**texture
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
296 HRESULT
d3drm_frame_create(struct d3drm_frame
**frame
, IUnknown
*parent_frame
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
297 HRESULT
d3drm_face_create(struct d3drm_face
**face
) DECLSPEC_HIDDEN
;
298 HRESULT
d3drm_viewport_create(struct d3drm_viewport
**viewport
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
299 HRESULT
d3drm_mesh_builder_create(struct d3drm_mesh_builder
**mesh_builder
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
300 HRESULT
d3drm_light_create(struct d3drm_light
**light
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
301 HRESULT
d3drm_material_create(struct d3drm_material
**material
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
302 HRESULT
d3drm_mesh_create(struct d3drm_mesh
**mesh
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
303 HRESULT
d3drm_animation_create(struct d3drm_animation
**animation
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
304 HRESULT
d3drm_wrap_create(struct d3drm_wrap
**wrap
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
306 HRESULT
load_mesh_data(IDirect3DRMMeshBuilder3
*iface
, IDirectXFileData
*data
,
307 D3DRMLOADTEXTURECALLBACK load_texture_proc
, void *arg
) DECLSPEC_HIDDEN
;
309 struct d3drm_file_header
316 extern char templates
[] DECLSPEC_HIDDEN
;
318 static inline BYTE
d3drm_color_component(float c
)
324 return floor(c
* 255.0f
);
327 static inline void d3drm_set_color(D3DCOLOR
*color
, float r
, float g
, float b
, float a
)
329 *color
= RGBA_MAKE(d3drm_color_component(r
), d3drm_color_component(g
),
330 d3drm_color_component(b
), d3drm_color_component(a
));
333 BOOL
d3drm_array_reserve(void **elements
, SIZE_T
*capacity
, SIZE_T element_count
, SIZE_T element_size
) DECLSPEC_HIDDEN
;
335 #endif /* __D3DRM_PRIVATE_INCLUDED__ */