openframeworks/openFrameworks — Issue #810: Add flag for mipmapping in ofTexture/ofFbo
Author: joshuajnoble
Created: 2011-11-11 07:34:53+00:00
State: open

Julapy and I were discussing how to do this on the forum http://forum.openframeworks.cc/index.php?topic=7852 and I think adding a flag to allocate for mipmaps to ofTexture and ofFbo would come in handy for some people.
```C
void ofTexture::allocate(int w, int h, int internalGlDataType, bool bUseARBExtention, bool generateMipmaps = false)
{
if( generateMipmaps )
{
glTexParameterf( texData.textureTarget, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
glTexParameterf( texData.textureTarget, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
glTexParameterf( texData.textureTarget, GL_GENERATE_MIPMAP, GL_TRUE );
}
```C

and in ofFbo

```C
struct Settings {
bool generateMipMaps; // or int
}
```C