Extensions?

I’m just trying to make it easier for people learning OpenGL, especially students that dont have much programming experience.
To be honest, if someone wants to learn OpenGL, he should get a bit programming experience first. If someone has not enough experience to be able to call strstr a few times on the extension string, trying to write an OpenGL program is propably way over his head.

And there are always extension loading libraries…

String handling is not a trivial issue when you design an API for many different languages. The simpler datastructure returned, the less problems you will have with different languages.

A single space-separated string is probably the simplest structure, and will likely be the least problem for any language. An array of pointers to strings is a more complex structure and really gains you nothing other than easy loading in languages where such a structure actually make sense in native code.

In the vertex program extension document, for example, there’s even an explicit issue (number 45) asking whether the program string should be null terminated or not. While strings in C are null terminated, they decided to not use null-terminated strings due to language reasons. Shows that the string issue is not as trivial as this thread and it’s suggestions thinks sometimes.

A function like this would not be any worse from a language point of view than the current approach:

GLubyte *glEnumExtension(GLuint index);

Originally posted by modus:
[b] I’m not sure what’s more amazing, that developers make that mistake in a commercial release, or that IHV’s actually cover their mistake.

Sounds like as good a reason as any for a game patch.[/b]
The game was patched, however, these would still be loads of unpatched copies out there, and you don’t want your new shiny OpenGL 2.0 implementation be recognized as OpenGL 1.0 and the game refuse to run because of that. And since the problem appeared when upgrading drivers people would blame the IHV. And you can also think about the situation where for instance Nvidia would work around the problem, but not ATI. If you find that the game works on Nvidia but not ATI, how would that affect ATI’s reputation, regardless who’s to blame? The unfortunate fact is that IHVs are often forced to cover their own asses when game developers do bad things.

Thre is always the OpenAL way of doing it;

GLBoolean lpIsExtensionPresent(const char* extname);

man gluCheckExtension
man glutExtensionSupported
EOF

There are also GLEW and GLEE, which are very fast and handle checking for extensions and the GL version, as well as loading the entry points.