ReactOS 0.4.17-dev-1133-gc25e4fd
gl_compat.c File Reference
#include <stdio.h>
#include "wined3d_private.h"
#include "wined3d_gl.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 GLint * params = NULL
 
static GLint param
 
static GLfloat y
 
static GLfloat GLfloat z
 
static GLfloat GLfloat GLfloat w
 
static GLfloat g
 
static GLfloat GLfloat b
 
static GLfloat GLfloat GLfloat a
 

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 423 of file gl_compat.c.

424{
425 switch (ext)
426 {
427 case ARB_MULTITEXTURE:
428 if (gl_info->supported[ARB_MULTITEXTURE])
429 return;
430 if (gl_info->gl_ops.ext.p_glActiveTexture == wine_glActiveTexture)
431 {
432 FIXME("ARB_multitexture emulation hooks already applied.\n");
433 return;
434 }
435 TRACE("Applying GL_ARB_multitexture emulation hooks.\n");
436 gl_info->gl_ops.ext.p_glActiveTexture = wine_glActiveTexture;
437 gl_info->gl_ops.ext.p_glClientActiveTextureARB = wine_glClientActiveTextureARB;
438 gl_info->gl_ops.ext.p_glMultiTexCoord1fARB = wine_glMultiTexCoord1fARB;
439 gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB = wine_glMultiTexCoord1fvARB;
440 gl_info->gl_ops.ext.p_glMultiTexCoord2fARB = wine_glMultiTexCoord2fARB;
441 gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB = wine_glMultiTexCoord2fvARB;
442 gl_info->gl_ops.ext.p_glMultiTexCoord3fARB = wine_glMultiTexCoord3fARB;
443 gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB = wine_glMultiTexCoord3fvARB;
444 gl_info->gl_ops.ext.p_glMultiTexCoord4fARB = wine_glMultiTexCoord4fARB;
445 gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB = wine_glMultiTexCoord4fvARB;
446 gl_info->gl_ops.ext.p_glMultiTexCoord2svARB = wine_glMultiTexCoord2svARB;
447 gl_info->gl_ops.ext.p_glMultiTexCoord4svARB = wine_glMultiTexCoord4svARB;
448 old_multitex_glGetIntegerv = gl_info->gl_ops.gl.p_glGetIntegerv;
449 gl_info->gl_ops.gl.p_glGetIntegerv = wine_glGetIntegerv;
450 old_multitex_glGetFloatv = gl_info->gl_ops.gl.p_glGetFloatv;
451 gl_info->gl_ops.gl.p_glGetFloatv = wine_glGetFloatv;
452 old_multitex_glGetDoublev = gl_info->gl_ops.gl.p_glGetDoublev;
453 gl_info->gl_ops.gl.p_glGetDoublev = wine_glGetDoublev;
454 gl_info->supported[ARB_MULTITEXTURE] = TRUE;
455 return;
456
457 case EXT_FOG_COORD:
458 /* This emulation isn't perfect. There are a number of potential problems, but they should
459 * not matter in practise:
460 *
461 * Fog vs fragment shader: If we are using GL_ARB_fragment_program with the fog option, the
462 * glDisable(GL_FOG) here won't matter. However, if we have GL_ARB_fragment_program, it is pretty
463 * unlikely that we don't have GL_EXT_fog_coord. Besides, we probably have GL_ARB_vertex_program
464 * too, which would allow fog coord emulation in a fixed function vertex pipeline replacement.
465 *
466 * Fog vs texture: We apply the fog in the vertex color. An app could set up texturing settings which
467 * ignore the vertex color, thus effectively disabling our fog. However, in D3D this type of fog is
468 * a per-vertex fog too, so the apps shouldn't do that.
469 *
470 * Fog vs lighting: The app could in theory use D3DFOG_NONE table and D3DFOG_NONE vertex fog with
471 * untransformed vertices. That enables lighting and fog coords at the same time, and the lighting
472 * calculations could affect the already blended in fog color. There's nothing we can do against that,
473 * but most apps using fog color do their own lighting too and often even use RHW vertices. So live
474 * with it.
475 */
476 if (gl_info->supported[EXT_FOG_COORD])
477 return;
478 if (gl_info->gl_ops.gl.p_glFogi == wine_glFogi)
479 {
480 FIXME("EXT_fog_coord emulation hooks already applied.\n");
481 return;
482 }
483 TRACE("Applying GL_ARB_fog_coord emulation hooks\n");
484
485 /* This probably means that the implementation doesn't advertise the extension, but implicitly supports
486 * it via the GL core version, or someone messed around in the extension table in directx.c. Add version-
487 * dependent loading for this extension if we ever hit this situation
488 */
489 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
490 {
491 FIXME("GL implementation supports GL_ARB_fragment_program but not GL_EXT_fog_coord\n");
492 FIXME("The fog coord emulation will most likely fail\n");
493 }
494 else if (gl_info->supported[ARB_FRAGMENT_SHADER])
495 {
496 FIXME("GL implementation supports GL_ARB_fragment_shader but not GL_EXT_fog_coord\n");
497 FIXME("The fog coord emulation will most likely fail\n");
498 }
499
500 old_fogcoord_glFogi = gl_info->gl_ops.gl.p_glFogi;
501 gl_info->gl_ops.gl.p_glFogi = wine_glFogi;
502 old_fogcoord_glFogiv = gl_info->gl_ops.gl.p_glFogiv;
503 gl_info->gl_ops.gl.p_glFogiv = wine_glFogiv;
504 old_fogcoord_glFogf = gl_info->gl_ops.gl.p_glFogf;
505 gl_info->gl_ops.gl.p_glFogf = wine_glFogf;
506 old_fogcoord_glFogfv = gl_info->gl_ops.gl.p_glFogfv;
507 gl_info->gl_ops.gl.p_glFogfv = wine_glFogfv;
508 old_fogcoord_glEnable = gl_info->p_glEnableWINE;
509 gl_info->p_glEnableWINE = wine_glEnable;
510 old_fogcoord_glDisable = gl_info->p_glDisableWINE;
511 gl_info->p_glDisableWINE = wine_glDisable;
512
513 old_fogcoord_glVertex4f = gl_info->gl_ops.gl.p_glVertex4f;
514 gl_info->gl_ops.gl.p_glVertex4f = wine_glVertex4f;
515 gl_info->gl_ops.gl.p_glVertex4fv = wine_glVertex4fv;
516 gl_info->gl_ops.gl.p_glVertex3f = wine_glVertex3f;
517 gl_info->gl_ops.gl.p_glVertex3fv = wine_glVertex3fv;
518
519 old_fogcoord_glColor4f = gl_info->gl_ops.gl.p_glColor4f;
520 gl_info->gl_ops.gl.p_glColor4f = wine_glColor4f;
521 gl_info->gl_ops.gl.p_glColor4fv = wine_glColor4fv;
522 gl_info->gl_ops.gl.p_glColor3f = wine_glColor3f;
523 gl_info->gl_ops.gl.p_glColor3fv = wine_glColor3fv;
524 gl_info->gl_ops.gl.p_glColor4ub = wine_glColor4ub;
525
526 gl_info->gl_ops.ext.p_glFogCoordfEXT = wine_glFogCoordfEXT;
527 gl_info->gl_ops.ext.p_glFogCoordfvEXT = wine_glFogCoordfvEXT;
528 gl_info->gl_ops.ext.p_glFogCoorddEXT = wine_glFogCoorddEXT;
529 gl_info->gl_ops.ext.p_glFogCoorddvEXT = wine_glFogCoorddvEXT;
530 gl_info->supported[EXT_FOG_COORD] = TRUE;
531 return;
532
533 default:
534 FIXME("Extension %u emulation not supported.\n", ext);
535 }
536}
#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:405
static void WINE_GLAPI wine_glMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:60
static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param)
Definition: gl_compat.c:225
static void WINE_GLAPI wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
Definition: gl_compat.c:399
static void WINE_GLAPI wine_glGetFloatv(GLenum pname, GLfloat *params)
Definition: gl_compat.c:155
static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param)
Definition: gl_compat.c:283
static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param)
Definition: gl_compat.c:254
static void WINE_GLAPI wine_glActiveTexture(GLenum texture)
Definition: gl_compat.c:130
static void WINE_GLAPI wine_glMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:100
static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:40
static void WINE_GLAPI wine_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
Definition: gl_compat.c:70
static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *v)
Definition: gl_compat.c:110
static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
Definition: gl_compat.c:325
static void WINE_GLAPI wine_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
Definition: gl_compat.c:50
static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos)
Definition: gl_compat.c:364
static void WINE_GLAPI wine_glColor3f(GLfloat r, GLfloat g, GLfloat b)
Definition: gl_compat.c:391
static void WINE_GLAPI wine_glColor3fv(const GLfloat *c)
Definition: gl_compat.c:395
static void WINE_GLAPI wine_glFogCoordfvEXT(const GLfloat *f)
Definition: gl_compat.c:414
static void WINE_GLAPI wine_glEnable(GLenum cap)
Definition: gl_compat.c:168
static void WINE_GLAPI wine_glGetIntegerv(GLenum pname, GLint *params)
Definition: gl_compat.c:146
static void WINE_GLAPI wine_glColor4fv(const GLfloat *c)
Definition: gl_compat.c:387
static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param)
Definition: gl_compat.c:196
static void WINE_GLAPI wine_glVertex4fv(const GLfloat *pos)
Definition: gl_compat.c:356
static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
Definition: gl_compat.c:368
static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f)
Definition: gl_compat.c:411
static void WINE_GLAPI wine_glMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:80
static void WINE_GLAPI wine_glDisable(GLenum cap)
Definition: gl_compat.c:182
static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
Definition: gl_compat.c:90
static void WINE_GLAPI wine_glVertex3f(GLfloat x, GLfloat y, GLfloat z)
Definition: gl_compat.c:360
static void WINE_GLAPI wine_glFogCoorddvEXT(const GLdouble *f)
Definition: gl_compat.c:417
static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble *params)
Definition: gl_compat.c:161
static void WINE_GLAPI wine_glMultiTexCoord1fARB(GLenum target, GLfloat s)
Definition: gl_compat.c:30
static void WINE_GLAPI wine_glClientActiveTextureARB(GLenum texture)
Definition: gl_compat.c:138
static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *v)
Definition: gl_compat.c:120
#define TRACE(s)
Definition: solgame.cpp:4
BOOL supported[WINED3D_GL_EXT_COUNT]
Definition: wined3d_gl.h:347
struct opengl_funcs gl_ops
Definition: wined3d_gl.h:353
@ ARB_FRAGMENT_PROGRAM
Definition: wined3d_gl.h:80
@ EXT_FOG_COORD
Definition: wined3d_gl.h:174
@ ARB_FRAGMENT_SHADER
Definition: wined3d_gl.h:82
@ ARB_MULTITEXTURE
Definition: wined3d_gl.h:96

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 130 of file gl_compat.c.

