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