I use glext.h with defining GL_GLEXT_PROTOTYPES. It seems most of the functions are working (including shaders), but few functions don’t work, like glVertexPointerEXT and the others from this familly. Also GL_TEXTURE_3D seems not supported. vertex array extension seems to be well defined.
My program works nice under Linux with glext.h. But under Windows, I can’t make these functions to work. I must use the getProcAddress function to make them work.
Any clue ?
I must use the getProcAddress function to make them work.
I don’t understand the problem. You’re supposed to use wglGetProcAddress to get the addresses of any function not defined in the windows gl.h header.
AFAIK, glext.h is made to avoid using wglGetProcAddress. Am I wrong ? And as I said it works well under Linux.
Vertex arrays are not an extension on Windows so you don’t even need to call wglGetProcAddress; you can just use glVertexPointer directly without calling anything or declaring anything (very same as you’d use glEnable). It may be the case that your 3D card (or it’s Windows driver) doesn’t export the old vertex arrays extension since it went core in OpenGL 1.1 and even the MS software implementation supports it.
Thanks for the answer. However,
the vertex array extension gives functions with slightly different prototypes than default (OpenGL 1.1) ones. Most of them have one more argument. And for avoiding putting different codes regarding the OS, I’d like to use the vertex array extension functions.
AFAIK, glext.h is made to avoid using wglGetProcAddress. Am I wrong ?
glext.h is just a header. It cannot do anything more than that. Getting function pointers is necessary for using OpenGL in Windows. Generally, this is done with an extension loading library.
And for avoiding putting different codes regarding the OS, I’d like to use the vertex array extension functions.
There is no good reason for using ARB_vertex_array. GL 1.1 provides vertex array support that is equivalent to ARB_vertex_array. Every OpenGL implementation you use will provide 1.1 support at a bare minimum. Even the Microsoft software implementation does.
Well I’m sorry, but if you’re going to use functionality that’s been effectively deprecated since 1997, and that was never even an official part of OpenGL to begin with, you shouldn’t be surprised if support for it is lacking.
What are you going to do if you encounter a Linux driver that doesn’t export this extension? Drivers are not obliged to export any GL_EXT_* extensions, irrespective of the GL_VERSION (and irrespective of the platform, before anyone goes into the whole tiresome Linux/Windows thing), and that’s just the way things work.
Any real reason why you can’t just use the standard glVertexPointer/etc functions on all platforms?
Drivers are not obliged to export any GL_EXT_* extensions
Technically, drivers are not obligated to export any extensions. Even ARB extensions are only suggestions.
This does not change the validity of your overall point though.
Thank you both for help. It seems I misunderstood ARB_vertex_array. So I will use core vertex array functions now. Thanks again !
Do you have any hints about GL_TEXTURE_3D that is not defined in the headers I have ?
Thank you for the link !
Since I’m new with developping on OpenGL with Windows and Visual Studio, does it mean I only have to stuck with OpenGL 1.1 and have to get all what became after using extensions ? Isn’t there a mean to get newer headers and libraries to develop on VS ?
The Application Binary Interface is stuck at GL 1.1 (win) or 1.2 (linux), so yes you have to ask at runtime for newer function pointers, either for extension or for GL 2.x 3.x 4.x etc.
GLEW can help you do that with ease.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.