ARB extensions problem

Started by
4 comments, last by BradDaBug 20 years, 8 months ago
I'm trying to add the ARB multitexturing extensions to my landscape engine. I'm following NeHe's tutorial. So when I add these lines:

PFNGLMULTITEXCOORD1FARBPROC	glMultiTexCoord1fARB	= NULL;
PFNGLMULTITEXCOORD2FARBPROC	glMultiTexCoord2fARB	= NULL;
PFNGLMULTITEXCOORD3FARBPROC	glMultiTexCoord3fARB	= NULL;
PFNGLMULTITEXCOORD4FARBPROC	glMultiTexCoord4fARB	= NULL;
PFNGLACTIVETEXTUREARBPROC	glActiveTextureARB	= NULL;
PFNGLCLIENTACTIVETEXTUREARBPROC	glClientActiveTextureARB= NULL;   
I get these errors:

c:\code\landscape-0.1\src\graphics.cpp(29) : error C2146: syntax error : missing ';' before identifier 'glMultiTexCoord1fARB'
c:\code\landscape-0.1\src\graphics.cpp(29) : error C2501: 'PFNGLMULTITEXCOORD1FARBPROC' : missing storage-class or type specifiers
c:\code\landscape-0.1\src\graphics.cpp(29) : fatal error C1004: unexpected end of file found   
I'm including glext.h and the extension names (PFNGLMULTITEXCOORD1FARBPROC, etc) are in glext.h but it's still like the compiler thinks they're undefined! What's going on? [edited by - BradDaBug on August 16, 2003 4:16:57 PM]
I like the DARK layout!
Advertisement
You should use extgl, it will handle extension loading for you.
Strange. I'll take a couple of random guesses:

Make sure you include glext.h before the functions.

If you're using multiple files then you need to declare the function pointers in a header file as externs as well as in the CPP file.
ie
extern PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB;

Include glext.h from that file.

[edited by - benjamin bunny on August 16, 2003 7:54:09 PM]

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

I dunno if this'd help any or not, but I just downloaded the Visual C++ project for Lesson 22 at NeHe's site and tried to build it but I'm getting the same error.

Edit: I just noticed I seem to be using the Mesa gl.h file instead of Microsoft's gl.h file. Could that have something to do with it?

Edit: Woo hoo! That was it! But I feel wierd replacing headers created in 2002 with headers created in 1998. Well, at least it works!

[edited by - BradDaBug on August 17, 2003 6:50:23 PM]
I like the DARK layout!
multitexturing is included in OpenGL since version 1.2.1. why bother with extensions and not simply use a newer opengl version?

(no idea where to get new opengl headers/libraries for windows)
quote:Original post by thomas001
multitexturing is included in OpenGL since version 1.2.1. why bother with extensions and not simply use a newer opengl version?

(no idea where to get new opengl headers/libraries for windows)

Since there are no newer libraries for Windows, you will have to load the function pointers anyways. The only difference is that there''s less typing; no "ARB" at the end.

This topic is closed to new replies.

Advertisement