wglGetProcAddress

Started by
2 comments, last by ade-the-heat 19 years, 6 months ago
Well beside SDL and Glee i m trying to initialise those in a header file: PFNGLACTIVETEXTUREARBPROC glActiveTextureARB; PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB; or PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL; PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL; I always get: error C2440: 'initializing' : cannot convert from 'void (__stdcall *)(GLenum)' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast everything i tried to load the gl extension failed... I m going nuts... I ll apreciate a sample if it exist... but any help will do!! Thx
Advertisement
errm, I think those function defintions should be pointers.
eg note the '*'

PFNGLACTIVETEXTUREARBPROC *glActiveTextureARB = NULL;

cheers
I believe they are already pointers. I don't know why golgoth's code doesn't work, it works on my machine.
Just found similar on a download I have here at work, this works fine and is slightly different to yours:

in the h file
=============
// Here are the multitexture function prototypes
typedef void (APIENTRY * PFNGLMULTITEXCOORD2FARBPROC)
(GLenum target, GLfloat s, GLfloat t);

// Here we extern our function pointers for
extern PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB;


Then in the cpp file use:
========================
glMultiTexCoord2fARB= (PFNGLMULTITEXCOORD2FARBPROC)
wglGetProcAddress("glMultiTexCoord2fARB");


Then use as normal...
After this answer you can "rate me" - I'm negative at the moment but haven't asked a dumb question in ages !

This topic is closed to new replies.

Advertisement