paroj / gltut

Learning Modern 3D Graphics Programming
https://paroj.github.io/gltut/
MIT License
1.57k stars 377 forks source link

OpenGL version problems give cryptic errors #83

Open paroj opened 10 years ago

paroj commented 10 years ago

Originally reported by: James Edgar (Bitbucket: j1s1e1, GitHub: j1s1e1)


Great tutorials. The opengl version testing fails with crypitc errors on some linux systems. If I just try to run the tutorial, I get this:

X Error of failed request: GLXBadFBConfig Major opcode of failed request: 153 (GLX) Minor opcode of failed request: 34 () Serial number of failed request: 34 Current serial number in output stream: 33

It might be helpful to check the versions before switching to the 3,3 context. Something like this:

#define add_test 1
#ifdef add_test
glutCreateWindow("test");
glutFullScreen();
glload::LoadFunctions();
int major_version =  glload::GetMajorVersion();
printf("OpenGL version supported by this platform (%d): \n", glload::GetMajorVersion());
if (major_version < 3)
{
     printf("Main version too low, Exiting");
    exit(1);
}
else
{
    printf("Continuing");
}
#endif

before

glutInitContextVersion (3, 3);

gives a much clearer error.

Thanks,

James

OpenGL version supported by this platform (2): Main version too low, Exiting