[WINED3D]
[reactos.git] / reactos / dll / directx / wine / wined3d / gl_compat.c
1 /*
2 * Compatibility functions for older GL implementations
3 *
4 * Copyright 2008 Stefan Dösinger for CodeWeavers
5 *
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.
10 *
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.
15 *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #include "wined3d_private.h"
22
23 WINE_DEFAULT_DEBUG_CHANNEL(gl_compat);
24 WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
25
26 /* Start GL_ARB_multitexture emulation */
27 static void WINE_GLAPI wine_glMultiTexCoord1fARB(GLenum target, GLfloat s) {
28 if(target != GL_TEXTURE0) {
29 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
30 return;
31 }
32 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord1f(s);
33 }
34
35 static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v) {
36 if(target != GL_TEXTURE0) {
37 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
38 return;
39 }
40 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord1fv(v);
41 }
42
43 static void WINE_GLAPI wine_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) {
44 if(target != GL_TEXTURE0) {
45 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
46 return;
47 }
48 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord2f(s, t);
49 }
50
51 static void WINE_GLAPI wine_glMultiTexCoord2fvARB(GLenum target, const GLfloat *v) {
52 if(target != GL_TEXTURE0) {
53 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
54 return;
55 }
56 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord2fv(v);
57 }
58
59 static void WINE_GLAPI wine_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r) {
60 if(target != GL_TEXTURE0) {
61 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
62 return;
63 }
64 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord3f(s, t, r);
65 }
66
67 static void WINE_GLAPI wine_glMultiTexCoord3fvARB(GLenum target, const GLfloat *v) {
68 if(target != GL_TEXTURE0) {
69 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
70 return;
71 }
72 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord3fv(v);
73 }
74
75 static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
76 if(target != GL_TEXTURE0) {
77 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
78 return;
79 }
80 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord4f(s, t, r, q);
81 }
82
83 static void WINE_GLAPI wine_glMultiTexCoord4fvARB(GLenum target, const GLfloat *v) {
84 if(target != GL_TEXTURE0) {
85 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
86 return;
87 }
88 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord4fv(v);
89 }
90
91 static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *v) {
92 if(target != GL_TEXTURE0) {
93 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
94 return;
95 }
96 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord2sv(v);
97 }
98
99 static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *v) {
100 if(target != GL_TEXTURE0) {
101 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
102 return;
103 }
104 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord4sv(v);
105 }
106
107 static void WINE_GLAPI wine_glActiveTextureARB(GLenum texture) {
108 if(texture != GL_TEXTURE0) {
109 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
110 return;
111 }
112 }
113
114 static void WINE_GLAPI wine_glClientActiveTextureARB(GLenum texture) {
115 if(texture != GL_TEXTURE0) {
116 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
117 return;
118 }
119 }
120
121 static void (WINE_GLAPI *old_multitex_glGetIntegerv) (GLenum pname, GLint* params) = NULL;
122 static void WINE_GLAPI wine_glGetIntegerv(GLenum pname, GLint* params) {
123 switch(pname) {
124 case GL_ACTIVE_TEXTURE: *params = 0; break;
125 case GL_MAX_TEXTURE_UNITS_ARB: *params = 1; break;
126 default: old_multitex_glGetIntegerv(pname, params);
127 }
128 }
129
130 static void (WINE_GLAPI *old_multitex_glGetFloatv) (GLenum pname, GLfloat* params) = NULL;
131 static void WINE_GLAPI wine_glGetFloatv(GLenum pname, GLfloat* params) {
132 if (pname == GL_ACTIVE_TEXTURE) *params = 0.0f;
133 else old_multitex_glGetFloatv(pname, params);
134 }
135
136 static void (WINE_GLAPI *old_multitex_glGetDoublev) (GLenum pname, GLdouble* params) = NULL;
137 static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble* params) {
138 if(pname == GL_ACTIVE_TEXTURE) *params = 0.0;
139 else old_multitex_glGetDoublev(pname, params);
140 }
141
142 /* Start GL_EXT_fogcoord emulation */
143 static void (WINE_GLAPI *old_fogcoord_glEnable) (GLenum cap) = NULL;
144 static void WINE_GLAPI wine_glEnable(GLenum cap) {
145 if(cap == GL_FOG) {
146 struct wined3d_context *ctx = context_get_current();
147 ctx->fog_enabled = 1;
148 if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
149 }
150 old_fogcoord_glEnable(cap);
151 }
152
153 static void (WINE_GLAPI *old_fogcoord_glDisable) (GLenum cap) = NULL;
154 static void WINE_GLAPI wine_glDisable(GLenum cap) {
155 if(cap == GL_FOG) {
156 struct wined3d_context *ctx = context_get_current();
157 ctx->fog_enabled = 0;
158 if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
159 }
160 old_fogcoord_glDisable(cap);
161 }
162
163 static void (WINE_GLAPI *old_fogcoord_glFogi) (GLenum pname, GLint param) = NULL;
164 static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param) {
165 struct wined3d_context *ctx = context_get_current();
166
167 if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
168 ctx->gl_fog_source = param;
169 if(param == GL_FRAGMENT_DEPTH_EXT) {
170 if(ctx->fog_enabled) old_fogcoord_glEnable(GL_FOG);
171 } else {
172 WARN_(d3d_perf)("Fog coords activated, but not supported. Using slow emulation\n");
173 old_fogcoord_glDisable(GL_FOG);
174 }
175 } else {
176 if(pname == GL_FOG_START) {
177 ctx->fogstart = (float) param;
178 } else if(pname == GL_FOG_END) {
179 ctx->fogend = (float) param;
180 }
181 old_fogcoord_glFogi(pname, param);
182 }
183 }
184
185 static void (WINE_GLAPI *old_fogcoord_glFogiv) (GLenum pname, const GLint *param) = NULL;
186 static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param) {
187 struct wined3d_context *ctx = context_get_current();
188 if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
189 ctx->gl_fog_source = *param;
190 if(*param == GL_FRAGMENT_DEPTH_EXT) {
191 if(ctx->fog_enabled) old_fogcoord_glEnable(GL_FOG);
192 } else {
193 WARN_(d3d_perf)("Fog coords activated, but not supported. Using slow emulation\n");
194 old_fogcoord_glDisable(GL_FOG);
195 }
196 } else {
197 if(pname == GL_FOG_START) {
198 ctx->fogstart = (float) *param;
199 } else if(pname == GL_FOG_END) {
200 ctx->fogend = (float) *param;
201 }
202 old_fogcoord_glFogiv(pname, param);
203 }
204 }
205
206 static void (WINE_GLAPI *old_fogcoord_glFogf) (GLenum pname, GLfloat param) = NULL;
207 static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
208 struct wined3d_context *ctx = context_get_current();
209 if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
210 ctx->gl_fog_source = (GLint) param;
211 if(param == GL_FRAGMENT_DEPTH_EXT) {
212 if(ctx->fog_enabled) old_fogcoord_glEnable(GL_FOG);
213 } else {
214 WARN_(d3d_perf)("Fog coords activated, but not supported. Using slow emulation\n");
215 old_fogcoord_glDisable(GL_FOG);
216 }
217 } else {
218 if(pname == GL_FOG_START) {
219 ctx->fogstart = param;
220 } else if(pname == GL_FOG_END) {
221 ctx->fogend = param;
222 }
223 old_fogcoord_glFogf(pname, param);
224 }
225 }
226
227 static void (WINE_GLAPI *old_fogcoord_glFogfv) (GLenum pname, const GLfloat *param) = NULL;
228 static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param) {
229 struct wined3d_context *ctx = context_get_current();
230 if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
231 ctx->gl_fog_source = (GLint) *param;
232 if(*param == GL_FRAGMENT_DEPTH_EXT) {
233 if(ctx->fog_enabled) old_fogcoord_glEnable(GL_FOG);
234 } else {
235 WARN_(d3d_perf)("Fog coords activated, but not supported. Using slow emulation\n");
236 old_fogcoord_glDisable(GL_FOG);
237 }
238 } else {
239 if(pname == GL_FOG_COLOR) {
240 ctx->fogcolor[0] = param[0];
241 ctx->fogcolor[1] = param[1];
242 ctx->fogcolor[2] = param[2];
243 ctx->fogcolor[3] = param[3];
244 } else if(pname == GL_FOG_START) {
245 ctx->fogstart = *param;
246 } else if(pname == GL_FOG_END) {
247 ctx->fogend = *param;
248 }
249 old_fogcoord_glFogfv(pname, param);
250 }
251 }
252
253 static void (WINE_GLAPI *old_fogcoord_glVertex4f) (GLfloat x, GLfloat y, GLfloat z, GLfloat w) = NULL;
254 static void (WINE_GLAPI *old_fogcoord_glVertex4fv) (const GLfloat *pos) = NULL;
255 static void (WINE_GLAPI *old_fogcoord_glVertex3f) (GLfloat x, GLfloat y, GLfloat z) = NULL;
256 static void (WINE_GLAPI *old_fogcoord_glVertex3fv) (const GLfloat *pos) = NULL;
257 static void (WINE_GLAPI *old_fogcoord_glColor4f) (GLfloat r, GLfloat g, GLfloat b, GLfloat a) = NULL;
258 static void (WINE_GLAPI *old_fogcoord_glColor4fv) (const GLfloat *color) = NULL;
259 static void (WINE_GLAPI *old_fogcoord_glColor3f) (GLfloat r, GLfloat g, GLfloat b) = NULL;
260 static void (WINE_GLAPI *old_fogcoord_glColor3fv) (const GLfloat *color) = NULL;
261 static void (WINE_GLAPI *old_fogcoord_glColor4ub) (GLubyte r, GLubyte g, GLubyte b, GLubyte a) = NULL;
262 static void (WINE_GLAPI *old_fogcoord_glFogCoordfEXT) (GLfloat f) = NULL;
263 static void (WINE_GLAPI *old_fogcoord_glFogCoorddEXT) (GLdouble f) = NULL;
264 static void (WINE_GLAPI *old_fogcoord_glFogCoordfvEXT) (const GLfloat *f) = NULL;
265 static void (WINE_GLAPI *old_fogcoord_glFogCoorddvEXT) (const GLdouble *f) = NULL;
266
267 static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
268 struct wined3d_context *ctx = context_get_current();
269 if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) {
270 GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]};
271 GLfloat i;
272
273 i = (ctx->fogend - ctx->fog_coord_value) / (ctx->fogend - ctx->fogstart);
274 c[0] = i * c[0] + (1.0f - i) * ctx->fogcolor[0];
275 c[1] = i * c[1] + (1.0f - i) * ctx->fogcolor[1];
276 c[2] = i * c[2] + (1.0f - i) * ctx->fogcolor[2];
277
278 old_fogcoord_glColor4f(c[0], c[1], c[2], c[3]);
279 old_fogcoord_glVertex4f(x, y, z, w);
280 } else {
281 old_fogcoord_glVertex4f(x, y, z, w);
282 }
283 }
284
285 static void WINE_GLAPI wine_glVertex4fv(const GLfloat *pos) {
286 wine_glVertex4f(pos[0], pos[1], pos[2], pos[3]);
287 }
288
289 static void WINE_GLAPI wine_glVertex3f(GLfloat x, GLfloat y, GLfloat z) {
290 wine_glVertex4f(x, y, z, 1.0f);
291 }
292
293 static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos) {
294 wine_glVertex4f(pos[0], pos[1], pos[2], 1.0f);
295 }
296
297 static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
298 struct wined3d_context *ctx = context_get_current();
299 ctx->color[0] = r;
300 ctx->color[1] = g;
301 ctx->color[2] = b;
302 ctx->color[3] = a;
303 old_fogcoord_glColor4f(r, g, b, a);
304 }
305
306 static void WINE_GLAPI wine_glColor4fv(const GLfloat *c) {
307 wine_glColor4f(c[0], c[1], c[2], c[3]);
308 }
309
310 static void WINE_GLAPI wine_glColor3f(GLfloat r, GLfloat g, GLfloat b) {
311 wine_glColor4f(r, g, b, 1.0f);
312 }
313
314 static void WINE_GLAPI wine_glColor3fv(const GLfloat *c) {
315 wine_glColor4f(c[0], c[1], c[2], 1.0f);
316 }
317
318 static void WINE_GLAPI wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a) {
319 wine_glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
320 }
321
322 /* In D3D the fog coord is a UBYTE, so there's no problem with using the single
323 * precision function
324 */
325 static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f) {
326 struct wined3d_context *ctx = context_get_current();
327 ctx->fog_coord_value = f;
328 }
329 static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f) {
330 wine_glFogCoordfEXT((GLfloat) f);
331 }
332 static void WINE_GLAPI wine_glFogCoordfvEXT(const GLfloat *f) {
333 wine_glFogCoordfEXT(*f);
334 }
335 static void WINE_GLAPI wine_glFogCoorddvEXT(const GLdouble *f) {
336 wine_glFogCoordfEXT((GLfloat) *f);
337 }
338
339 /* End GL_EXT_fog_coord emulation */
340
341 void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info)
342 {
343 if (!gl_info->supported[ARB_MULTITEXTURE])
344 {
345 TRACE("Applying GL_ARB_multitexture emulation hooks\n");
346 gl_info->gl_ops.ext.p_glActiveTextureARB = wine_glActiveTextureARB;
347 gl_info->gl_ops.ext.p_glClientActiveTextureARB = wine_glClientActiveTextureARB;
348 gl_info->gl_ops.ext.p_glMultiTexCoord1fARB = wine_glMultiTexCoord1fARB;
349 gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB = wine_glMultiTexCoord1fvARB;
350 gl_info->gl_ops.ext.p_glMultiTexCoord2fARB = wine_glMultiTexCoord2fARB;
351 gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB = wine_glMultiTexCoord2fvARB;
352 gl_info->gl_ops.ext.p_glMultiTexCoord3fARB = wine_glMultiTexCoord3fARB;
353 gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB = wine_glMultiTexCoord3fvARB;
354 gl_info->gl_ops.ext.p_glMultiTexCoord4fARB = wine_glMultiTexCoord4fARB;
355 gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB = wine_glMultiTexCoord4fvARB;
356 gl_info->gl_ops.ext.p_glMultiTexCoord2svARB = wine_glMultiTexCoord2svARB;
357 gl_info->gl_ops.ext.p_glMultiTexCoord4svARB = wine_glMultiTexCoord4svARB;
358 if(old_multitex_glGetIntegerv) {
359 FIXME("GL_ARB_multitexture glGetIntegerv hook already applied\n");
360 } else {
361 old_multitex_glGetIntegerv = gl_info->gl_ops.gl.p_glGetIntegerv;
362 gl_info->gl_ops.gl.p_glGetIntegerv = wine_glGetIntegerv;
363 }
364 if(old_multitex_glGetFloatv) {
365 FIXME("GL_ARB_multitexture glGetGloatv hook already applied\n");
366 } else {
367 old_multitex_glGetFloatv = gl_info->gl_ops.gl.p_glGetFloatv;
368 gl_info->gl_ops.gl.p_glGetFloatv = wine_glGetFloatv;
369 }
370 if(old_multitex_glGetDoublev) {
371 FIXME("GL_ARB_multitexture glGetDoublev hook already applied\n");
372 } else {
373 old_multitex_glGetDoublev = gl_info->gl_ops.gl.p_glGetDoublev;
374 gl_info->gl_ops.gl.p_glGetDoublev = wine_glGetDoublev;
375 }
376 gl_info->supported[ARB_MULTITEXTURE] = TRUE;
377 }
378
379 if (!gl_info->supported[EXT_FOG_COORD])
380 {
381 /* This emulation isn't perfect. There are a number of potential problems, but they should
382 * not matter in practise:
383 *
384 * Fog vs fragment shader: If we are using GL_ARB_fragment_program with the fog option, the
385 * glDisable(GL_FOG) here won't matter. However, if we have GL_ARB_fragment_program, it is pretty
386 * unlikely that we don't have GL_EXT_fog_coord. Besides, we probably have GL_ARB_vertex_program
387 * too, which would allow fog coord emulation in a fixed function vertex pipeline replacement.
388 *
389 * Fog vs texture: We apply the fog in the vertex color. An app could set up texturing settings which
390 * ignore the vertex color, thus effectively disabling our fog. However, in D3D this type of fog is
391 * a per-vertex fog too, so the apps shouldn't do that.
392 *
393 * Fog vs lighting: The app could in theory use D3DFOG_NONE table and D3DFOG_NONE vertex fog with
394 * untransformed vertices. That enables lighting and fog coords at the same time, and the lighting
395 * calculations could affect the already blended in fog color. There's nothing we can do against that,
396 * but most apps using fog color do their own lighting too and often even use RHW vertices. So live
397 * with it.
398 */
399 TRACE("Applying GL_ARB_fog_coord emulation hooks\n");
400
401 /* This probably means that the implementation doesn't advertise the extension, but implicitly supports
402 * it via the GL core version, or someone messed around in the extension table in directx.c. Add version-
403 * dependent loading for this extension if we ever hit this situation
404 */
405 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
406 {
407 FIXME("GL implementation supports GL_ARB_fragment_program but not GL_EXT_fog_coord\n");
408 FIXME("The fog coord emulation will most likely fail\n");
409 }
410 else if (gl_info->supported[ARB_FRAGMENT_SHADER])
411 {
412 FIXME("GL implementation supports GL_ARB_fragment_shader but not GL_EXT_fog_coord\n");
413 FIXME("The fog coord emulation will most likely fail\n");
414 }
415
416 if(old_fogcoord_glFogi) {
417 FIXME("GL_EXT_fogcoord glFogi hook already applied\n");
418 } else {
419 old_fogcoord_glFogi = gl_info->gl_ops.gl.p_glFogi;
420 gl_info->gl_ops.gl.p_glFogi = wine_glFogi;
421 }
422 if(old_fogcoord_glFogiv) {
423 FIXME("GL_EXT_fogcoord glFogiv hook already applied\n");
424 } else {
425 old_fogcoord_glFogiv = gl_info->gl_ops.gl.p_glFogiv;
426 gl_info->gl_ops.gl.p_glFogiv = wine_glFogiv;
427 }
428 if(old_fogcoord_glFogf) {
429 FIXME("GL_EXT_fogcoord glFogf hook already applied\n");
430 } else {
431 old_fogcoord_glFogf = gl_info->gl_ops.gl.p_glFogf;
432 gl_info->gl_ops.gl.p_glFogf = wine_glFogf;
433 }
434 if(old_fogcoord_glFogfv) {
435 FIXME("GL_EXT_fogcoord glFogfv hook already applied\n");
436 } else {
437 old_fogcoord_glFogfv = gl_info->gl_ops.gl.p_glFogfv;
438 gl_info->gl_ops.gl.p_glFogfv = wine_glFogfv;
439 }
440 if(old_fogcoord_glEnable) {
441 FIXME("GL_EXT_fogcoord glEnable hook already applied\n");
442 } else {
443 old_fogcoord_glEnable = glEnableWINE;
444 glEnableWINE = wine_glEnable;
445 }
446 if(old_fogcoord_glDisable) {
447 FIXME("GL_EXT_fogcoord glDisable hook already applied\n");
448 } else {
449 old_fogcoord_glDisable = glDisableWINE;
450 glDisableWINE = wine_glDisable;
451 }
452
453 if(old_fogcoord_glVertex4f) {
454 FIXME("GL_EXT_fogcoord glVertex4f hook already applied\n");
455 } else {
456 old_fogcoord_glVertex4f = gl_info->gl_ops.gl.p_glVertex4f;
457 gl_info->gl_ops.gl.p_glVertex4f = wine_glVertex4f;
458 }
459 if(old_fogcoord_glVertex4fv) {
460 FIXME("GL_EXT_fogcoord glVertex4fv hook already applied\n");
461 } else {
462 old_fogcoord_glVertex4fv = gl_info->gl_ops.gl.p_glVertex4fv;
463 gl_info->gl_ops.gl.p_glVertex4fv = wine_glVertex4fv;
464 }
465 if(old_fogcoord_glVertex3f) {
466 FIXME("GL_EXT_fogcoord glVertex3f hook already applied\n");
467 } else {
468 old_fogcoord_glVertex3f = gl_info->gl_ops.gl.p_glVertex3f;
469 gl_info->gl_ops.gl.p_glVertex3f = wine_glVertex3f;
470 }
471 if(old_fogcoord_glVertex3fv) {
472 FIXME("GL_EXT_fogcoord glVertex3fv hook already applied\n");
473 } else {
474 old_fogcoord_glVertex3fv = gl_info->gl_ops.gl.p_glVertex3fv;
475 gl_info->gl_ops.gl.p_glVertex3fv = wine_glVertex3fv;
476 }
477
478 if(old_fogcoord_glColor4f) {
479 FIXME("GL_EXT_fogcoord glColor4f hook already applied\n");
480 } else {
481 old_fogcoord_glColor4f = gl_info->gl_ops.gl.p_glColor4f;
482 gl_info->gl_ops.gl.p_glColor4f = wine_glColor4f;
483 }
484 if(old_fogcoord_glColor4fv) {
485 FIXME("GL_EXT_fogcoord glColor4fv hook already applied\n");
486 } else {
487 old_fogcoord_glColor4fv = gl_info->gl_ops.gl.p_glColor4fv;
488 gl_info->gl_ops.gl.p_glColor4fv = wine_glColor4fv;
489 }
490 if(old_fogcoord_glColor3f) {
491 FIXME("GL_EXT_fogcoord glColor3f hook already applied\n");
492 } else {
493 old_fogcoord_glColor3f = gl_info->gl_ops.gl.p_glColor3f;
494 gl_info->gl_ops.gl.p_glColor3f = wine_glColor3f;
495 }
496 if(old_fogcoord_glColor3fv) {
497 FIXME("GL_EXT_fogcoord glColor3fv hook already applied\n");
498 } else {
499 old_fogcoord_glColor3fv = gl_info->gl_ops.gl.p_glColor3fv;
500 gl_info->gl_ops.gl.p_glColor3fv = wine_glColor3fv;
501 }
502 if(old_fogcoord_glColor4ub) {
503 FIXME("GL_EXT_fogcoord glColor4ub hook already applied\n");
504 } else {
505 old_fogcoord_glColor4ub = gl_info->gl_ops.gl.p_glColor4ub;
506 gl_info->gl_ops.gl.p_glColor4ub = wine_glColor4ub;
507 }
508
509 if(old_fogcoord_glFogCoordfEXT) {
510 FIXME("GL_EXT_fogcoord glFogCoordfEXT hook already applied\n");
511 } else {
512 old_fogcoord_glFogCoordfEXT = gl_info->gl_ops.ext.p_glFogCoordfEXT;
513 gl_info->gl_ops.ext.p_glFogCoordfEXT = wine_glFogCoordfEXT;
514 }
515 if(old_fogcoord_glFogCoordfvEXT) {
516 FIXME("GL_EXT_fogcoord glFogCoordfvEXT hook already applied\n");
517 } else {
518 old_fogcoord_glFogCoordfvEXT = gl_info->gl_ops.ext.p_glFogCoordfvEXT;
519 gl_info->gl_ops.ext.p_glFogCoordfvEXT = wine_glFogCoordfvEXT;
520 }
521 if(old_fogcoord_glFogCoorddEXT) {
522 FIXME("GL_EXT_fogcoord glFogCoorddEXT hook already applied\n");
523 } else {
524 old_fogcoord_glFogCoorddEXT = gl_info->gl_ops.ext.p_glFogCoorddEXT;
525 gl_info->gl_ops.ext.p_glFogCoorddEXT = wine_glFogCoorddEXT;
526 }
527 if(old_fogcoord_glFogCoorddvEXT) {
528 FIXME("GL_EXT_fogcoord glFogCoorddvEXT hook already applied\n");
529 } else {
530 old_fogcoord_glFogCoorddvEXT = gl_info->gl_ops.ext.p_glFogCoorddvEXT;
531 gl_info->gl_ops.ext.p_glFogCoorddvEXT = wine_glFogCoorddvEXT;
532 }
533 gl_info->supported[EXT_FOG_COORD] = TRUE;
534 }
535 }