#ifndef DYNAMIC_MIPMAP_H
#define DYNAMIC_MIPMAP_H

/*
   If an OpenGL implementation has a fast glCopyTexSubImage2D() and
   supports the SGIS_texture_lod extension, this function can be used
   to quickly build levels of the mipmap tree for dynamic textures.

   Often render-to-texture textures do not use mipmap filtering because
   there's no automatic mechanism for building mipmaps on-card without
   the (not widely implemented) SGIS_generate_mipmap extension.

   This approach uses lod clamping and bilinear filtering to generate
   mipmap images.  The bilinear filtering is set up such that samples
   in the lod being generated are exactly between 4 samples of the
   previous lod -- producing a simple box filtered mipmap pyramid.
   This technique could be extended (through multitexture and/or
   to support more elaborate filter kernels.

   Cass Everitt
   1-19-2001

*/

#ifdef _WIN32
#  pragma warning(disable:4786)   // symbol size limitation ... STL
#endif 

void build_dynamic_mipmaps_2D(int max_level);

#endif