131{
132 if(texture != GL_TEXTURE0) {
133 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
134 return;
135 }
136}
#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 138 of file gl_compat.c.

138 {
139 if(texture != GL_TEXTURE0) {
140 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
141 return;
142 }
143}

Referenced by install_gl_compat_wrapper().

◆ wine_glColor3f()

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

Definition at line 391 of file gl_compat.c.

391 {
392 wine_glColor4f(r, g, b, 1.0f);
393}
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 395 of file gl_compat.c.

395 {
396 wine_glColor4f(c[0], c[1], c[2], 1.0f);
397}
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 368 of file gl_compat.c.

369{
371
372 /* This can be called from draw_test_quad() and at that point there is no
373 * wined3d_context current. */
374 if (!ctx_gl)
375 {
376 old_fogcoord_glColor4f(r, g, b, a);
377 return;
378 }
379
380 ctx_gl->colour[0] = r;
381 ctx_gl->colour[1] = g;
382 ctx_gl->colour[2] = b;
383 ctx_gl->colour[3] = a;
384 old_fogcoord_glColor4f(r, g, b, a);
385}
struct wined3d_context_gl * wined3d_context_gl_get_current(void)
Definition: context_gl.c:1566
static GLfloat GLfloat GLfloat a
Definition: gl_compat.c:323
static GLfloat g
Definition: gl_compat.c:323
static GLfloat GLfloat b
Definition: gl_compat.c:323
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLfloat colour[4]
Definition: wined3d_gl.h:682

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 387 of file gl_compat.c.

