ReactOS 0.4.16-dev-306-g647d351
gl_compat.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include "wined3d_private.h"
Include dependency graph for gl_compat.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (gl_compat)
 
 WINE_DECLARE_DEBUG_CHANNEL (d3d_perf)
 
static void WINE_GLAPI wine_glMultiTexCoord1fARB (GLenum target, GLfloat s)
 
static void WINE_GLAPI wine_glMultiTexCoord1fvARB (GLenum target, const GLfloat *v)
 
static void WINE_GLAPI wine_glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t)
 
static void WINE_GLAPI wine_glMultiTexCoord2fvARB (GLenum target, const GLfloat *v)
 
static void WINE_GLAPI wine_glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r)
 
static void WINE_GLAPI wine_glMultiTexCoord3fvARB (GLenum target, const GLfloat *v)
 
static void WINE_GLAPI wine_glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
 
static void WINE_GLAPI wine_glMultiTexCoord4fvARB (GLenum target, const GLfloat *v)
 
static void WINE_GLAPI wine_glMultiTexCoord2svARB (GLenum target, const GLshort *v)
 
static void WINE_GLAPI wine_glMultiTexCoord4svARB (GLenum target, const GLshort *v)
 
static void WINE_GLAPI wine_glActiveTexture (GLenum texture)
 
static void WINE_GLAPI wine_glClientActiveTextureARB (GLenum texture)
 
static void (WINE_GLAPI *old_multitex_glGetIntegerv)(GLenum pname
 
static void WINE_GLAPI wine_glGetIntegerv (GLenum pname, GLint *params)
 
static void WINE_GLAPI wine_glGetFloatv (GLenum pname, GLfloat *params)
 
static void WINE_GLAPI wine_glGetDoublev (GLenum pname, GLdouble *params)
 
static void WINE_GLAPI wine_glEnable (GLenum cap)
 
static void WINE_GLAPI wine_glDisable (GLenum cap)
 
static void WINE_GLAPI wine_glFogi (GLenum pname, GLint param)
 
static void WINE_GLAPI wine_glFogiv (GLenum pname, const GLint *param)
 
static void WINE_GLAPI wine_glFogf (GLenum pname, GLfloat param)
 
static void WINE_GLAPI wine_glFogfv (GLenum pname, const GLfloat *param)
 
static void WINE_GLAPI wine_glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w)
 
static void WINE_GLAPI wine_glVertex4fv (const GLfloat *pos)
 
static void WINE_GLAPI wine_glVertex3f (GLfloat x, GLfloat y, GLfloat z)
 
static void WINE_GLAPI wine_glVertex3fv (const GLfloat *pos)
 
static void WINE_GLAPI wine_glColor4f (GLfloat r, GLfloat g, GLfloat b, GLfloat a)
 
static void WINE_GLAPI wine_glColor4fv (const GLfloat *c)
 
static void WINE_GLAPI wine_glColor3f (GLfloat r, GLfloat g, GLfloat b)
 
static void WINE_GLAPI wine_glColor3fv (const GLfloat *c)
 
static void WINE_GLAPI wine_glColor4ub (GLubyte r, GLubyte g, GLubyte b, GLubyte a)
 
static void WINE_GLAPI wine_glFogCoordfEXT (GLfloat f)
 
static void WINE_GLAPI wine_glFogCoorddEXT (GLdouble f)
 
static void WINE_GLAPI wine_glFogCoordfvEXT (const GLfloat *f)
 
static void WINE_GLAPI wine_glFogCoorddvEXT (const GLdouble *f)
 
void install_gl_compat_wrapper (struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext)
 

Variables

static GLintparams = NULL
 
static GLint param = NULL
 
static GLfloat y
 
static GLfloat GLfloat z
 
static GLfloat GLfloat GLfloat w = NULL
 
static GLfloat g
 
static GLfloat GLfloat b
 
static GLfloat GLfloat GLfloat a = NULL
 

Function Documentation

◆ install_gl_compat_wrapper()

void install_gl_compat_wrapper ( struct wined3d_gl_info gl_info,
enum wined3d_gl_extension  ext 
)

Definition at line 355 of file gl_compat.c.

