glGenerateMipmap- identifier not found?

Chris Dobinson picture Chris Dobinson · Mar 2, 2011 · Viewed 7.1k times · Source

I'm trying to implement glGenerateMipmap so I can go on to recolour each level of a cube I've rendered, except the program won't compile giving the error

'error C3861: 'glGenerateMipmap': identifier not found'

I've included '#include ' and inside the header the definition seems to exist (though inside an IF statement? see below) so I was wondering if there was a way to redefine/locate it somehow so the program will compile or run, and if not if there was another method to automatically generating mipmaps?

#ifdef GL_GLEXT_PROTOTYPES
...
...
GLAPI void APIENTRY glGenerateMipmap (GLenum);
...
#endif /* GL_GLEXT_PROTOTYPES */

Many thanks, Chris

Answer

tibur picture tibur · Mar 2, 2011

glGenerateMipmaps is an extension. Consider using glew to load it.