anisotropy support (for high-end machines) provided by RPG

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6014 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
flowtron
2011-01-17 18:44:30 +00:00
parent c3882648f1
commit a3960cb70b
+17
View File
@@ -139,13 +139,30 @@ void uploadtexture(GLenum target, GLenum internal, int tw, int th, GLenum format
}
if(buf) delete[] buf;
}
void check_anisotropy()
{
float largest_supported_anisotropy;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
conoutf("your card reports: %3.1f as max ansiotropy value", largest_supported_anisotropy);
}
COMMAND(check_anisotropy, ARG_NONE);
VARP(anisotropy, 0, 0, 16);
void createtexture(int tnum, int w, int h, void *pixels, int clamp, bool mipmap, bool canreduce, GLenum format)
{
glBindTexture(GL_TEXTURE_2D, tnum);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp&1 ? GL_CLAMP_TO_EDGE : GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp&2 ? GL_CLAMP_TO_EDGE : GL_REPEAT);
switch(anisotropy)
{
case 1:
case 2:
case 4:
case 8:
case 16: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso); break;
default: break;
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, bilinear ? GL_LINEAR : GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
mipmap ?