356{
357 switch (ext)
358 {
359 case ARB_MULTITEXTURE:
360 if (gl_info->supported[ARB_MULTITEXTURE])
361 return;
362 if (gl_info->gl_ops.ext.p_glActiveTexture == wine_glActiveTexture)
363 {
364 FIXME("ARB_multitexture emulation hooks already applied.\n");
365 return;
366 }
367 TRACE("Applying GL_ARB_multitexture emulation hooks.\n");
368 gl_info->gl_ops.ext.p_glActiveTexture = wine_glActiveTexture;
369 gl_info->gl_ops.ext.p_glClientActiveTextureARB = wine_glClientActiveTextureARB;
370 gl_info->gl_ops.ext.p_glMultiTexCoord1fARB = wine_glMultiTexCoord1fARB;
371 gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB = wine_glMultiTexCoord1fvARB;
372 gl_info->gl_ops.ext.p_glMultiTexCoord2fARB = wine_glMultiTexCoord2fARB;
373 gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB = wine_glMultiTexCoord2fvARB;
374 gl_info->gl_ops.ext.p_glMultiTexCoord3fARB = wine_glMultiTexCoord3fARB;
375 gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB = wine_glMultiTexCoord3fvARB;
376 gl_info->gl_ops.ext.p_glMultiTexCoord4fARB = wine_glMultiTexCoord4fARB;
377 gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB = wine_glMultiTexCoord4fvARB;
378 gl_info->gl_ops.ext.p_glMultiTexCoord2svARB = wine_glMultiTexCoord2svARB;
379 gl_info->gl_ops.ext.p_glMultiTexCoord4svARB = wine_glMultiTexCoord4svARB;
380 old_multitex_glGetIntegerv = gl_info->gl_ops.gl.p_glGetIntegerv;
381 gl_info->gl_ops.gl.p_glGetIntegerv = wine_glGetIntegerv;
382 old_multitex_glGetFloatv = gl_info->gl_ops.gl.p_glGetFloatv;
383 gl_info->gl_ops.gl.p_glGetFloatv = wine_glGetFloatv;
384 old_multitex_glGetDoublev = gl_info->gl_ops.gl.p_glGetDoublev;
385 gl_info->gl_ops.gl.p_glGetDoublev = wine_glGetDoublev;
386 gl_info->supported[ARB_MULTITEXTURE] = TRUE;
387 return;
388
389 case EXT_FOG_COORD:
390 /* This emulation isn't perfect. There are a number of potential problems, but they should
391 * not matter in practise:
392 *
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.
397 *
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.
401 *
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.
407 */
408 if (gl_info->supported[EXT_FOG_COORD])
409 return;
410 if (gl_info->gl_ops.gl.p_glFogi == wine_glFogi)
411 {
412 FIXME("EXT_fog_coord emulation hooks already applied.\n");
413 return;
414 }
415 TRACE("Applying GL_ARB_fog_coord emulation hooks\n");
416
417 /* This probably means that the implementation doesn't advertise the extension, but implicitly supports
418 * it via the GL core version, or someone messed around in the extension table in directx.c. Add version-
419 * dependent loading for this extension if we ever hit this situation
420 */
421 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
422 {
423 FIXME("GL implementation supports GL_ARB_fragment_program but not GL_EXT_fog_coord\n");
424 FIXME("The fog coord emulation will most likely fail\n");
425 }
426 else if (gl_info->supported[ARB_FRAGMENT_SHADER])
427 {
428 FIXME("GL implementation supports GL_ARB_fragment_shader but not GL_EXT_fog_coord\n");
429 FIXME("The fog coord emulation will most likely fail\n");
430 }
431
432 old_fogcoord_glFogi = gl_info->gl_ops.gl.p_glFogi;
433 gl_info->gl_ops.gl.p_glFogi = wine_glFogi;
434 old_fogcoord_glFogiv = gl_info->gl_ops.gl.p_glFogiv;
435 gl_info->gl_ops.gl.p_glFogiv = wine_glFogiv;
436 old_fogcoord_glFogf = gl_info->gl_ops.gl.p_glFogf;
437 gl_info->gl_ops.gl.p_glFogf = wine_glFogf;
438 old_fogcoord_glFogfv = gl_info->gl_ops.gl.p_glFogfv;
439 gl_info->gl_ops.gl.p_glFogfv = wine_glFogfv;
440 old_fogcoord_glEnable = glEnableWINE;
441 glEnableWINE = wine_glEnable;
442 old_fogcoord_glDisable = glDisableWINE;
443 glDisableWINE = wine_glDisable;
444
445 old_fogcoord_glVertex4f = gl_info->gl_ops.gl.p_glVertex4f;
446 gl_info->gl_ops.gl.p_glVertex4f = wine_glVertex4f;
447 gl_info->gl_ops.gl.p_glVertex4fv = wine_glVertex4fv;
448 gl_info->gl_ops.gl.p_glVertex3f = wine_glVertex3f;
449 gl_info->gl_ops.gl.p_glVertex3fv = wine_glVertex3fv;
450
451 old_fogcoord_glColor4f = gl_info->gl_ops.gl.p_glColor4f;
452 gl_info->gl_ops.gl.p_glColor4f = wine_glColor4f;
453 gl_info->gl_ops.gl.p_glColor4fv = wine_glColor4fv;
454 gl_info->gl_ops.gl.p_glColor3f = wine_glColor3f;
455 gl_info->gl_ops.gl.p_glColor3fv = wine_glColor3fv;
456 gl_info->gl_ops.gl.p_glColor4ub = wine_glColor4ub;
457
458 gl_info->gl_ops.ext.p_glFogCoordfEXT = wine_glFogCoordfEXT;
459 gl_info->gl_ops.ext.p_glFogCoordfvEXT = wine_glFogCoordfvEXT;
460 gl_info->gl_ops.ext.p_glFogCoorddEXT = wine_glFogCoorddEXT;
461 gl_info->gl_ops.ext.p_glFogCoorddvEXT = wine_glFogCoorddvEXT;
462 gl_info->supported[EXT_FOG_COORD] = TRUE;
463 return;
464
465 default:
466 FIXME("Extension %u emulation not supported.\n", ext);
467 }
468}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define TRUE
Definition: types.h:120
static const WCHAR *const ext[]
Definition: module.c:53
static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f)
Definition: gl_compat.c:339
static void WINE_GLAPI wine_glMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:59
static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param)
Definition: gl_compat.c:195
static void WINE_GLAPI wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
Definition: gl_compat.c:332
static void WINE_GLAPI wine_glGetFloatv(GLenum pname, GLfloat *params)
Definition: gl_compat.c:140
static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param)
Definition: gl_compat.c:237
static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param)
Definition: gl_compat.c:216
static void WINE_GLAPI wine_glActiveTexture(GLenum texture)
Definition: gl_compat.c:115
static void WINE_GLAPI wine_glMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:91
static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:43
static void WINE_GLAPI wine_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
Definition: gl_compat.c:67
static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *v)
Definition: gl_compat.c:99
static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
Definition: gl_compat.c:265
static void WINE_GLAPI wine_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
Definition: gl_compat.c:51
static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos)
Definition: gl_compat.c:299
static void WINE_GLAPI wine_glColor3f(GLfloat r, GLfloat g, GLfloat b)
Definition: gl_compat.c:324
static void WINE_GLAPI wine_glColor3fv(const GLfloat *c)
Definition: gl_compat.c:328
static void WINE_GLAPI wine_glFogCoordfvEXT(const GLfloat *f)
Definition: gl_compat.c:346
static void WINE_GLAPI wine_glEnable(GLenum cap)
Definition: gl_compat.c:153
static void WINE_GLAPI wine_glGetIntegerv(GLenum pname, GLint *params)
Definition: gl_compat.c:131
static void WINE_GLAPI wine_glColor4fv(const GLfloat *c)
Definition: gl_compat.c:320
static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param)
Definition: gl_compat.c:173
static void WINE_GLAPI wine_glVertex4fv(const GLfloat *pos)
Definition: gl_compat.c:291
static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
Definition: gl_compat.c:303
static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f)
Definition: gl_compat.c:343
static void WINE_GLAPI wine_glMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:75
static void WINE_GLAPI wine_glDisable(GLenum cap)
Definition: gl_compat.c:163
static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
Definition: gl_compat.c:83
static void WINE_GLAPI wine_glVertex3f(GLfloat x, GLfloat y, GLfloat z)
Definition: gl_compat.c:295
static void WINE_GLAPI wine_glFogCoorddvEXT(const GLdouble *f)
Definition: gl_compat.c:349
static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble *params)
Definition: gl_compat.c:146
static void WINE_GLAPI wine_glMultiTexCoord1fARB(GLenum target, GLfloat s)
Definition: gl_compat.c:35
static void WINE_GLAPI wine_glClientActiveTextureARB(GLenum texture)
Definition: gl_compat.c:123
static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *v)
Definition: gl_compat.c:107
#define TRACE(s)
Definition: solgame.cpp:4
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
@ ARB_FRAGMENT_PROGRAM
Definition: wined3d_gl.h:70
@ EXT_FOG_COORD
Definition: wined3d_gl.h:157
@ ARB_FRAGMENT_SHADER
Definition: wined3d_gl.h:71
@ ARB_MULTITEXTURE
Definition: wined3d_gl.h:85

