Jump to content
  • Advertisement
Sign in to follow this  
goodperiodical

OpenGL defining glext functions in two source files?

This topic is 3905 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to resurrect an old VC6 project but VC 2005 Express is taking issue with my ARB definitions in a second source file. Originally two source files had identical headers:
#include <gl\glut.h>
#include "glext.h"
PFNGLACTIVETEXTUREARBPROC       glActiveTextureARB       = NULL;
PFNGLMULTITEXCOORD2FARBPROC     glMultiTexCoord2fARB     = NULL;
PFNGLMULTITEXCOORD2FVARBPROC    glMultiTexCoord2fvARB    = NULL;
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL;
and then after openGL is initialized:
glActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) \ wglGetProcAddress("glActiveTextureARB");
glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) \ wglGetProcAddress("glMultiTexCoord2fARB");
glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC) \ wglGetProcAddress("glMultiTexCoord2fvARB");
glClientActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) \ wglGetProcAddress("glClientActiveTextureARB");
Now when I compile it produces an error in the second source file saying the functions are already defined. So I prototyped them:
glActiveTextureARB(GLenum texture);
glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);
glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);
glClientActiveTextureARB(GLenum);
Now I get this error for each line even though all the GL typedefs are defined when glut.h includes gl.h.
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
This is all a little beyond my understanding, I just want to get back to work on my terrain engine! Any ideas?

Share this post


Link to post
Share on other sites
Advertisement

glActiveTextureARB(GLenum texture);

glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t);

glMultiTexCoord2fvARB(GLenum target, const GLfloat *v);

glClientActiveTextureARB(GLenum);



these above needs a return type specified in you function prototype, at lease that is what that error is.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!