cvar_t r_picmip = {CVAR_SAVE, "r_picmip", "0"};
cvar_t r_lerpimages = {CVAR_SAVE, "r_lerpimages", "1"};
cvar_t r_precachetextures = {CVAR_SAVE, "r_precachetextures", "1"};
+cvar_t gl_texture_anisotropy = {CVAR_SAVE, "gl_texture_anisotropy", "0"};
int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
int gl_filter_mag = GL_LINEAR;
Cvar_RegisterVariable (&r_picmip);
Cvar_RegisterVariable (&r_lerpimages);
Cvar_RegisterVariable (&r_precachetextures);
+ Cvar_RegisterVariable (&gl_texture_anisotropy);
R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap);
}
CHECKGLERROR
+ if (gl_support_anisotropy)
+ qglTexParameterf(textureenum, GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_texture_anisotropy.value);
qglTexParameteri(textureenum, GL_TEXTURE_WRAP_S, wrapmode);
qglTexParameteri(textureenum, GL_TEXTURE_WRAP_T, wrapmode);
if (gltexturetypedimensions[texturetype] >= 3)
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+extern int gl_support_anisotropy;
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
+
#define GL_DECAL 0x2101
#define GL_MODULATE 0x2100
//extern void (GLAPIENTRY *qglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
extern void (GLAPIENTRY *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
-//extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+extern void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
//extern void (GLAPIENTRY *qglTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
extern void (GLAPIENTRY *qglTexParameteri)(GLenum target, GLenum pname, GLint param);
int gl_support_var = false;
// GL_NV_vertex_array_range2
int gl_support_var2 = false;
+// GL_EXT_texture_filter_anisotropic
+int gl_support_anisotropy = false;
// LordHavoc: if window is hidden, don't update screen
int vid_hidden = true;
//void (GLAPIENTRY *qglTexEnvf)(GLenum target, GLenum pname, GLfloat param);
void (GLAPIENTRY *qglTexEnvi)(GLenum target, GLenum pname, GLint param);
-//void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+void (GLAPIENTRY *qglTexParameterf)(GLenum target, GLenum pname, GLfloat param);
//void (GLAPIENTRY *qglTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
void (GLAPIENTRY *qglTexParameteri)(GLenum target, GLenum pname, GLint param);
{"glClearStencil", (void **) &qglClearStencil},
// {"glTexEnvf", (void **) &qglTexEnvf},
{"glTexEnvi", (void **) &qglTexEnvi},
-// {"glTexParameterf", (void **) &qglTexParameterf},
+ {"glTexParameterf", (void **) &qglTexParameterf},
// {"glTexParameterfv", (void **) &qglTexParameterfv},
{"glTexParameteri", (void **) &qglTexParameteri},
// {"glPixelStoref", (void **) &qglPixelStoref},
if (gl_support_var)
gl_support_var2 = GL_CheckExtension("GL_NV_vertex_array_range2", NULL, "-novar2", false);
+ gl_support_anisotropy = GL_CheckExtension("GL_EXT_texture_filter_anisotropic", NULL, "-noanisotropy", false);
+
// we don't care if it's an extension or not, they are identical functions, so keep it simple in the rendering code
if (qglDrawRangeElements == NULL)
qglDrawRangeElements = qglDrawRangeElementsEXT;