Referenced by wined3d_adapter_init_gl_caps().

◆ void()

static void ( WINE_GLAPI old_multitex_glGetIntegerv)
static

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( d3d_perf  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( gl_compat  )

◆ wine_glActiveTexture()

static void WINE_GLAPI wine_glActiveTexture ( GLenum  texture)
static

Definition at line 115 of file gl_compat.c.

116{
117 if(texture != GL_TEXTURE0) {
118 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
119 return;
120 }
121}
#define ERR(fmt,...)
Definition: precomp.h:57
#define GL_TEXTURE0
Definition: gl.h:1750
GLenum GLuint texture
Definition: glext.h:6295

Referenced by install_gl_compat_wrapper().

◆ wine_glClientActiveTextureARB()

static void WINE_GLAPI wine_glClientActiveTextureARB ( GLenum  texture)
static

Definition at line 123 of file gl_compat.c.

123 {
124 if(texture != GL_TEXTURE0) {
125 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
126 return;
127 }
128}

Referenced by install_gl_compat_wrapper().

◆ wine_glColor3f()

static void WINE_GLAPI wine_glColor3f ( GLfloat  r,
GLfloat  g,
GLfloat  b 
)
static

Definition at line 324 of file gl_compat.c.

324 {
325 wine_glColor4f(r, g, b, 1.0f);
326}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean g
Definition: glext.h:6204

Referenced by install_gl_compat_wrapper().

◆ wine_glColor3fv()

static void WINE_GLAPI wine_glColor3fv ( const GLfloat c)
static

Definition at line 328 of file gl_compat.c.

328 {
329 wine_glColor4f(c[0], c[1], c[2], 1.0f);
330}
const GLubyte * c
Definition: glext.h:8905

Referenced by install_gl_compat_wrapper().

◆ wine_glColor4f()

static void WINE_GLAPI wine_glColor4f ( GLfloat  r,
GLfloat  g,
GLfloat  b,
GLfloat  a 
)
static

Definition at line 303 of file gl_compat.c.

303 {
305
306 /* This can be called from draw_test_quad() and at that point there is no
307 * wined3d_context current. */
308 if (!ctx)
309 {
310 old_fogcoord_glColor4f(r, g, b, a);
311 return;
312 }
313 ctx->color[0] = r;
314 ctx->color[1] = g;
315 ctx->color[2] = b;
316 ctx->color[3] = a;
317 old_fogcoord_glColor4f(r, g, b, a);
318}
struct wined3d_context * context_get_current(void)
Definition: context.c:1507
static GLfloat GLfloat GLfloat a
Definition: gl_compat.c:263
static GLfloat g
Definition: gl_compat.c:263
static GLfloat GLfloat b
Definition: gl_compat.c:263
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by install_gl_compat_wrapper(), wine_glColor3f(), wine_glColor3fv(), wine_glColor4fv(), and wine_glColor4ub().

◆ wine_glColor4fv()

static void WINE_GLAPI wine_glColor4fv ( const GLfloat c)
static

Definition at line 320 of file gl_compat.c.

320 {
321 wine_glColor4f(c[0], c[1], c[2], c[3]);
322}

Referenced by install_gl_compat_wrapper().

◆ wine_glColor4ub()

static void WINE_GLAPI wine_glColor4ub ( GLubyte  r,
GLubyte  g,
GLubyte  b,
GLubyte  a 
)
static

Definition at line 332 of file gl_compat.c.

332 {
333 wine_glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
334}

Referenced by install_gl_compat_wrapper().

◆ wine_glDisable()

static void WINE_GLAPI wine_glDisable ( GLenum  cap)
static

Definition at line 163 of file gl_compat.c.

163 {
164 if(cap == GL_FOG) {
166 ctx->fog_enabled = 0;
167 if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
168 }
169 old_fogcoord_glDisable(cap);
170}
#define GL_FOG
Definition: gl.h:414
#define GL_FRAGMENT_DEPTH_EXT
Definition: glext.h:3198
GLenum cap
Definition: glext.h:9639

Referenced by install_gl_compat_wrapper().

◆ wine_glEnable()

static void WINE_GLAPI wine_glEnable ( GLenum  cap)
static

Definition at line 153 of file gl_compat.c.

153 {
154 if(cap == GL_FOG) {
156 ctx->fog_enabled = 1;
157 if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
158 }
159 old_fogcoord_glEnable(cap);
160}

Referenced by install_gl_compat_wrapper().

◆ wine_glFogCoorddEXT()

static void WINE_GLAPI wine_glFogCoorddEXT ( GLdouble  f)
static

Definition at line 343 of file gl_compat.c.

343 {
345}
float GLfloat
Definition: gl.h:161
GLfloat f
Definition: glext.h:7540

Referenced by install_gl_compat_wrapper().

◆ wine_glFogCoorddvEXT()

static void WINE_GLAPI wine_glFogCoorddvEXT ( const GLdouble f)
static

Definition at line 349 of file gl_compat.c.

349 {
351}

Referenced by install_gl_compat_wrapper().

◆ wine_glFogCoordfEXT()

static void WINE_GLAPI wine_glFogCoordfEXT ( GLfloat  f)
static

Definition at line 339 of file gl_compat.c.

339 {
341 ctx->fog_coord_value = f;
342}
#define f
Definition: ke_i.h:83

Referenced by install_gl_compat_wrapper(), wine_glFogCoorddEXT(), wine_glFogCoorddvEXT(), and wine_glFogCoordfvEXT().

◆ wine_glFogCoordfvEXT()

static void WINE_GLAPI wine_glFogCoordfvEXT ( const GLfloat f)
static

Definition at line 346 of file gl_compat.c.

346 {
348}

Referenced by install_gl_compat_wrapper().

◆ wine_glFogf()

static void WINE_GLAPI wine_glFogf ( GLenum  pname,
GLfloat  param 
)
static

Definition at line 216 of file gl_compat.c.

216 {
219 ctx->gl_fog_source = (GLint) param;
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);
225 }
226 } else {
227 if(pname == GL_FOG_START) {
228 ctx->fogstart = param;
229 } else if(pname == GL_FOG_END) {
230 ctx->fogend = param;
231 }
232 old_fogcoord_glFogf(pname, param);
233 }
234}
#define GL_FOG_END
Definition: gl.h:420
#define GL_FOG_START
Definition: gl.h:419
int GLint
Definition: gl.h:156
static GLint param
Definition: gl_compat.c:172
#define GL_FOG_COORDINATE_SOURCE_EXT
Definition: glext.h:3196
GLenum pname
Definition: glext.h:5645
GLfloat param
Definition: glext.h:5796
#define WARN_(ch,...)
Definition: debug.h:157

