ifeq ($(shell uname), Linux) Graphics = -I/usr/X11R6/include -L/usr/X11R6/bin -lglut -lGL -lGLU else ifeq ($(shell uname), Darwin) # Darwin = Mac Graphics = -framework OpenGL -framework GLUT else Graphics = -I ".\include" -L ".\lib" -lglut -lGLU -lGL -lfreeglut -lglu32 -lopengl32 -Wl,--subsystem,windows -static endif
where .\include and .\lib are just the folders from freeglut-MinGW-2.8.0-1.mp.zip, and my src folder has the freeglut dll inside. So, that said, this is the error I'm getting:
error: 'glDrawRangeElements' was not declared in this scope
due to this call:
glDrawRangeElements(GL_TRIANGLES, 0, 3, 6, GL_UNSIGNED_BYTE, indices+6*i);
So, Googling the error only gives one good Google result, and it's a cryptic dead link reply along with, using glext.h, the following:
PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = NULL; glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)wglGetProcAddress("glDrawRangeElements");
So I tried #include glext.h with the file in my src folder, and it tells me glDrawRangeElements doesn't have a type.
error: 'glDrawRangeElements' does not name a type
Surprisingly, tweaking the above code makes the error go away by removing the middle step:
PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)wglGetProcAddress("glDrawRangeElements");
But when it finally gets to the display of the game, if any instances of glDrawRangeElements are left, it just gives a blank white screen. Commenting out those instances of glDrawRangeElements makes everything except for that work, but trying to include them breaks everything.
Another, unrelated Google result brought this code up:
#ifdef _WIN32 // function pointer to OpenGL extensions // glDrawRangeElements() defined in OpenGL v1.2 or greater PFNGLDRAWRANGEELEMENTSPROC pglDrawRangeElements = 0; #define glDrawRangeElements pglDrawRangeElements #endif
#ifdef _WIN32 // get function pointer to glDrawRangeElements glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)wglGetProcAddress("glDrawRangeElements"); #endif
But I'm basically getting the same errors. If I assign anything to glDrawRangeElements, it says pglDrawRangeElements does not name a type. I have glext.h included too, so this comes off as especially strange. So, any thoughts? I'm on a Windows 7 64-bit OS using OpenGL, GLU, and freeglut as far as I can tell.