Beispiel #1
0
static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *v) {
    if(target != GL_TEXTURE0) {
        ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
        return;
    }
    context_get_current()->gl_info->gl_ops.gl.p_glTexCoord2sv(v);
}
Beispiel #2
0
static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) {
    if(target != GL_TEXTURE0) {
        ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
        return;
    }
    context_get_current()->gl_info->gl_ops.gl.p_glTexCoord4f(s, t, r, q);
}
Beispiel #3
0
static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
    struct wined3d_context *ctx = context_get_current();
    ctx->color[0] = r;
    ctx->color[1] = g;
    ctx->color[2] = b;
    ctx->color[3] = a;
    old_fogcoord_glColor4f(r, g, b, a);
}
Beispiel #4
0
static void WINE_GLAPI wine_glDisable(GLenum cap) {
    if(cap == GL_FOG) {
        struct wined3d_context *ctx = context_get_current();
        ctx->fog_enabled = 0;
        if(ctx->gl_fog_source != GL_FRAGMENT_DEPTH_EXT) return;
    }
    old_fogcoord_glDisable(cap);
}
Beispiel #5
0
static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) {
    struct wined3d_context *ctx = context_get_current();
    if(ctx->gl_fog_source == GL_FOG_COORDINATE_EXT && ctx->fog_enabled) {
        GLfloat c[4] = {ctx->color[0], ctx->color[1], ctx->color[2], ctx->color[3]};
        GLfloat i;

        i = (ctx->fogend - ctx->fog_coord_value) / (ctx->fogend - ctx->fogstart);
        c[0] = i * c[0] + (1.0f - i) * ctx->fogcolor[0];
        c[1] = i * c[1] + (1.0f - i) * ctx->fogcolor[1];
        c[2] = i * c[2] + (1.0f - i) * ctx->fogcolor[2];

        old_fogcoord_glColor4f(c[0], c[1], c[2], c[3]);
        old_fogcoord_glVertex4f(x, y, z, w);
    } else {
        old_fogcoord_glVertex4f(x, y, z, w);
    }
}
Beispiel #6
0
static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param) {
    struct wined3d_context *ctx = context_get_current();
    if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
        ctx->gl_fog_source = (GLint) param;
        if(param == GL_FRAGMENT_DEPTH_EXT) {
            if(ctx->fog_enabled) old_fogcoord_glEnable(GL_FOG);
        } else {
            WARN("Fog coords activated, but not supported. Using slow emulation\n");
            old_fogcoord_glDisable(GL_FOG);
        }
    } else {
        if(pname == GL_FOG_START) {
            ctx->fogstart = param;
        } else if(pname == GL_FOG_END) {
            ctx->fogend = param;
        }
        old_fogcoord_glFogf(pname, param);
    }
}
Beispiel #7
0
static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param) {
    struct wined3d_context *ctx = context_get_current();
    if(pname == GL_FOG_COORDINATE_SOURCE_EXT) {
        ctx->gl_fog_source = (GLint) *param;
        if(*param == GL_FRAGMENT_DEPTH_EXT) {
            if(ctx->fog_enabled) old_fogcoord_glEnable(GL_FOG);
        } else {
            WARN_(d3d_perf)("Fog coords activated, but not supported. Using slow emulation\n");
            old_fogcoord_glDisable(GL_FOG);
        }
    } else {
        if(pname == GL_FOG_COLOR) {
            ctx->fogcolor[0] = param[0];
            ctx->fogcolor[1] = param[1];
            ctx->fogcolor[2] = param[2];
            ctx->fogcolor[3] = param[3];
        } else if(pname == GL_FOG_START) {
            ctx->fogstart = *param;
        } else if(pname == GL_FOG_END) {
            ctx->fogend = *param;
        }
        old_fogcoord_glFogfv(pname, param);
    }
}
Beispiel #8
0
/* In D3D the fog coord is a UBYTE, so there's no problem with using the single
 * precision function
 */
static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f) {
    struct wined3d_context *ctx = context_get_current();
    ctx->fog_coord_value = f;
}