Referenced by install_gl_compat_wrapper().

◆ wine_glFogfv()

static void WINE_GLAPI wine_glFogfv ( GLenum  pname,
const GLfloat param 
)
static

Definition at line 237 of file gl_compat.c.

237 {
240 ctx->gl_fog_source = (GLint) *param;
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);
246 }
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;
257 }
258 old_fogcoord_glFogfv(pname, param);
259 }
260}
#define GL_FOG_COLOR
Definition: gl.h:417

Referenced by install_gl_compat_wrapper().

◆ wine_glFogi()

static void WINE_GLAPI wine_glFogi ( GLenum  pname,
GLint  param 
)
static

Definition at line 173 of file gl_compat.c.

173 {
175
177 ctx->gl_fog_source = param;
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);
183 }
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;
189 }
190 old_fogcoord_glFogi(pname, param);
191 }
192}
static float(__cdecl *square_half_float)(float x

Referenced by install_gl_compat_wrapper().

◆ wine_glFogiv()

static void WINE_GLAPI wine_glFogiv ( GLenum  pname,
const GLint param 
)
static

Definition at line 195 of file gl_compat.c.

195 {
198 ctx->gl_fog_source = *param;
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);
204 }
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;
210 }
211 old_fogcoord_glFogiv(pname, param);
212 }
213}

