1 /* MESA private include file
4 This file contains all structures that are not exported
5 through d3d.h and all common macros. */
7 #ifndef __GRAPHICS_WINE_MESA_PRIVATE_H
8 #define __GRAPHICS_WINE_MESA_PRIVATE_H
10 #include "d3d_private.h"
17 #include "x11_private.h"
19 /*****************************************************************************
20 * IDirect3DLight MESA private structure
22 typedef struct mesa_d3dl_private
27 /*****************************************************************************
28 * IDirect3DTexture2 MESA private structure
30 typedef struct mesa_d3dt_private
35 /*****************************************************************************
36 * IDirect3DViewport2 implementation structure
38 typedef struct mesa_d3dv_private
43 /* Matrix copy WITH transposition */
44 #define conv_mat2(mat,gl_mat) \
46 TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
47 TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
48 TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
49 TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
50 (gl_mat)[ 0] = (mat)->_11; \
51 (gl_mat)[ 1] = (mat)->_21; \
52 (gl_mat)[ 2] = (mat)->_31; \
53 (gl_mat)[ 3] = (mat)->_41; \
54 (gl_mat)[ 4] = (mat)->_12; \
55 (gl_mat)[ 5] = (mat)->_22; \
56 (gl_mat)[ 6] = (mat)->_32; \
57 (gl_mat)[ 7] = (mat)->_42; \
58 (gl_mat)[ 8] = (mat)->_13; \
59 (gl_mat)[ 9] = (mat)->_23; \
60 (gl_mat)[10] = (mat)->_33; \
61 (gl_mat)[11] = (mat)->_43; \
62 (gl_mat)[12] = (mat)->_14; \
63 (gl_mat)[13] = (mat)->_24; \
64 (gl_mat)[14] = (mat)->_34; \
65 (gl_mat)[15] = (mat)->_44; \
68 /* Matrix copy WITHOUT transposition */
69 #define conv_mat(mat,gl_mat) \
71 TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
72 TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
73 TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
74 TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
75 memcpy(gl_mat, (mat), 16 * sizeof(float)); \
78 typedef struct render_state
{
79 /* This is used for the device mode */
81 /* This is used for textures */
85 typedef struct mesa_d3dd_private
{
88 unsigned char *buffer
;
93 /* The current render state */
96 /* The last type of vertex drawn */
104 #define _dump_colorvalue(s,v) \
105 TRACE(" " s " : %f %f %f %f\n", \
106 (v).u1.r, (v).u2.g, (v).u3.b, (v).u4.a);
108 /* Common functions defined in d3dcommon.c */
109 void set_render_state(D3DRENDERSTATETYPE dwRenderStateType
,
110 DWORD dwRenderState
, RenderState
*rs
) ;
112 /* All non-static functions 'exported' by various sub-objects */
113 extern LPDIRECT3DTEXTURE2
d3dtexture2_create(IDirectDrawSurface4Impl
* surf
);
114 extern LPDIRECT3DTEXTURE
d3dtexture_create(IDirectDrawSurface4Impl
* surf
);
116 extern LPDIRECT3DLIGHT
d3dlight_create_dx3(IDirect3DImpl
* d3d1
);
117 extern LPDIRECT3DLIGHT
d3dlight_create(IDirect3D2Impl
* d3d2
);
119 extern LPDIRECT3DEXECUTEBUFFER
d3dexecutebuffer_create(IDirect3DDeviceImpl
* d3ddev
, LPD3DEXECUTEBUFFERDESC lpDesc
);
121 extern LPDIRECT3DMATERIAL
d3dmaterial_create(IDirect3DImpl
* d3d1
);
122 extern LPDIRECT3DMATERIAL2
d3dmaterial2_create(IDirect3D2Impl
* d3d2
);
124 extern LPDIRECT3DVIEWPORT
d3dviewport_create(IDirect3DImpl
* d3d1
);
125 extern LPDIRECT3DVIEWPORT2
d3dviewport2_create(IDirect3D2Impl
* d3d2
);
127 extern int is_OpenGL_dx3(REFCLSID rguid
, IDirectDrawSurfaceImpl
* surface
, IDirect3DDeviceImpl
** device
);
128 extern int d3d_OpenGL_dx3(LPD3DENUMDEVICESCALLBACK cb
, LPVOID context
) ;
129 extern int d3d_OpenGL(LPD3DENUMDEVICESCALLBACK cb
, LPVOID context
) ;
130 extern int is_OpenGL(REFCLSID rguid
, IDirectDrawSurfaceImpl
* surface
, IDirect3DDevice2Impl
** device
, IDirect3D2Impl
* d3d
);
132 extern LPDIRECT3DTEXTURE2
mesa_d3dtexture2_create(IDirectDrawSurface4Impl
*);
133 extern LPDIRECT3DTEXTURE
mesa_d3dtexture_create(IDirectDrawSurface4Impl
*);
135 static const GUID WINE_UNUSED IID_D3DDEVICE2_OpenGL
= {
139 { 0x8b,0x7c,0x0e,0x4e,0xd8,0x3c,0x2b,0x3c }
142 static const GUID WINE_UNUSED IID_D3DDEVICE_OpenGL
= {
146 { 0x82,0x2d,0xa8,0xd5,0x31,0x87,0xca,0xfa }
149 /* This structure contains all the function pointers to OpenGL extensions
150 that are used by Wine */
152 void (*ptr_ColorTableEXT
) (GLenum target
, GLenum internalformat
,
153 GLsizei width
, GLenum format
, GLenum type
, const GLvoid
*table
);
154 } Mesa_DeviceCapabilities
;
156 extern ICOM_VTABLE(IDirect3D
) mesa_d3dvt
;
157 extern ICOM_VTABLE(IDirect3D2
) mesa_d3d2vt
;
158 extern ICOM_VTABLE(IDirect3D3
) mesa_d3d3vt
;
160 #endif /* __GRAPHICS_WINE_MESA_PRIVATE_H */