if (gltexturetypedimensions[texturetype] >= 3)
qglTexParameteri(textureenum, GL_TEXTURE_WRAP_R, wrapmode);
- if (flags & TEXF_MIPMAP)
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_min);
+ if (flags & TEXF_FORCENEAREST)
+ {
+ if (flags & TEXF_MIPMAP)
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+ else
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ }
+ else if (flags & TEXF_FORCELINEAR)
+ {
+ if (flags & TEXF_MIPMAP)
+ {
+ if (gl_filter_min == GL_NEAREST_MIPMAP_LINEAR || gl_filter_min == GL_LINEAR_MIPMAP_LINEAR)
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ else
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
+ }
+ else
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ }
else
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_mag);
- qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, gl_filter_mag);
+ {
+ if (flags & TEXF_MIPMAP)
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_min);
+ else
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_mag);
+ qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, gl_filter_mag);
+ }
CHECKGLERROR
}
#define TEXF_FRAGMENT 0x00000010
// indicates texture coordinates should be clamped rather than wrapping
#define TEXF_CLAMP 0x00000020
+// indicates texture should be uploaded using GL_NEAREST or GL_NEAREST_MIPMAP_NEAREST mode
+#define TEXF_FORCENEAREST 0x00000040
+// indicates texture should be uploaded using GL_LINEAR or GL_LINEAR_MIPMAP_NEAREST or GL_LINEAR_MIPMAP_LINEAR mode
+#define TEXF_FORCELINEAR 0x00000080
// used for checking if textures mismatch
-#define TEXF_IMPORTANTBITS (TEXF_ALPHA | TEXF_MIPMAP | TEXF_FRAGMENT | TEXF_CLAMP)
+#define TEXF_IMPORTANTBITS (TEXF_ALPHA | TEXF_MIPMAP | TEXF_FRAGMENT | TEXF_CLAMP | TEXF_FORCENEAREST | TEXF_FORCELINEAR)
// 8bit paletted
#define TEXTYPE_PALETTE 1