Referenced by install_gl_compat_wrapper().

◆ wine_glGetDoublev()

static void WINE_GLAPI wine_glGetDoublev ( GLenum  pname,
GLdouble params 
)
static

Definition at line 146 of file gl_compat.c.

146 {
147 if(pname == GL_ACTIVE_TEXTURE) *params = 0.0;
148 else old_multitex_glGetDoublev(pname, params);
149}
#define GL_ACTIVE_TEXTURE
Definition: gl.h:1782
GLenum const GLfloat * params
Definition: glext.h:5645

Referenced by install_gl_compat_wrapper().

◆ wine_glGetFloatv()

static void WINE_GLAPI wine_glGetFloatv ( GLenum  pname,
GLfloat params 
)
static

Definition at line 140 of file gl_compat.c.

140 {
141 if (pname == GL_ACTIVE_TEXTURE) *params = 0.0f;
142 else old_multitex_glGetFloatv(pname, params);
143}

Referenced by install_gl_compat_wrapper().

◆ wine_glGetIntegerv()

static void WINE_GLAPI wine_glGetIntegerv ( GLenum  pname,
GLint params 
)
static

Definition at line 131 of file gl_compat.c.

131 {
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);
136 }
137}
#define GL_MAX_TEXTURE_UNITS_ARB
Definition: gl.h:2000

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord1fARB()

