View Full Version : Don't got no glDrawRangeElements
04-20-2004, 01:24 PM
I'm using MSVS6 SP5 on Win2000
My gl.h don't got no glDrawRangeElements, its
/*++ BUILD Version: 0004 // Increment this if a change has global effects
Copyright (c) 1985-96, Microsoft Corporation
where do I get a newer gl.h?
i searched microsoft.com, google,
couldn't find one and opengl.org doesn't link to one.
thanks in advance
You can download glext.h from the extension registry (http://oss.sgi.com/projects/ogl-sample/registry/) , and then you load the function using wglGetProcAddress.
glDrawRangeElements = reinterpret_cast<PFNGLDRAWRANGEELEMENTSPROC>(wglGetProcAddress("glDrawRangeElements"));
Somewhat more explicative:
Microsoft does not really like OpenGL so the win32 header files and libs are really out of date.
There's no updated GL 1.2 or newer header file for win32.
The only way to get GL1.2 functionality (or newer) is to get your hands dirty with extensions. The extension registry end the message by Bob provides most useful information.
A lot of tutorial on the internet use extensions. If you cannot figure it out then check for them.
The idea is that to use an extension:
1- You have to get an update glext.h - extension registry has an "official one", each vendor provides another one which could support different extensions. glext.h from extension registry usually works nicely enough.
2- You have to read the spec a little (also avaiable from extension registry).
3- You have to have a pointer somewhere in your code (for me those pointers are global) of adeguate type. Usually, the pointer type is typedef'ed in glext.h and it's in the form (just to remember it)
P - pointer
FN - to function (I guess)
GL - openGL (can also be WGL or considered part of the name, not really important).
<functionName> - name of the function capitalized so BlendFunc has BLENDFUNC here, VertexAttrib3fARB has VERTEXATTRIB3F.
<extension> - some function like glBlendEquationEXT has EXT here. This is optional for functions which are now in core.
PROC - don't know since this is the same as 'FN' for me... maybe they simply liked to add this to avoid some sort of collisions.
4- Init your extensions using wglGetProcAddress (see Bob's message for that, it's pretty explicative).
5- If it rets null then something must be done since ext is not supported.
6- Do your job.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.