Make the fixed function pipeline support multiple streams for created
[wine/dcerpc.git] / dlls / d3d8 / d3dcore_gl.h
blob042b750dd28c7d417ca5df3f06f671e065458d3e
1 /*
2 * Direct3D gl definitions
4 * Copyright 2003 Raphael Junqueira
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_D3DCORE_GL_H
22 #define __WINE_D3DCORE_GL_H
24 #ifndef __WINE_CONFIG_H
25 # error You must include config.h to use this header
26 #endif
28 #define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
29 #include <GL/gl.h>
30 #include <GL/glx.h>
31 #ifdef HAVE_GL_GLEXT_H
32 # include <GL/glext.h>
33 #endif
34 #undef XMD_H
37 /*******
38 * OpenGL Extensions (EXT and ARB)
39 * defines and functions pointer
42 /* GL_EXT_secondary_color */
43 #ifndef GL_EXT_secondary_color
44 #define GL_EXT_secondary_color 1
45 #define GL_COLOR_SUM_EXT 0x8458
46 #define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
47 #define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
48 #define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
49 #define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
50 #define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
51 #define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
52 #endif
53 typedef void (APIENTRY * PGLFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
54 typedef void (APIENTRY * PGLFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
55 typedef void (APIENTRY * PGLFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
56 typedef void (APIENTRY * PGLFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
57 /* GL_EXT_paletted_texture */
58 #ifndef GL_EXT_paletted_texture
59 #define GL_EXT_paletted_texture 1
60 #define GL_COLOR_INDEX1_EXT 0x80E2
61 #define GL_COLOR_INDEX2_EXT 0x80E3
62 #define GL_COLOR_INDEX4_EXT 0x80E4
63 #define GL_COLOR_INDEX8_EXT 0x80E5
64 #define GL_COLOR_INDEX12_EXT 0x80E6
65 #define GL_COLOR_INDEX16_EXT 0x80E7
66 #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
67 #endif
68 typedef void (APIENTRY * PGLFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
69 /* GL_EXT_point_parameters */
70 #ifndef GL_EXT_point_parameters
71 #define GL_EXT_point_parameters 1
72 #define GL_POINT_SIZE_MIN_EXT 0x8126
73 #define GL_POINT_SIZE_MAX_EXT 0x8127
74 #define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
75 #define GL_DISTANCE_ATTENUATION_EXT 0x8129
76 #endif
77 typedef void (APIENTRY * PGLFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
78 typedef void (APIENTRY * PGLFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params);
79 #ifndef GL_EXT_texture_env_combine
80 #define GL_EXT_texture_env_combine 1
81 #define GL_COMBINE_EXT 0x8570
82 #define GL_COMBINE_RGB_EXT 0x8571
83 #define GL_COMBINE_ALPHA_EXT 0x8572
84 #define GL_RGB_SCALE_EXT 0x8573
85 #define GL_ADD_SIGNED_EXT 0x8574
86 #define GL_INTERPOLATE_EXT 0x8575
87 #define GL_SUBTRACT_EXT 0x84E7
88 #define GL_CONSTANT_EXT 0x8576
89 #define GL_PRIMARY_COLOR_EXT 0x8577
90 #define GL_PREVIOUS_EXT 0x8578
91 #define GL_SOURCE0_RGB_EXT 0x8580
92 #define GL_SOURCE1_RGB_EXT 0x8581
93 #define GL_SOURCE2_RGB_EXT 0x8582
94 #define GL_SOURCE3_RGB_EXT 0x8583
95 #define GL_SOURCE4_RGB_EXT 0x8584
96 #define GL_SOURCE5_RGB_EXT 0x8585
97 #define GL_SOURCE6_RGB_EXT 0x8586
98 #define GL_SOURCE7_RGB_EXT 0x8587
99 #define GL_SOURCE0_ALPHA_EXT 0x8588
100 #define GL_SOURCE1_ALPHA_EXT 0x8589
101 #define GL_SOURCE2_ALPHA_EXT 0x858A
102 #define GL_SOURCE3_ALPHA_EXT 0x858B
103 #define GL_SOURCE4_ALPHA_EXT 0x858C
104 #define GL_SOURCE5_ALPHA_EXT 0x858D
105 #define GL_SOURCE6_ALPHA_EXT 0x858E
106 #define GL_SOURCE7_ALPHA_EXT 0x858F
107 #define GL_OPERAND0_RGB_EXT 0x8590
108 #define GL_OPERAND1_RGB_EXT 0x8591
109 #define GL_OPERAND2_RGB_EXT 0x8592
110 #define GL_OPERAND3_RGB_EXT 0x8593
111 #define GL_OPERAND4_RGB_EXT 0x8594
112 #define GL_OPERAND5_RGB_EXT 0x8595
113 #define GL_OPERAND6_RGB_EXT 0x8596
114 #define GL_OPERAND7_RGB_EXT 0x8597
115 #define GL_OPERAND0_ALPHA_EXT 0x8598
116 #define GL_OPERAND1_ALPHA_EXT 0x8599
117 #define GL_OPERAND2_ALPHA_EXT 0x859A
118 #define GL_OPERAND3_ALPHA_EXT 0x859B
119 #define GL_OPERAND4_ALPHA_EXT 0x859C
120 #define GL_OPERAND5_ALPHA_EXT 0x859D
121 #define GL_OPERAND6_ALPHA_EXT 0x859E
122 #define GL_OPERAND7_ALPHA_EXT 0x859F
123 #endif
124 /* GL_EXT_texture_env_dot3 */
125 #ifndef GL_EXT_texture_env_dot3
126 #define GL_EXT_texture_env_dot3 1
127 #define GL_DOT3_RGB_EXT 0x8740
128 #define GL_DOT3_RGBA_EXT 0x8741
129 #endif
132 /*******
133 * OpenGL Official Version
134 * defines
137 /* GL_VERSION_1_3 */
138 #if !defined(GL_DOT3_RGBA)
139 # define GL_DOT3_RGBA 0x8741
140 #endif
141 #if !defined(GL_SUBTRACT)
142 # define GL_SUBTRACT 0x84E7
143 #endif
146 /*******
147 * OpenGL GLX Extensions
148 * defines and functions pointer
153 /*******
154 * OpenGL GLX Official Version
155 * defines and functions pointer
158 /* GLX_VERSION_1_3 */
159 typedef GLXFBConfig * (APIENTRY * PGLXFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
160 typedef GLXFBConfig * (APIENTRY * PGLXFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
161 typedef int (APIENTRY * PGLXFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
162 typedef XVisualInfo * (APIENTRY * PGLXFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
163 typedef GLXWindow (APIENTRY * PGLXFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
164 typedef void (APIENTRY * PGLXFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
165 typedef GLXPixmap (APIENTRY * PGLXFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
166 typedef void (APIENTRY * PGLXFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
167 typedef GLXPbuffer (APIENTRY * PGLXFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
168 typedef void (APIENTRY * PGLXFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
169 typedef void (APIENTRY * PGLXFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
170 typedef GLXContext (APIENTRY * PGLXFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
171 typedef Bool (APIENTRY * PGLXFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
172 typedef GLXDrawable (APIENTRY * PGLXFNGLXGETCURRENTREADDRAWABLEPROC) (void);
173 typedef Display * (APIENTRY * PGLXFNGLXGETCURRENTDISPLAYPROC) (void);
174 typedef int (APIENTRY * PGLXFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
175 typedef void (APIENTRY * PGLXFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
176 typedef void (APIENTRY * PGLXFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
179 /*******
180 * OpenGL Supported Extensions (ARB and EXT)
183 typedef enum _GL_SupportedExt {
184 /* ARB */
185 ARB_FRAGMENT_PROGRAM,
186 ARB_MULTISAMPLE,
187 ARB_MULTITEXTURE,
188 ARB_POINT_PARAMETERS,
189 ARB_TEXTURE_COMPRESSION,
190 ARB_TEXTURE_CUBE_MAP,
191 ARB_TEXTURE_ENV_COMBINE,
192 ARB_TEXTURE_ENV_DOT3,
193 ARB_VERTEX_PROGRAM,
194 ARB_VERTEX_BLEND,
195 /* EXT */
196 EXT_FOG_COORD,
197 EXT_PALETTED_TEXTURE,
198 EXT_POINT_PARAMETERS,
199 EXT_SECONDARY_COLOR,
200 EXT_TEXTURE_COMPRESSION_S3TC,
201 EXT_TEXTURE_FILTER_ANISOTROPIC,
202 EXT_TEXTURE_LOD,
203 EXT_TEXTURE_LOD_BIAS,
204 EXT_VERTEX_WEIGHTING,
205 /* NVIDIA */
206 NV_FRAGMENT_PROGRAM,
207 NV_VERTEX_PROGRAM,
208 /* ATI */
209 EXT_VERTEX_SHADER,
211 OPENGL_SUPPORTED_EXT_END
212 } GL_SupportedExt;
214 typedef enum _GL_VSVersion {
215 VS_VERSION_NOT_SUPPORTED = 0x0,
216 VS_VERSION_10 = 0x10,
217 VS_VERSION_11 = 0x11,
218 VS_VERSION_20 = 0x20,
219 VS_VERSION_30 = 0x30,
220 /*Force 32-bits*/
221 VS_VERSION_FORCE_DWORD = 0x7FFFFFFF
222 } GL_VSVersion;
224 typedef enum _GL_PSVersion {
225 PS_VERSION_NOT_SUPPORTED = 0x0,
226 PS_VERSION_10 = 0x10,
227 PS_VERSION_11 = 0x11,
228 PS_VERSION_12 = 0x12,
229 PS_VERSION_13 = 0x13,
230 PS_VERSION_14 = 0x14,
231 PS_VERSION_20 = 0x20,
232 PS_VERSION_30 = 0x30,
233 /*Force 32-bits*/
234 PS_VERSION_FORCE_DWORD = 0x7FFFFFFF
235 } GL_PSVersion;
238 #define GL_EXT_FUNCS_GEN \
239 /** EXT Extensions **/ \
240 /* GL_EXT_fog_coord */ \
241 /* GL_EXT_paletted_texture */ \
242 USE_GL_FUNC(PGLFNGLCOLORTABLEEXTPROC, glColorTableEXT); \
243 /* GL_EXT_point_parameters */ \
244 USE_GL_FUNC(PGLFNGLPOINTPARAMETERFEXTPROC, glPointParameterfEXT); \
245 USE_GL_FUNC(PGLFNGLPOINTPARAMETERFVEXTPROC, glPointParameterfvEXT); \
246 /* GL_EXT_secondary_color */ \
247 USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3UBEXTPROC, glSecondaryColor3ubEXT); \
248 USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FEXTPROC, glSecondaryColor3fEXT); \
249 USE_GL_FUNC(PGLFNGLSECONDARYCOLOR3FVEXTPROC, glSecondaryColor3fvEXT); \
250 USE_GL_FUNC(PGLFNGLSECONDARYCOLORPOINTEREXTPROC, glSecondaryColorPointerEXT); \
252 #define GLX_EXT_FUNCS_GEN \
253 /** GLX_VERSION_1_3 **/ \
254 USE_GL_FUNC(PGLXFNGLXCREATEPBUFFERPROC, glXCreatePbuffer); \
255 USE_GL_FUNC(PGLXFNGLXDESTROYPBUFFERPROC, glXDestroyPbuffer); \
256 USE_GL_FUNC(PGLXFNGLXCREATEPIXMAPPROC, glXCreatePixmap); \
257 USE_GL_FUNC(PGLXFNGLXDESTROYPIXMAPPROC, glXDestroyPixmap); \
258 USE_GL_FUNC(PGLXFNGLXCREATENEWCONTEXTPROC, glXCreateNewContext); \
259 USE_GL_FUNC(PGLXFNGLXMAKECONTEXTCURRENTPROC, glXMakeContextCurrent); \
260 USE_GL_FUNC(PGLXFNGLXCHOOSEFBCONFIGPROC, glXChooseFBConfig); \
262 #undef APIENTRY
263 #undef CALLBACK
264 #undef WINAPI
266 /* Redefines the constants */
267 #define CALLBACK __stdcall
268 #define WINAPI __stdcall
269 #define APIENTRY WINAPI
271 /* Routine common to the draw primitive and draw indexed primitive routines */
272 void drawPrimitive(LPDIRECT3DDEVICE8 iface,
273 int PrimitiveType,
274 long NumPrimitives,
276 /* for Indexed: */
277 long StartVertexIndex,
278 long StartIdx,
279 short idxBytes,
280 const void *idxData,
281 int minIndex);
283 /* Structures required to draw primitives */
289 typedef struct Direct3DStridedData {
290 BYTE *lpData; /* Pointer to start of data */
291 DWORD dwStride; /* Stride between occurances of this data */
292 DWORD dwType; /* Type (as in D3DVSDT_TYPE) */
293 } Direct3DStridedData;
295 typedef struct Direct3DVertexStridedData {
296 union {
297 struct {
298 Direct3DStridedData position;
299 Direct3DStridedData blendWeights;
300 Direct3DStridedData blendMatrixIndices;
301 Direct3DStridedData normal;
302 Direct3DStridedData pSize;
303 Direct3DStridedData diffuse;
304 Direct3DStridedData specular;
305 Direct3DStridedData texCoords[8];
306 } DUMMYSTRUCTNAME;
307 Direct3DStridedData input[16]; /* Indexed by constants in D3DVSDE_REGISTER */
308 } DUMMYUNIONNAME;
309 } Direct3DVertexStridedData;
311 #endif /* __WINE_D3DCORE_GL_H */