static void WINE_GLAPI wine_glMultiTexCoord1fARB ( GLenum  target,
GLfloat  s 
)
static

Definition at line 35 of file gl_compat.c.

35 {
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_glTexCoord1f(s);
41}
GLdouble s
Definition: gl.h:2039
GLenum target
Definition: glext.h:7315

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord1fvARB()

static void WINE_GLAPI wine_glMultiTexCoord1fvARB ( GLenum  target,
const GLfloat v 
)
static

Definition at line 43 of file gl_compat.c.

43 {
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_glTexCoord1fv(v);
49}
const GLdouble * v
Definition: gl.h:2040

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord2fARB()

static void WINE_GLAPI wine_glMultiTexCoord2fARB ( GLenum  target,
GLfloat  s,
GLfloat  t 
)
static

Definition at line 51 of file gl_compat.c.

51 {
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_glTexCoord2f(s, t);
57}
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord2fvARB()

static void WINE_GLAPI wine_glMultiTexCoord2fvARB ( GLenum  target,
const GLfloat v 
)
static

Definition at line 59 of file gl_compat.c.

59 {
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_glTexCoord2fv(v);
65}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord2svARB()

static void WINE_GLAPI wine_glMultiTexCoord2svARB ( GLenum  target,
const GLshort v 
)
static

Definition at line 99 of file gl_compat.c.

99 {
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_glTexCoord2sv(v);
105}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord3fARB()

static void WINE_GLAPI wine_glMultiTexCoord3fARB ( GLenum  target,
GLfloat  s,
GLfloat  t,
GLfloat  r 
)
static

Definition at line 67 of file gl_compat.c.

67 {
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_glTexCoord3f(s, t, r);
73}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord3fvARB()

static void WINE_GLAPI wine_glMultiTexCoord3fvARB ( GLenum  target,
const GLfloat v 
)
static

Definition at line 75 of file gl_compat.c.

