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__
29 #include "wine/list.h"
32 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
39 struct list destroy_callbacks
;
44 struct d3drm_object obj
;
45 IDirect3DRMTexture IDirect3DRMTexture_iface
;
46 IDirect3DRMTexture2 IDirect3DRMTexture2_iface
;
47 IDirect3DRMTexture3 IDirect3DRMTexture3_iface
;
54 IDirect3DRMFrame IDirect3DRMFrame_iface
;
55 IDirect3DRMFrame2 IDirect3DRMFrame2_iface
;
56 IDirect3DRMFrame3 IDirect3DRMFrame3_iface
;
59 struct d3drm_frame
*parent
;
61 ULONG children_capacity
;
62 IDirect3DRMFrame3
**children
;
64 ULONG visuals_capacity
;
65 IDirect3DRMVisual
**visuals
;
67 ULONG lights_capacity
;
68 IDirect3DRMLight
**lights
;
69 D3DRMMATRIX4D transform
;
70 D3DCOLOR scenebackground
;
75 struct d3drm_object obj
;
76 struct d3drm_device
*device
;
77 IDirect3DRMFrame
*camera
;
78 IDirect3DRMViewport IDirect3DRMViewport_iface
;
79 IDirect3DRMViewport2 IDirect3DRMViewport2_iface
;
80 IDirect3DViewport
*d3d_viewport
;
81 IDirect3DMaterial
*material
;
86 D3DRMPROJECTIONTYPE projection
;
91 struct d3drm_object obj
;
92 IDirect3DRMDevice IDirect3DRMDevice_iface
;
93 IDirect3DRMDevice2 IDirect3DRMDevice2_iface
;
94 IDirect3DRMDevice3 IDirect3DRMDevice3_iface
;
95 IDirect3DRMWinDevice IDirect3DRMWinDevice_iface
;
98 IDirectDrawSurface
*primary_surface
, *render_target
;
99 IDirectDrawClipper
*clipper
;
100 IDirect3DDevice
*device
;
102 D3DRMRENDERQUALITY quality
;
108 HRESULT
d3drm_device_create(struct d3drm_device
**device
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
109 HRESULT
d3drm_device_create_surfaces_from_clipper(struct d3drm_device
*object
, IDirectDraw
*ddraw
,
110 IDirectDrawClipper
*clipper
, int width
, int height
, IDirectDrawSurface
**surface
) DECLSPEC_HIDDEN
;
111 void d3drm_device_destroy(struct d3drm_device
*device
) DECLSPEC_HIDDEN
;
112 HRESULT
d3drm_device_init(struct d3drm_device
*device
, UINT version
, IDirectDraw
*ddraw
,
113 IDirectDrawSurface
*surface
, BOOL create_z_surface
) DECLSPEC_HIDDEN
;
115 void d3drm_object_init(struct d3drm_object
*object
) DECLSPEC_HIDDEN
;
116 HRESULT
d3drm_object_add_destroy_callback(struct d3drm_object
*object
, D3DRMOBJECTCALLBACK cb
, void *ctx
) DECLSPEC_HIDDEN
;
117 HRESULT
d3drm_object_delete_destroy_callback(struct d3drm_object
*object
, D3DRMOBJECTCALLBACK cb
, void *ctx
) DECLSPEC_HIDDEN
;
118 void d3drm_object_cleanup(IDirect3DRMObject
*iface
, struct d3drm_object
*object
) DECLSPEC_HIDDEN
;
120 struct d3drm_frame
*unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame
*iface
) DECLSPEC_HIDDEN
;
121 struct d3drm_device
*unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3
*iface
) DECLSPEC_HIDDEN
;
123 HRESULT
d3drm_texture_create(struct d3drm_texture
**texture
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
124 HRESULT
d3drm_frame_create(struct d3drm_frame
**frame
, IUnknown
*parent_frame
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
125 HRESULT
d3drm_viewport_create(struct d3drm_viewport
**viewport
, IDirect3DRM
*d3drm
) DECLSPEC_HIDDEN
;
126 HRESULT
Direct3DRMFace_create(REFIID riid
, IUnknown
** ret_iface
) DECLSPEC_HIDDEN
;
127 HRESULT
Direct3DRMLight_create(IUnknown
** ppObj
) DECLSPEC_HIDDEN
;
128 HRESULT
Direct3DRMMesh_create(IDirect3DRMMesh
** obj
) DECLSPEC_HIDDEN
;
129 HRESULT
Direct3DRMMeshBuilder_create(REFIID riid
, IUnknown
** ppObj
) DECLSPEC_HIDDEN
;
130 HRESULT
Direct3DRMMaterial_create(IDirect3DRMMaterial2
** ret_iface
) DECLSPEC_HIDDEN
;
132 HRESULT
load_mesh_data(IDirect3DRMMeshBuilder3
*iface
, IDirectXFileData
*data
,
133 D3DRMLOADTEXTURECALLBACK load_texture_proc
, void *arg
) DECLSPEC_HIDDEN
;
135 struct d3drm_file_header
142 extern char templates
[] DECLSPEC_HIDDEN
;
144 static inline BYTE
d3drm_color_component(float c
)
150 return floor(c
* 255.0f
);
153 static inline void d3drm_set_color(D3DCOLOR
*color
, float r
, float g
, float b
, float a
)
155 *color
= RGBA_MAKE(d3drm_color_component(r
), d3drm_color_component(g
),
156 d3drm_color_component(b
), d3drm_color_component(a
));
159 #endif /* __D3DRM_PRIVATE_INCLUDED__ */