wined3d: Prefer the core glActiveTexture function.

This commit is contained in:
Matteo Bruni 2015-01-08 17:20:21 +01:00 committed by Alexandre Julliard
parent c603e47986
commit 993075cdb3
4 changed files with 21 additions and 7 deletions

View file

@ -7294,7 +7294,7 @@ static void upload_palette(const struct wined3d_texture *texture, struct wined3d
if (!priv->palette_texture)
gl_info->gl_ops.gl.p_glGenTextures(1, &priv->palette_texture);
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE1));
GL_EXTCALL(glActiveTexture(GL_TEXTURE1));
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, priv->palette_texture);
gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

View file

@ -1328,8 +1328,8 @@ static void bind_dummy_textures(const struct wined3d_device *device, const struc
for (i = 0; i < count; ++i)
{
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + i));
checkGLcall("glActiveTextureARB");
GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + i));
checkGLcall("glActiveTexture");
gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, device->dummy_texture_2d[i]);
checkGLcall("glBindTexture");
@ -2115,8 +2115,8 @@ void context_set_draw_buffer(struct wined3d_context *context, GLenum buffer)
/* Context activation is done by the caller. */
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, unsigned int unit)
{
GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0 + unit));
checkGLcall("glActiveTextureARB");
GL_EXTCALL(glActiveTexture(GL_TEXTURE0 + unit));
checkGLcall("glActiveTexture");
context->active_texture = unit;
}

View file

@ -2873,6 +2873,9 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
USE_GL_FUNC(wglGetPixelFormatAttribivARB)
USE_GL_FUNC(wglSetPixelFormatWINE)
USE_GL_FUNC(wglSwapIntervalEXT)
/* Newer core functions */
USE_GL_FUNC(glActiveTexture) /* OpenGL 1.3 */
#undef USE_GL_FUNC
#ifndef USE_WIN32_OPENGL
@ -2880,6 +2883,16 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info)
/* note that we still need the above wglGetProcAddress calls to initialize the table */
gl_info->gl_ops.ext = ((struct opengl_funcs *)NtCurrentTeb()->glTable)->ext;
#endif
#define MAP_GL_FUNCTION(core_func, ext_func) \
do \
{ \
if (!gl_info->gl_ops.ext.p_##core_func) \
gl_info->gl_ops.ext.p_##core_func = gl_info->gl_ops.ext.p_##ext_func; \
} while (0)
MAP_GL_FUNCTION(glActiveTexture, glActiveTextureARB);
#undef MAP_GL_FUNCTION
}
static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)

View file

@ -112,7 +112,8 @@ static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *
context_get_current()->gl_info->gl_ops.gl.p_glTexCoord4sv(v);
}
static void WINE_GLAPI wine_glActiveTextureARB(GLenum texture) {
static void WINE_GLAPI wine_glActiveTexture(GLenum texture)
{
if(texture != GL_TEXTURE0) {
ERR("Texture unit > 0 used, but GL_ARB_multitexture is not supported\n");
return;
@ -351,7 +352,7 @@ void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info)
if (!gl_info->supported[ARB_MULTITEXTURE])
{
TRACE("Applying GL_ARB_multitexture emulation hooks\n");
gl_info->gl_ops.ext.p_glActiveTextureARB = wine_glActiveTextureARB;
gl_info->gl_ops.ext.p_glActiveTexture = wine_glActiveTexture;
gl_info->gl_ops.ext.p_glClientActiveTextureARB = wine_glClientActiveTextureARB;
gl_info->gl_ops.ext.p_glMultiTexCoord1fARB = wine_glMultiTexCoord1fARB;
gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB = wine_glMultiTexCoord1fvARB;