387 {
388 wine_glColor4f(c[0], c[1], c[2], c[3]);
389}

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 399 of file gl_compat.c.

399 {
400 wine_glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
401}

Referenced by install_gl_compat_wrapper().

◆ wine_glDisable()

static void WINE_GLAPI wine_glDisable ( GLenum  cap)
static

Definition at line 182 of file gl_compat.c.

183{
184 if (cap == GL_FOG)
185 {
187
188 ctx->fog_enabled = 0;
189 if (ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT)
190 return;
191 }
192 old_fogcoord_glDisable(cap);
193}
#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 168 of file gl_compat.c.

169{
170 if (cap == GL_FOG)
171 {
173
174 ctx->fog_enabled = 1;
175 if (ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT)
176 return;
177 }
178 old_fogcoord_glEnable(cap);
179}

Referenced by install_gl_compat_wrapper().

◆ wine_glFogCoorddEXT()

static void WINE_GLAPI wine_glFogCoorddEXT ( GLdouble  f)
static

Definition at line 411 of file gl_compat.c.

411 {
413}
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 417 of file gl_compat.c.

417 {
419}

Referenced by install_gl_compat_wrapper().

◆ wine_glFogCoordfEXT()

static void WINE_GLAPI wine_glFogCoordfEXT ( GLfloat  f)
static

