Replace gluBuild2DMipmaps with GL_GENERATE_MIPMAPS
Quote "gluBuild2DMipmaps. Never use this." gluBuild2DMipmaps was causing massive stutters on many maps on windows builds especially (alot less noticable on unix builds) due to it being buggy and using the CPU for generating Mipmaps this does not completely eliminate them but drastically reduces them this removes gluBuild2DMipmaps completely in favor of the GL_GENERATE_MIPMAPS parameter However it raises the OpenGL version requirement for them to 1.4, hence the check which disables Mipmap generation on versions below
https://www.khronos.org/opengl/wiki/Common_Mistakes under "Automatic mipmap generation"