75 {
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_glTexCoord3fv(v);
81}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord4fARB()

static void WINE_GLAPI wine_glMultiTexCoord4fARB ( GLenum  target,
GLfloat  s,
GLfloat  t,
GLfloat  r,
GLfloat  q 
)
static

Definition at line 83 of file gl_compat.c.

83 {
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_glTexCoord4f(s, t, r, q);
89}
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord4fvARB()

static void WINE_GLAPI wine_glMultiTexCoord4fvARB ( GLenum  target,
const GLfloat v 
)
static

Definition at line 91 of file gl_compat.c.

91 {
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_glTexCoord4fv(v);
97}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord4svARB()

static void WINE_GLAPI wine_glMultiTexCoord4svARB ( GLenum  target,
const GLshort v 
)
static

Definition at line 107 of file gl_compat.c.

107 {
108 if(target != GL_TEXTURE0) {
109 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
110 return;
111 }
112 context_get_current()->gl_info->gl_ops.gl.p_glTexCoord4sv(v);
113}

Referenced by install_gl_compat_wrapper().

◆ wine_glVertex3f()

static void WINE_GLAPI wine_glVertex3f ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)
static

Definition at line 295 of file gl_compat.c.

295 {
296 wine_glVertex4f(x, y, z, 1.0f);
297}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble z
Definition: glext.h:5874

Referenced by install_gl_compat_wrapper().

◆ wine_glVertex3fv()

static void WINE_GLAPI wine_glVertex3fv ( const GLfloat pos)
static

Definition at line 299 of file gl_compat.c.

299 {
300 wine_glVertex4f(pos[0], pos[1], pos[2], 1.0f);
301}

Referenced by install_gl_compat_wrapper().

◆ wine_glVertex4f()

static void WINE_GLAPI wine_glVertex4f ( GLfloat  x,
GLfloat  y,
GLfloat  z,
GLfloat  w 
)
static

Definition at line 265 of file gl_compat.c.

265 {
267
268 /* This can be called from draw_test_quad() and at that point there is no
269 * wined3d_context current. */
270 if (!ctx)
271 {
272 old_fogcoord_glVertex4f(x, y, z, w);
273 return;
274 }
275 if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) {
276 GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]};
277 GLfloat i;
278
279 i = (ctx->fogend - ctx->fog_coord_value) / (ctx->fogend - ctx->fogstart);
280 c[0] = i * c[0] + (1.0f - i) * ctx->fogcolor[0];
281 c[1] = i * c[1] + (1.0f - i) * ctx->fogcolor[1];
282 c[2] = i * c[2] + (1.0f - i) * ctx->fogcolor[2];
283
284 old_fogcoord_glColor4f(c[0], c[1], c[2], c[3]);
285 old_fogcoord_glVertex4f(x, y, z, w);
286 } else {
287 old_fogcoord_glVertex4f(x, y, z, w);
288 }
289}
#define GL_FOG_COORDINATE_EXT
Definition: glext.h:3197
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by install_gl_compat_wrapper(), wine_glVertex3f(), wine_glVertex3fv(), and wine_glVertex4fv().

◆ wine_glVertex4fv()

static void WINE_GLAPI wine_glVertex4fv ( const GLfloat pos)
static

Definition at line 291 of file gl_compat.c.

291 {
292 wine_glVertex4f(pos[0], pos[1], pos[2], pos[3]);
293}

Referenced by install_gl_compat_wrapper().

Variable Documentation

◆ a

Definition at line 263 of file gl_compat.c.

Referenced by wine_glColor4f().

◆ b

Definition at line 263 of file gl_compat.c.

Referenced by wine_glColor4f().

◆ g

Definition at line 263 of file gl_compat.c.

Referenced by wine_glColor4f().

◆ param

Definition at line 172 of file gl_compat.c.

Referenced by wine_glFogf(), wine_glFogfv(), wine_glFogi(), and wine_glFogiv().

◆ params

Definition at line 130 of file gl_compat.c.

◆ w

Definition at line 262 of file gl_compat.c.

◆ y

Definition at line 262 of file gl_compat.c.

◆ z

Definition at line 262 of file gl_compat.c.