Definition at line 405 of file gl_compat.c.

406{
408
409 ctx->fog_coord_value = f;
410}
#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 414 of file gl_compat.c.

414 {
416}

Referenced by install_gl_compat_wrapper().

◆ wine_glFogf()

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

Definition at line 254 of file gl_compat.c.

255{
257
259 {
260 ctx->gl_fog_source = (GLint)param;
262 {
263 if (ctx->fog_enabled)
264 old_fogcoord_glEnable(GL_FOG);
265 }
266 else
267 {
268 WARN_(d3d_perf)("Fog coordinates activated, but not supported. Using slow emulation.\n");
269 old_fogcoord_glDisable(GL_FOG);
270 }
271 }
272 else
273 {
274 if (pname == GL_FOG_START)
275 ctx->fog_start = param;
276 else if (pname == GL_FOG_END)
277 ctx->fog_end = param;
278 old_fogcoord_glFogf(pname, param);
279 }
280}
#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:195
#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 283 of file gl_compat.c.

284{
286
288 {
289 ctx->gl_fog_source = (GLint)*param;
291 {
292 if (ctx->fog_enabled)
293 old_fogcoord_glEnable(GL_FOG);
294 }
295 else
296 {
297 WARN_(d3d_perf)("Fog coordinates activated, but not supported. Using slow emulation.\n");
298 old_fogcoord_glDisable(GL_FOG);
299 }
300 }
301 else
302 {
303 if (pname == GL_FOG_COLOR)
304 {
305 ctx->fog_colour[0] = param[0];
306 ctx->fog_colour[1] = param[1];
307 ctx->fog_colour[2] = param[2];
308 ctx->fog_colour[3] = param[3];
309 }
310 else if (pname == GL_FOG_START)
311 {
312 ctx->fog_start = *param;
313 }
314 else if (pname == GL_FOG_END)
315 {
316 ctx->fog_end = *param;
317 }
318 old_fogcoord_glFogfv(pname, param);
319 }
320}
#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 196 of file gl_compat.c.

