PDA

View Full Version : Don't got no glDrawRangeElements



bad logic
04-20-2004, 12:24 PM
Hi.
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

Bob
04-21-2004, 01:10 AM
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.

PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements;
...
glDrawRangeElements = reinterpret_cast<PFNGLDRAWRANGEELEMENTSPROC>(wglGetProcAddress("glDrawRangeElements"));

Obli
04-21-2004, 09:48 AM
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)
PFNGL<functionName>[<extension>]PROC
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.