added generate_mipmaps method to textures
implemented fbo.attach_new*, fixed Texture1D bug