197{
199
201 {
202 ctx->gl_fog_source = param;
204 {
205 if (ctx->fog_enabled)
206 old_fogcoord_glEnable(GL_FOG);
207 }
208 else
209 {
210 WARN_(d3d_perf)("Fog coordinates activated, but not supported. Using slow emulation.\n");
211 old_fogcoord_glDisable(GL_FOG);
212 }
213 }
214 else
215 {
216 if (pname == GL_FOG_START)
217 ctx->fog_start = (float)param;
218 else if (pname == GL_FOG_END)
219 ctx->fog_end = (float)param;
220 old_fogcoord_glFogi(pname, param);
221 }
222}
static float(WINAPI *pD2D1Tan)(float angle)

Referenced by install_gl_compat_wrapper().

◆ wine_glFogiv()

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

Definition at line 225 of file gl_compat.c.

226{
228
230 {
231 ctx->gl_fog_source = *param;
233 {
234 if (ctx->fog_enabled)
235 old_fogcoord_glEnable(GL_FOG);
236 }
237 else
238 {
239 WARN_(d3d_perf)("Fog coordinates activated, but not supported. Using slow emulation.\n");
240 old_fogcoord_glDisable(GL_FOG);
241 }
242 }
243 else
244 {
245 if (pname == GL_FOG_START)
246 ctx->fog_start = (float)*param;
247 else if (pname == GL_FOG_END)
248 ctx->fog_end = (float)*param;
249 old_fogcoord_glFogiv(pname, param);
250 }
251}

Referenced by install_gl_compat_wrapper().

◆ wine_glGetDoublev()

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

Definition at line 161 of file gl_compat.c.

161 {
162 if(pname == GL_ACTIVE_TEXTURE) *params = 0.0;
163 else old_multitex_glGetDoublev(pname, params);
164}
#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 155 of file gl_compat.c.

155 {
156 if (pname == GL_ACTIVE_TEXTURE) *params = 0.0f;
157 else old_multitex_glGetFloatv(pname, params);
158}

Referenced by install_gl_compat_wrapper().

◆ wine_glGetIntegerv()

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

Definition at line 146 of file gl_compat.c.

146 {
147 switch(pname) {
148 case GL_ACTIVE_TEXTURE: *params = 0; break;
149 case GL_MAX_TEXTURE_UNITS_ARB: *params = 1; break;
150 default: old_multitex_glGetIntegerv(pname, params);
151 }
152}
#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 30 of file gl_compat.c.

31{
32 if (target != GL_TEXTURE0)
33 {
34 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
35 return;
36 }
37 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord1f(s);
38}
GLdouble s
Definition: gl.h:2039
Definition: tools.h:99

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord1fvARB()

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

Definition at line 40 of file gl_compat.c.

41{
42 if (target != GL_TEXTURE0)
43 {
44 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
45 return;
46 }
47 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord1fv(v);
48}
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 50 of file gl_compat.c.

51{
52 if (target != GL_TEXTURE0)
53 {
54 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
55 return;
56 }
57 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord2f(s, t);
58}
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 60 of file gl_compat.c.

61{
62 if (target != GL_TEXTURE0)
63 {
64 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
65 return;
66 }
67 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord2fv(v);
68}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord2svARB()

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

Definition at line 110 of file gl_compat.c.

111{
112 if (target != GL_TEXTURE0)
113 {
114 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
115 return;
116 }
117 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord2sv(v);
118}

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 70 of file gl_compat.c.

