VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/wined3d/gl_compat.c@ 19892

最後變更 在這個檔案從19892是 19678,由 vboxsync 提交於 16 年 前

opengl: update wine to 1.1.21, add d3d9.dll to build list

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette