This question already has an answer here:
I generated a loader with http://glad.dav1d.de/
- Language: C/C++
- GL: Version 4.5
- Profile: Core
When I include glad.h
in any file, variable names of near
and far
can't be used. It results in an expected an identifier
, and Error C2513 no variable declared before '='
on Visual Studio 2015 on Windows 10.
#include <glad\glad.h>
int main()
{
float near = 1.0f;
char far = 2.0f;
return 0;
}
The only place where I could find near
and far
in glad.h
typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble near, GLdouble far);
GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange;
It seems that these names are defined as macros in the header or in a header that is included by this header
Usually these names are used for defining so-called near and far addresses.