Index: /trunk/nv/lib/gl.hh
===================================================================
--- /trunk/nv/lib/gl.hh	(revision 159)
+++ /trunk/nv/lib/gl.hh	(revision 160)
@@ -363,4 +363,6 @@
 
 /* OpenGL 1.4 non-deprecated defines */
+// this one is actually deprecated, but the method glGenerateMipmap isn't available yet in 2.1
+#define GL_GENERATE_MIPMAP 0x8191 
 #define GL_BLEND_DST_RGB 0x80C8
 #define GL_BLEND_SRC_RGB 0x80C9
Index: /trunk/src/gl/gl_texture2d.cc
===================================================================
--- /trunk/src/gl/gl_texture2d.cc	(revision 159)
+++ /trunk/src/gl/gl_texture2d.cc	(revision 160)
@@ -14,4 +14,11 @@
 {
 	glBindTexture( GL_TEXTURE_2D, m_name.get_value() );
+
+	// Detect if mipmapping was requested
+	if (( asampler.filter_min != sampler::LINEAR && asampler.filter_min != sampler::NEAREST ) ||
+		( asampler.filter_max != sampler::LINEAR && asampler.filter_max != sampler::NEAREST ))
+	{
+		glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
+	}
 
 	glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (int)nv::sampler_filter_to_enum( m_sampler.filter_min ) );
