I'm sorry, but what do you mean by initialization of the function?
If you use qt then you can draw only in selected functions (initializeGL, paintGL, etc.) and qt adds all necessary headers.
If you use some other drawing framework like sfml then you have to include sfml files like sfmlgraphics.
If you draw with raw gl then you have to include gl.h (and probably glext.h) to your cpp file and, if you are on windows and use functionality higher than opengl 1.1, then you have to get function pointers from opengl.dll. You can see how this is done in horde (utOpenGL.h). Something like:
Code:
// GL 1.2
PFNGLBLENDCOLORPROC glBlendColor = 0x0;
PFNGLBLENDEQUATIONPROC glBlendEquation = 0x0;
PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = 0x0;
PFNGLTEXIMAGE3DPROC glTexImage3D = 0x0;
PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = 0x0;
PFNGLCOPYTEXSUBIMAGE3DPROC glCopyTexSubImage3D = 0x0;
...
void *platGetProcAddress( const char *funcName )
{
#if defined( PLATFORM_WIN )
return (void *)wglGetProcAddress( funcName );
#elif defined( PLATFORM_WIN_CE )
return (void *)eglGetProcAddress( funcName );
...
}
...
// GL 1.2
r &= (glBlendColor = (PFNGLBLENDCOLORPROC) platGetProcAddress( "glBlendColor" )) != 0x0;
r &= (glBlendEquation = (PFNGLBLENDEQUATIONPROC) platGetProcAddress( "glBlendEquation" )) != 0x0;
r &= (glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) platGetProcAddress( "glDrawRangeElements" )) != 0x0;
...
If you meant initialization as getting platform pointers of gl functions, then yes, you should initialize gl functions higher than specified in OpenGL v1.1.