Move the Check* type functions into wined3d and copy from d3d9, and
[wine] / dlls / wined3d / wined3d_private.h
1 /*
2  * Direct3D wine internal private include file
3  *
4  * Copyright 2002-2003 The wine-d3d team
5  * Copyright 2002-2003 Raphael Junqueira
6  * Copyright 2004      Jason Edmeades   
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __WINE_WINED3D_PRIVATE_H
24 #define __WINE_WINED3D_PRIVATE_H
25
26 #include <stdarg.h>
27 #define NONAMELESSUNION
28 #define NONAMELESSSTRUCT
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winreg.h"
32 #include "wingdi.h"
33 #include "winuser.h"
34 #include "wine/debug.h"
35
36 #include "d3d9.h"
37 #include "d3d9types.h"
38 #include "wine/wined3d_interface.h"
39 #include "wine/wined3d_gl.h"
40
41 extern int vs_mode;
42 #define VS_NONE 0
43 #define VS_HW   1
44 #define VS_SW   2
45
46 extern int ps_mode;
47 #define PS_NONE 0
48 #define PS_HW   1
49
50 /* X11 locking */
51
52 extern void (*wine_tsx11_lock_ptr)(void);
53 extern void (*wine_tsx11_unlock_ptr)(void);
54
55 /* As GLX relies on X, this is needed */
56 extern int num_lock;
57
58 #if 0
59 #define ENTER_GL() ++num_lock; if (num_lock > 1) FIXME("Recursive use of GL lock to: %d\n", num_lock); wine_tsx11_lock_ptr()
60 #define LEAVE_GL() if (num_lock != 1) FIXME("Recursive use of GL lock: %d\n", num_lock); --num_lock; wine_tsx11_unlock_ptr()
61 #else
62 #define ENTER_GL() wine_tsx11_lock_ptr()
63 #define LEAVE_GL() wine_tsx11_unlock_ptr()
64 #endif
65
66 /*****************************************************************************
67  * Defines
68  */
69 #define GL_SUPPORT(ExtName)           (This->gl_info.supported[ExtName] != 0)
70
71 /*****************************************************************************
72  * IWineD3D implementation structure
73  */
74 typedef struct IWineD3DImpl
75 {
76     /* IUnknown fields */
77     IWineD3DVtbl           *lpVtbl;
78     DWORD                   ref;     /* Note: Ref counting not required */
79
80     /* WineD3D Information */
81     UINT                    dxVersion;
82
83     /* GL Information */
84     BOOL                    isGLInfoValid;
85     WineD3D_GL_Info         gl_info;
86 } IWineD3DImpl;
87
88 extern IWineD3DVtbl IWineD3D_Vtbl;
89
90 /* Utility function prototypes */
91 const char* debug_d3dformat(D3DFORMAT fmt);
92 const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
93 const char* debug_d3dresourcetype(D3DRESOURCETYPE res);
94 const char* debug_d3dusage(DWORD usage);
95
96
97
98 #if 0 /* Needs fixing during rework */
99 /*****************************************************************************
100  * IDirect3DVertexShaderDeclaration implementation structure
101  */
102 struct IDirect3DVertexShaderDeclarationImpl {
103   /* The device */
104   /*IDirect3DDeviceImpl* device;*/
105
106   /** precomputed fvf if simple declaration */
107   DWORD   fvf[MAX_STREAMS];
108   DWORD   allFVF;
109
110   /** dx8 compatible Declaration fields */
111   DWORD*  pDeclaration8;
112   DWORD   declaration8Length;
113 };
114
115
116 /*****************************************************************************
117  * IDirect3DVertexShader implementation structure
118  */
119 struct IDirect3DVertexShaderImpl {
120   /* The device */
121   /*IDirect3DDeviceImpl* device;*/
122
123   DWORD* function;
124   UINT functionLength;
125   DWORD usage;
126   DWORD version;
127   /* run time datas */
128   VSHADERDATA* data;
129   VSHADERINPUTDATA input;
130   VSHADEROUTPUTDATA output;
131 };
132
133
134 /*****************************************************************************
135  * IDirect3DPixelShader implementation structure
136  */
137 struct IDirect3DPixelShaderImpl { 
138   /* The device */
139   /*IDirect3DDeviceImpl* device;*/
140
141   DWORD* function;
142   UINT functionLength;
143   DWORD version;
144   /* run time datas */
145   PSHADERDATA* data;
146   PSHADERINPUTDATA input;
147   PSHADEROUTPUTDATA output;
148 };
149
150 #endif /* Needs fixing during rework */
151 #endif