glSecondaryColor3f causing a crash despite extensions being present

Started by
5 comments, last by DrDerekDoctors 18 years, 7 months ago
Odd, I'm finding that my code dies on some machines at a call to "glSecondaryColor3f" despite the fact that in the list of extensions both "GL_EXT_secondary_color" and "GL_EXT_separate_specular_color" are present. Is there something blindingly obvious I'm missing here? Thanks in advance, Graham Goring
Advertisement
have you initalised the function pointers for the functions you are trying to use?
I'll be honest, I've never really done any of that stuff as thought the need for it was only when it was an ARB thingy? Is this a huge area which I've idiotically skipped over?
Wether the function comes from the OpenGL API core, from an ARB-class extension or any other type of extension, you always have to load it manually if the import library (opengl32.lib) won't do it for you.
Ok, I guess I'll have to look up how to do that but if that was the problem, why wouldn't it fail on every PC instead of just some of them, out of curiosity?
Quote:Original post by DrDerekDoctors
Ok, I guess I'll have to look up how to do that but if that was the problem, why wouldn't it fail on every PC instead of just some of them, out of curiosity?


When you need one of the so called extension you request, I'm simplifying, a pointer to a function.
It is the driver that returns you this pointer and only if the extension is supported.
If you forget about initialize the function pointers you are going to use the result can be undefined! So on some lucky systems it does not create problems, on others you have a crash.
My suggestion is to use some high level extension lib like glee or glew (google for glee or glew opengl extension lib).
Ta'. I'm currently reading http://www.gamedev.net/reference/articles/article1929.asp with a view to doing it the hard way.

This topic is closed to new replies.

Advertisement