Original Post
Im pretty baffled by what is going on, when i request for a 3.2 context, glGenFramebuffers is a null pointer. If i request for a 3.1 or 3.0 context, there is no problem and everything runs fine. As far as im aware glGenFramebuffers was not depreciated in 3.2. Im using SFML v2 from the SVN snapshot and glew to load my extensions. Just for more info, this is the SFML source code which creates the actual context. In all cases, Glew returns OK during init. Also, in the 3.2 case, GL_VERSION returns 3.20. Hardware is a nvidia G210 and using latest drivers.
sf::ContextSettings Settings;
Settings.MajorVersion = 3;
Settings.MinorVersion = 2;//Opengl 3.2
canvas.Create(sf::VideoMode(WIDTH, HEIGHT, 32), "High Poly Viewer", sf::Style::Close, Settings);
GLenum err = glewInit();//Initialise Glew to handle extensions
if (GLEW_OK != err)
{
std::cout<<"Error, could not init GLEW\n";
}
glGenFramebuffers(1, &FBOid);//Fails here, glGenFramebuffers is a null pointer
// Create the OpenGL context -- first try an OpenGL 3.0 context if it is requested
while (!myContext && (mySettings.MajorVersion >= 3))
{
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB =
reinterpret_cast<PFNWGLCREATECONTEXTATTRIBSARBPROC>(wglGetProcAddress("wglCreateContextAttribsARB"));
if (wglCreateContextAttribsARB)
{
int attributes[] =
{
WGL_CONTEXT_MAJOR_VERSION_ARB, mySettings.MajorVersion,
WGL_CONTEXT_MINOR_VERSION_ARB, mySettings.MinorVersion,
0, 0
};
myContext = wglCreateContextAttribsARB(myDeviceContext, sharedContext, attributes);
}
// If we couldn't create an OpenGL 3 context, adjust the settings
if (!myContext)
{
if (mySettings.MinorVersion > 0)
{
// If the minor version is not 0, we decrease it and try again
mySettings.MinorVersion--;
}
else
{
// If the minor version is 0, we decrease the major version and stop with 3.x contexts
mySettings.MajorVersion = 2;
}
}
}