Added support for nested exceptions happening inside a catch block.
[wine/multimedia.git] / dlls / ddraw / mesa_private.h
blob6632f8467e596f26a20b933e1198299845b69563
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"
27 #ifdef HAVE_OPENGL
29 #undef APIENTRY
30 #undef CALLBACK
31 #undef WINAPI
33 #define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
34 #include <GL/gl.h>
35 #include <GL/glx.h>
36 #ifdef HAVE_GL_GLEXT_H
37 # include <GL/glext.h>
38 #endif
39 #undef XMD_H
41 #undef APIENTRY
42 #undef CALLBACK
43 #undef WINAPI
45 /* Redefines the constants */
46 #define CALLBACK __stdcall
47 #define WINAPI __stdcall
48 #define APIENTRY WINAPI
50 /* X11 locking */
52 extern void (*wine_tsx11_lock_ptr)(void);
53 extern void (*wine_tsx11_unlock_ptr)(void);
55 /* As GLX relies on X, this is needed */
56 #define ENTER_GL() wine_tsx11_lock_ptr()
57 #define LEAVE_GL() wine_tsx11_unlock_ptr()
60 /*****************************************************************************
61 * IDirect3DLight MESA private structure
63 typedef struct mesa_d3dl_private
65 GLenum light_num;
66 } mesa_d3dl_private;
68 /*****************************************************************************
69 * IDirect3DTexture2 MESA private structure
71 typedef struct mesa_d3dt_private
73 GLuint tex_name;
74 } mesa_d3dt_private;
76 /*****************************************************************************
77 * IDirect3DViewport2 implementation structure
79 typedef struct mesa_d3dv_private
81 GLenum nextlight;
82 } mesa_d3dv_private;
84 /* Matrix copy WITH transposition */
85 #define conv_mat2(mat,gl_mat) \
86 { \
87 TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
88 TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
89 TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
90 TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
91 (gl_mat)[ 0] = (mat)->_11; \
92 (gl_mat)[ 1] = (mat)->_21; \
93 (gl_mat)[ 2] = (mat)->_31; \
94 (gl_mat)[ 3] = (mat)->_41; \
95 (gl_mat)[ 4] = (mat)->_12; \
96 (gl_mat)[ 5] = (mat)->_22; \
97 (gl_mat)[ 6] = (mat)->_32; \
98 (gl_mat)[ 7] = (mat)->_42; \
99 (gl_mat)[ 8] = (mat)->_13; \
100 (gl_mat)[ 9] = (mat)->_23; \
101 (gl_mat)[10] = (mat)->_33; \
102 (gl_mat)[11] = (mat)->_43; \
103 (gl_mat)[12] = (mat)->_14; \
104 (gl_mat)[13] = (mat)->_24; \
105 (gl_mat)[14] = (mat)->_34; \
106 (gl_mat)[15] = (mat)->_44; \
109 /* Matrix copy WITHOUT transposition */
110 #define conv_mat(mat,gl_mat) \
112 TRACE("%f %f %f %f\n", (mat)->_11, (mat)->_12, (mat)->_13, (mat)->_14); \
113 TRACE("%f %f %f %f\n", (mat)->_21, (mat)->_22, (mat)->_23, (mat)->_24); \
114 TRACE("%f %f %f %f\n", (mat)->_31, (mat)->_32, (mat)->_33, (mat)->_34); \
115 TRACE("%f %f %f %f\n", (mat)->_41, (mat)->_42, (mat)->_43, (mat)->_44); \
116 memcpy(gl_mat, (mat), 16 * sizeof(float)); \
119 typedef struct render_state {
120 /* This is used for the device mode */
121 GLenum src, dst;
122 /* This is used for textures */
123 GLenum mag, min;
124 } RenderState;
126 typedef struct mesa_d3dd_private {
127 GLXContext ctx;
129 /* The current render state */
130 RenderState rs;
132 /* The last type of vertex drawn */
133 D3DVERTEXTYPE vt;
135 D3DMATRIX *world_mat;
136 D3DMATRIX *view_mat;
137 D3DMATRIX *proj_mat;
139 Display *gdi_display;
140 Drawable drawable;
141 } mesa_d3dd_private;
143 #define _dump_colorvalue(s,v) \
144 TRACE(" " s " : %f %f %f %f\n", \
145 (v).u1.r, (v).u2.g, (v).u3.b, (v).u4.a);
147 /* Common functions defined in d3dcommon.c */
148 void set_render_state(D3DRENDERSTATETYPE dwRenderStateType,
149 DWORD dwRenderState, RenderState *rs) ;
151 /* All non-static functions 'exported' by various sub-objects */
152 extern LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurfaceImpl* surf);
153 extern LPDIRECT3DTEXTURE d3dtexture_create(IDirectDrawSurfaceImpl* surf);
155 extern LPDIRECT3DLIGHT d3dlight_create_dx3(IDirect3DImpl* d3d1);
156 extern LPDIRECT3DLIGHT d3dlight_create(IDirect3D2Impl* d3d2);
158 extern LPDIRECT3DEXECUTEBUFFER d3dexecutebuffer_create(IDirect3DDeviceImpl* d3ddev, LPD3DEXECUTEBUFFERDESC lpDesc);
160 extern LPDIRECT3DMATERIAL d3dmaterial_create(IDirect3DImpl* d3d1);
161 extern LPDIRECT3DMATERIAL2 d3dmaterial2_create(IDirect3D2Impl* d3d2);
163 extern LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1);
164 extern LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2);
166 extern int is_OpenGL_dx3(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDeviceImpl** device);
167 extern int d3d_OpenGL_dx3(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
168 extern int d3d_OpenGL(LPD3DENUMDEVICESCALLBACK cb, LPVOID context) ;
169 extern int is_OpenGL(REFCLSID rguid, IDirectDrawSurfaceImpl* surface, IDirect3DDevice2Impl** device, IDirect3D2Impl* d3d);
171 extern LPDIRECT3DTEXTURE2 mesa_d3dtexture2_create(IDirectDrawSurfaceImpl*);
172 extern LPDIRECT3DTEXTURE mesa_d3dtexture_create(IDirectDrawSurfaceImpl*);
174 static const GUID WINE_UNUSED IID_D3DDEVICE2_OpenGL = {
175 0x39a0da38,
176 0x7e57,
177 0x11d2,
178 { 0x8b,0x7c,0x0e,0x4e,0xd8,0x3c,0x2b,0x3c }
181 static const GUID WINE_UNUSED IID_D3DDEVICE_OpenGL = {
182 0x31416d44,
183 0x86ae,
184 0x11d2,
185 { 0x82,0x2d,0xa8,0xd5,0x31,0x87,0xca,0xfa }
188 /* This structure contains all the function pointers to OpenGL extensions
189 that are used by Wine */
190 typedef struct {
191 void (*ptr_ColorTableEXT) (GLenum target, GLenum internalformat,
192 GLsizei width, GLenum format, GLenum type, const GLvoid *table);
193 } Mesa_DeviceCapabilities;
195 extern ICOM_VTABLE(IDirect3D) mesa_d3dvt;
196 extern ICOM_VTABLE(IDirect3D2) mesa_d3d2vt;
197 extern ICOM_VTABLE(IDirect3D3) mesa_d3d3vt;
199 #endif /* HAVE_OPENGL */
201 #endif /* __GRAPHICS_WINE_MESA_PRIVATE_H */