ReactOS 0.4.16-dev-297-gc569aee
d3drm_private.h
Go to the documentation of this file.
1/*
2 * Direct3DRM private interfaces (D3DRM.DLL)
3 *
4 * Copyright 2010 Christian Costa
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#ifndef __D3DRM_PRIVATE_INCLUDED__
22#define __D3DRM_PRIVATE_INCLUDED__
23
24#define NONAMELESSUNION
25#define NONAMELESSSTRUCT
26#define COBJMACROS
27#include <assert.h>
28#include <math.h>
29#include "dxfile.h"
30#include "d3drmwin.h"
31#include "rmxfguid.h"
32#include "wine/debug.h"
33#include "wine/heap.h"
34#include "wine/list.h"
35
37{
38 float _11, _12, _13, _14;
39 float _21, _22, _23, _24;
40 float _31, _32, _33, _34;
41 float _41, _42, _43, _44;
42};
43
45{
46 return (struct d3drm_matrix *)m;
47}
48
50{
54 const char *classname;
55 char *name;
56};
57
59{
61 IDirect3DRMTexture IDirect3DRMTexture_iface;
62 IDirect3DRMTexture2 IDirect3DRMTexture2_iface;
63 IDirect3DRMTexture3 IDirect3DRMTexture3_iface;
64 IDirect3DRM *d3drm;
66 IDirectDrawSurface *surface;
67};
68
70{
72 IDirect3DRMFrame IDirect3DRMFrame_iface;
73 IDirect3DRMFrame2 IDirect3DRMFrame2_iface;
74 IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
75 IDirect3DRM *d3drm;
80 IDirect3DRMFrame3 **children;
83 IDirect3DRMVisual **visuals;
86 IDirect3DRMLight **lights;
90};
91
93{
94 float left;
95 float top;
96 float right;
97 float bottom;
98 float front;
99 float back;
100};
101
103{
106 IDirect3DRMFrame *camera;
107 IDirect3DRMViewport IDirect3DRMViewport_iface;
108 IDirect3DRMViewport2 IDirect3DRMViewport2_iface;
109 IDirect3DViewport *d3d_viewport;
110 IDirect3DMaterial *material;
111 IDirect3DRM *d3drm;
114};
115
117{
119 IDirect3DRMDevice IDirect3DRMDevice_iface;
120 IDirect3DRMDevice2 IDirect3DRMDevice2_iface;
121 IDirect3DRMDevice3 IDirect3DRMDevice3_iface;
122 IDirect3DRMWinDevice IDirect3DRMWinDevice_iface;
123 IDirect3DRM *d3drm;
124 IDirectDraw *ddraw;
125 IDirectDrawSurface *primary_surface, *render_target;
126 IDirectDrawClipper *clipper;
127 IDirect3DDevice *device;
133};
134
136{
138 IDirect3DRMFace IDirect3DRMFace_iface;
139 IDirect3DRMFace2 IDirect3DRMFace2_iface;
142};
143
145{
147 IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface;
148 IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface;
150 IDirect3DRM *d3drm;
163 IDirect3DRMMaterial2 *material;
164 IDirect3DRMTexture3 *texture;
168};
169
171{
172 unsigned nb_vertices;
174 unsigned nb_faces;
177 unsigned* face_data;
179 IDirect3DRMMaterial2* material;
180 IDirect3DRMTexture3* texture;
181};
182
184{
186 IDirect3DRMMesh IDirect3DRMMesh_iface;
188 IDirect3DRM *d3drm;
192};
193
195{
197 IDirect3DRMLight IDirect3DRMLight_iface;
199 IDirect3DRM *d3drm;
208};
209
211{
215};
216
218{
220 IDirect3DRMMaterial2 IDirect3DRMMaterial2_iface;
222 IDirect3DRM *d3drm;
227};
228
230{
232 union
233 {
237 } u;
238};
239
241{
245};
246
248{
250 IDirect3DRMAnimation2 IDirect3DRMAnimation2_iface;
251 IDirect3DRMAnimation IDirect3DRMAnimation_iface;
253 IDirect3DRM *d3drm;
254 IDirect3DRMFrame3 *frame;
259};
260
262{
264 IDirect3DRMWrap IDirect3DRMWrap_iface;
266};
267
270 IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface) DECLSPEC_HIDDEN;
273 IDirectDrawSurface *surface, BOOL create_z_surface) DECLSPEC_HIDDEN;
274
275void d3drm_object_init(struct d3drm_object *object, const char *classname) DECLSPEC_HIDDEN;
281void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object) DECLSPEC_HIDDEN;
282
283struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface) DECLSPEC_HIDDEN;
284struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface) DECLSPEC_HIDDEN;
285
286struct d3drm_device *unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface) DECLSPEC_HIDDEN;
287
289HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
291HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
294HRESULT d3drm_material_create(struct d3drm_material **material, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
296HRESULT d3drm_animation_create(struct d3drm_animation **animation, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
298
299HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data,
300 D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN;
301
303{
307};
308
309extern char templates[] DECLSPEC_HIDDEN;
310
311static inline BYTE d3drm_color_component(float c)
312{
313 if (c <= 0.0f)
314 return 0u;
315 if (c >= 1.0f)
316 return 0xffu;
317 return floor(c * 255.0f);
318}
319
320static inline void d3drm_set_color(D3DCOLOR *color, float r, float g, float b, float a)
321{
324}
325
326BOOL d3drm_array_reserve(void **elements, SIZE_T *capacity, SIZE_T element_count, SIZE_T element_size) DECLSPEC_HIDDEN;
327
328#endif /* __D3DRM_PRIVATE_INCLUDED__ */
Definition: list.h:37
HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: frame.c:3129
HRESULT d3drm_material_create(struct d3drm_material **material, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: material.c:279
static void d3drm_set_color(D3DCOLOR *color, float r, float g, float b, float a)
char templates[] DECLSPEC_HIDDEN
HRESULT d3drm_viewport_create(struct d3drm_viewport **viewport, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: viewport.c:1123
HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data, D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN
Definition: meshbuilder.c:1019
HRESULT d3drm_object_get_class_name(struct d3drm_object *object, DWORD *size, char *name) DECLSPEC_HIDDEN
Definition: d3drm_main.c:92
HRESULT d3drm_face_create(struct d3drm_face **face) DECLSPEC_HIDDEN
Definition: face.c:620
void d3drm_object_init(struct d3drm_object *object, const char *classname) DECLSPEC_HIDDEN
Definition: d3drm_main.c:39
HRESULT d3drm_light_create(struct d3drm_light **light, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: light.c:371
HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN
Definition: d3drm_main.c:72
struct d3drm_frame * unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface) DECLSPEC_HIDDEN
Definition: frame.c:3120
HRESULT d3drm_object_set_name(struct d3drm_object *object, const char *name) DECLSPEC_HIDDEN
Definition: d3drm_main.c:135
HRESULT d3drm_device_create(struct d3drm_device **device, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: device.c:1634
HRESULT d3drm_device_init(struct d3drm_device *device, UINT version, IDirectDraw *ddraw, IDirectDrawSurface *surface, BOOL create_z_surface) DECLSPEC_HIDDEN
Definition: device.c:120
void d3drm_device_destroy(struct d3drm_device *device) DECLSPEC_HIDDEN
Definition: device.c:40
HRESULT d3drm_mesh_builder_create(struct d3drm_mesh_builder **mesh_builder, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: meshbuilder.c:2334
struct d3drm_device * unsafe_impl_from_IDirect3DRMDevice3(IDirect3DRMDevice3 *iface) DECLSPEC_HIDDEN
Definition: device.c:1625
HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: texture.c:1412
static BYTE d3drm_color_component(float c)
HRESULT d3drm_wrap_create(struct d3drm_wrap **wrap, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: meshbuilder.c:3019
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object) DECLSPEC_HIDDEN
Definition: d3drm_main.c:153
HRESULT d3drm_animation_create(struct d3drm_animation **animation, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: frame.c:3881
struct d3drm_frame * unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface) DECLSPEC_HIDDEN
Definition: frame.c:3111
HRESULT d3drm_mesh_create(struct d3drm_mesh **mesh, IDirect3DRM *d3drm) DECLSPEC_HIDDEN
Definition: meshbuilder.c:2833
HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx) DECLSPEC_HIDDEN
Definition: d3drm_main.c:55
HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw, IDirectDrawClipper *clipper, int width, int height, IDirectDrawSurface **surface) DECLSPEC_HIDDEN
Definition: device.c:69
HRESULT d3drm_object_get_name(struct d3drm_object *object, DWORD *size, char *name) DECLSPEC_HIDDEN
Definition: d3drm_main.c:111
BOOL d3drm_array_reserve(void **elements, SIZE_T *capacity, SIZE_T element_count, SIZE_T element_size) DECLSPEC_HIDDEN
Definition: meshbuilder.c:260
DWORD D3DRMANIMATIONOPTIONS
Definition: d3drmdef.h:322
D3DVALUE D3DRMMATRIX4D[4][4]
Definition: d3drmdef.h:39
enum _D3DRMLIGHTTYPE D3DRMLIGHTTYPE
DWORD D3DRMRENDERQUALITY
Definition: d3drmdef.h:89
enum _D3DRMPROJECTIONTYPE D3DRMPROJECTIONTYPE
void(__cdecl * D3DRMOBJECTCALLBACK)(struct IDirect3DRMObject *obj, void *arg)
Definition: d3drmobj.h:157
HRESULT(__cdecl * D3DRMLOADTEXTURECALLBACK)(char *tex_name, void *arg, struct IDirect3DRMTexture **texture)
Definition: d3drmobj.h:165
float D3DVALUE
Definition: d3dtypes.h:89
static const WCHAR version[]
Definition: asmname.c:66
#define wrap(journal, var)
Definition: recovery.c:207
#define RGBA_MAKE
Definition: dx7todx8.h:6
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLuint GLenum GLenum transform
Definition: glext.h:9407
GLenum GLuint texture
Definition: glext.h:6295
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
GLuint color
Definition: glext.h:6243
const GLubyte * c
Definition: glext.h:8905
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
char templates[]
Definition: meshbuilder.c:39
IDirect3DRMMeshBuilder * mesh_builder
Definition: d3drm.c:3330
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
WCHAR classname[128]
Definition: startup.c:15
D3DVALUE r
D3DVALUE g
D3DVALUE b
union d3drm_animation_key::@242 u
D3DRMQUATERNION rotate
struct d3drm_animation_key * keys
struct d3drm_animation_keys rotate
D3DRMANIMATIONOPTIONS options
IDirect3DRMAnimation IDirect3DRMAnimation_iface
IDirect3DRMAnimation2 IDirect3DRMAnimation2_iface
IDirect3DRM * d3drm
struct d3drm_animation_keys position
IDirect3DRMFrame3 * frame
float left
Definition: d3drm_private.h:94
float right
Definition: d3drm_private.h:96
float bottom
Definition: d3drm_private.h:97
float front
Definition: d3drm_private.h:98
float back
Definition: d3drm_private.h:99
IDirect3DRMDevice IDirect3DRMDevice_iface
D3DRMRENDERQUALITY quality
IDirectDraw * ddraw
IDirectDrawSurface * render_target
IDirect3DRMWinDevice IDirect3DRMWinDevice_iface
IDirectDrawClipper * clipper
IDirect3DRMDevice2 IDirect3DRMDevice2_iface
IDirect3DRMDevice3 IDirect3DRMDevice3_iface
IDirectDrawSurface * primary_surface
IDirect3DRM * d3drm
IDirect3DDevice * device
IDirect3DRMFace IDirect3DRMFace_iface
IDirect3DRMFace2 IDirect3DRMFace2_iface
D3DCOLOR color
IDirect3DRM * d3drm
Definition: d3drm_private.h:75
IDirect3DRMFrame3 IDirect3DRMFrame3_iface
Definition: d3drm_private.h:74
SIZE_T visuals_size
Definition: d3drm_private.h:82
IDirect3DRMFrame3 ** children
Definition: d3drm_private.h:80
IDirect3DRMFrame IDirect3DRMFrame_iface
Definition: d3drm_private.h:72
SIZE_T lights_size
Definition: d3drm_private.h:85
D3DCOLOR scenebackground
Definition: d3drm_private.h:88
struct d3drm_frame * parent
Definition: d3drm_private.h:77
IDirect3DRMLight ** lights
Definition: d3drm_private.h:86
IDirect3DRMFrame2 IDirect3DRMFrame2_iface
Definition: d3drm_private.h:73
DWORD traversal_options
Definition: d3drm_private.h:89
IDirect3DRMVisual ** visuals
Definition: d3drm_private.h:83
SIZE_T children_size
Definition: d3drm_private.h:79
SIZE_T nb_visuals
Definition: d3drm_private.h:81
SIZE_T nb_lights
Definition: d3drm_private.h:84
SIZE_T nb_children
Definition: d3drm_private.h:78
IDirect3DRM * d3drm
D3DVALUE qattenuation
D3DVALUE lattenuation
IDirect3DRMLight IDirect3DRMLight_iface
D3DRMLIGHTTYPE type
D3DVALUE penumbra
D3DVALUE range
D3DVALUE umbra
D3DVALUE cattenuation
D3DCOLOR color
struct color_rgb specular
struct color_rgb emissive
struct color_rgb ambient
IDirect3DRM * d3drm
IDirect3DRMMaterial2 IDirect3DRMMaterial2_iface
IDirect3DRM * d3drm
D3DVECTOR * vertices
D3DVECTOR * normals
IDirect3DRMTexture3 * texture
struct mesh_material * materials
IDirect3DRMMeshBuilder3 IDirect3DRMMeshBuilder3_iface
IDirect3DRMMeshBuilder2 IDirect3DRMMeshBuilder2_iface
IDirect3DRMMaterial2 * material
struct coords_2d * pCoords2d
SIZE_T groups_size
IDirect3DRM * d3drm
struct mesh_group * groups
IDirect3DRMMesh IDirect3DRMMesh_iface
SIZE_T nb_groups
struct list destroy_callbacks
Definition: d3drm_private.h:53
const char * classname
Definition: d3drm_private.h:54
IDirect3DRM * d3drm
Definition: d3drm_private.h:64
IDirectDrawSurface * surface
Definition: d3drm_private.h:66
IDirect3DRMTexture3 IDirect3DRMTexture3_iface
Definition: d3drm_private.h:63
D3DRMIMAGE * image
Definition: d3drm_private.h:65
IDirect3DRMTexture2 IDirect3DRMTexture2_iface
Definition: d3drm_private.h:62
IDirect3DRMTexture IDirect3DRMTexture_iface
Definition: d3drm_private.h:61
struct d3drm_box clip
IDirect3DRMViewport IDirect3DRMViewport_iface
struct d3drm_device * device
IDirect3DRMViewport2 IDirect3DRMViewport2_iface
IDirect3DRMFrame * camera
IDirect3DViewport * d3d_viewport
IDirect3DMaterial * material
IDirect3DRM * d3drm
D3DRMPROJECTIONTYPE projection
IDirect3DRMWrap IDirect3DRMWrap_iface
Definition: d3drm.c:189
Definition: devices.h:37
unsigned nb_vertices
unsigned vertex_per_face
D3DCOLOR color
unsigned nb_faces
IDirect3DRMMaterial2 * material
IDirect3DRMTexture3 * texture
D3DRMVERTEX * vertices
unsigned * face_data
DWORD face_data_size
Definition: mesh.c:198
Definition: name.c:39
ULONG_PTR SIZE_T
Definition: typedefs.h:80
unsigned char BYTE
Definition: xxhash.c:193