71{
72 if (target != GL_TEXTURE0)
73 {
74 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
75 return;
76 }
77 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord3f(s, t, r);
78}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord3fvARB()

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

Definition at line 80 of file gl_compat.c.

81{
82 if (target != GL_TEXTURE0)
83 {
84 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
85 return;
86 }
87 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord3fv(v);
88}

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 90 of file gl_compat.c.

91{
92 if (target != GL_TEXTURE0)
93 {
94 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
95 return;
96 }
97 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord4f(s, t, r, q);
98}
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 100 of file gl_compat.c.

101{
102 if (target != GL_TEXTURE0)
103 {
104 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
105 return;
106 }
107 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord4fv(v);
108}

Referenced by install_gl_compat_wrapper().

◆ wine_glMultiTexCoord4svARB()

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

Definition at line 120 of file gl_compat.c.

121{
122 if (target != GL_TEXTURE0)
123 {
124 ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported.\n");
125 return;
126 }
127 wined3d_context_gl_get_current()->gl_info->gl_ops.gl.p_glTexCoord4sv(v);
128}

Referenced by install_gl_compat_wrapper().

◆ wine_glVertex3f()

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

Definition at line 360 of file gl_compat.c.

360 {
361 wine_glVertex4f(x, y, z, 1.0f);
362}
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 364 of file gl_compat.c.

364 {
365 wine_glVertex4f(pos[0], pos[1], pos[2], 1.0f);
366}

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 325 of file gl_compat.c.

326{
327 const struct wined3d_context_gl *ctx_gl = wined3d_context_gl_get_current();
328
329 /* This can be called from draw_test_quad() and at that point there is no
330 * wined3d_context current. */
331 if (!ctx_gl)
332 {
333 old_fogcoord_glVertex4f(x, y, z, w);
334 return;
335 }
336
337 if (ctx_gl->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx_gl->fog_enabled)
338 {
339 GLfloat c[4] = {ctx_gl->colour[0], ctx_gl->colour[1], ctx_gl->colour[2], ctx_gl->colour[3]};
340 GLfloat i;
341
342 i = (ctx_gl->fog_end - ctx_gl->fog_coord_value) / (ctx_gl->fog_end - ctx_gl->fog_start);
343 c[0] = i * c[0] + (1.0f - i) * ctx_gl->fog_colour[0];
344 c[1] = i * c[1] + (1.0f - i) * ctx_gl->fog_colour[1];
345 c[2] = i * c[2] + (1.0f - i) * ctx_gl->fog_colour[2];
346
347 old_fogcoord_glColor4f(c[0], c[1], c[2], c[3]);
348 old_fogcoord_glVertex4f(x, y, z, w);
349 }
350 else
351 {
352 old_fogcoord_glVertex4f(x, y, z, w);
353 }
354}
#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
GLfloat fog_colour[4]
Definition: wined3d_gl.h:682
uint32_t fog_enabled
Definition: wined3d_gl.h:609
GLfloat fog_coord_value
Definition: wined3d_gl.h:681

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 356 of file gl_compat.c.

356 {
357 wine_glVertex4f(pos[0], pos[1], pos[2], pos[3]);
358}

Referenced by install_gl_compat_wrapper().

Variable Documentation

◆ a

Definition at line 323 of file gl_compat.c.

Referenced by wine_glColor4f().

◆ b

Definition at line 323 of file gl_compat.c.

Referenced by wine_glColor4f().

◆ g

Definition at line 323 of file gl_compat.c.

Referenced by wine_glColor4f().

◆ param

Definition at line 195 of file gl_compat.c.

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

◆ params

Definition at line 145 of file gl_compat.c.

◆ w

Definition at line 322 of file gl_compat.c.

◆ y

Definition at line 322 of file gl_compat.c.

◆ z

Definition at line 322 of file gl_compat.c.