hello guys
i am trying to install glext.h and wglext.h but it seems there are some tricks i don’t know.
i use vc++6 with windows xp, first i downloaded the recent driver for my grafics card and (glext.h and wglext.h) from OpenGL Registry
i use the code that create the window at nehe’s tutorial first lesson so my .cpp contains the following headers.
[b]#include <windows.h> // Header File For Windows
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h>
#include <gl\glext.h>
#include <gl\wglext.h>
#include <gl\pfuncs.h>
[/b]
in pfuncs.h header file i put the following pointer functions’ definations.
extern PFNGLVIEWPORTPROC glViewport;
extern PFNGLLOADIDENTITYPROC glLoadIdentity;
extern PFNGLSHADEMODELPROC glShadeModel;
extern PFNGLCLEARCOLORPROC glClearColor;
extern PFNGLCLEARDEPTHPROC glClearDepth;
extern PFNGLENABLEPROC glEnable;
extern PFNGLDEPTHFUNCPROC glDepthFunc;
extern PFNGLHINTPROC glHint;
extern PFNGLCLEARPROC glClear;
extern PFNGLGETSTRINGPROC glGetString;
when i run the program i receive the following error that is about the first function defination whatever the first is from the definations above:
--------Configuration: lesson1 - Win32 Debug---------
Compiling…
Lesson1.cpp
c:\program files\microsoft visual studio\vc98\include\gl\pfuncs.h(17) : error C2146: syntax error : missing ‘;’ before identifier ‘glViewport’
c:\program files\microsoft visual studio\vc98\include\gl\pfuncs.h(17) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
lesson1.exe - 2 error(s), 0 warning(s)
but if i put the following function defination i don’t receive an error message about it even i put it at the first of the header file but still receive the error for the next defination.
extern PFNGLACTIVETEXTUREPROC glActiveTexture;
so what’s the problem doesn’t all the opengl functions need a pointer function or what is wrong here??
an other thing,now after i updated my graphics card driver i note that my program can run even without (#include <gl/gl.h>)
could you explain that for me.
many thanks