1 /* MESA private include file
2 * Copyright (c) 1998 Lionel ULMER
4 * This file contains all structures 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_MESA_PRIVATE_H
23 #define __GRAPHICS_WINE_MESA_PRIVATE_H
25 #include "d3d_private.h"
29 /*****************************************************************************
30 * IDirect3DLight MESA private structure
32 typedef struct mesa_d3dl_private
37 /*****************************************************************************
38 * IDirect3DTexture2 MESA private structure
40 typedef struct mesa_d3dt_private
45 /*****************************************************************************
46 * IDirect3DViewport2 implementation structure
48 typedef struct mesa_d3dv_private
53 /* Matrix copy WITH transposition */
54 #define conv_mat2(mat,gl_mat) \
56 TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
57 TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
58 TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
59 TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
60 (gl_mat)[ 0] = (mat)->_11; \
61 (gl_mat)[ 1] = (mat)->_21; \
62 (gl_mat)[ 2] = (mat)->_31; \
63 (gl_mat)[ 3] = (mat)->_41; \
64 (gl_mat)[ 4] = (mat)->_12; \
65 (gl_mat)[ 5] = (mat)->_22; \
66 (gl_mat)[ 6] = (mat)->_32; \
67 (gl_mat)[ 7] = (mat)->_42; \
68 (gl_mat)[ 8] = (mat)->_13; \
69 (gl_mat)[ 9] = (mat)->_23; \
70 (gl_mat)[10] = (mat)->_33; \
71 (gl_mat)[11] = (mat)->_43; \
72 (gl_mat)[12] = (mat)->_14; \
73 (gl_mat)[13] = (mat)->_24; \
74 (gl_mat)[14] = (mat)->_34; \
75 (gl_mat)[15] = (mat)->_44; \
78 /* Matrix copy WITHOUT transposition */
79 #define conv_mat(mat,gl_mat) \
81 TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
82 TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
83 TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
84 TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
85 memcpy(gl_mat, (mat), 16 * sizeof(float)); \
88 typedef struct render_state {
89 /* This is used for the device mode */
91 /* This is used for textures */
95 typedef struct mesa_d3dd_private {
98 /* The current render state */
101 /* The last type of vertex drawn */
104 D3DMATRIX *world_mat;
109 #define _dump_colorvalue(s,v) \
110 TRACE(" " s " : %f %f %f %f\n", \
111 (v).u1.r, (v).u2.g, (v).u3.b, (v).u4.a);
113 /* Common functions defined in d3dcommon.c */
114 void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
115 DWORD dwRenderState, RenderState *rs) ;
117 /* All non-static functions 'exported' by various sub-objects */
118 extern LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurfaceImpl* surf);
119 extern LPDIRECT3DTEXTURE d3dtexture_create(IDirectDrawSurfaceImpl* surf);
121 extern LPDIRECT3DLIGHT d3dlight_create_dx3(IDirect3DImpl* d3d1);
122 extern LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2);
124 extern LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc);
126 extern LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1);
127 extern LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2);
129 extern LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1);
130 extern LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2);
132 extern int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDeviceImpl** device);
133 extern int d3d_OpenGL_dx3(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
134 extern int d3d_OpenGL(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
135 extern int is_OpenGL(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevice2Impl** device, IDirect3D2Impl* d3d);
137 extern LPDIRECT3DTEXTURE2 mesa_d3dtexture2_create(IDirectDrawSurfaceImpl*);
138 extern LPDIRECT3DTEXTURE mesa_d3dtexture_create(IDirectDrawSurfaceImpl*);
140 static const GUID WINE_UNUSED IID_D3DDEVICE2_OpenGL = {
144 { 0x8b,0x7c,0x0e,0x4e,0xd8,0x3c,0x2b,0x3c }
147 static const GUID WINE_UNUSED IID_D3DDEVICE_OpenGL = {
151 { 0x82,0x2d,0xa8,0xd5,0x31,0x87,0xca,0xfa }
154 /* This structure contains all the function pointers to OpenGL extensions
155 that are used by Wine */
157 void (*ptr_ColorTableEXT) (GLenum target, GLenum internalformat,
158 GLsizei width, GLenum format, GLenum type, const GLvoid *table);
159 } Mesa_DeviceCapabilities;
161 extern ICOM_VTABLE(IDirect3D) mesa_d3dvt;
162 extern ICOM_VTABLE(IDirect3D2) mesa_d3d2vt;
163 extern ICOM_VTABLE(IDirect3D3) mesa_d3d3vt;
165 #endif /* __GRAPHICS_WINE_MESA_PRIVATE_H */