How can I modify the OpenGL source file?

I have an OpenGL file called wglew.h that I downloaded from http://glew.sourceforge.net/ . Using wglew.h on boot, I get the following error when compiling the program I have (I use MacOSX):

/Users/Downloads/glew-1.11.0/include/GL/wglew.h:70:10: fatal error:'windows.h' file not found 

I am trying to go back to the source code of this file and change its dependency on windows.h to what the Mac could recognize. Source code snippet in wglew.h file:

 #if !defined(WINAPI) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN 1 # endif #include <windows.h> # undef WIN32_LEAN_AND_MEAN #endif 

Is it possible to get around this windows.h dependency so that my program does not exit this step? I asked a similar, but not identical question about the parallel concept: Where can I get windows.h for Mac? Perhaps instead of looking for the equivalent windows.h file (if it exists for Mac), I can try to develop a more subtle approach to changing the source code in the wglew.h file to make my program work and take into account the dependency on the windows that I am experiencing?

0
source share
1 answer

Here we say again: GLEW is not part of OpenGL . This is a third-party library.

You don't need GLEW on MacOS X!

You bark the wrong tree!

Instead of trying to fix GLEW (which you don't need). Just fix your program so you don’t use GLEW when compiling for MacOS X.

Everywhere in your program where you find

 #include <glew.h> 

or

 #include <GL/glew.h> 

Change it to

 #ifndef __APPLE__ #include <GL/glew.h> #else #include <OpenGL/gl.h> #endif/*__APPLE__*/ 

Place any event in which the GLEW function is called between

 #ifndef __APPLE__ … #endif/*__APPLE__*/ 

.

You do not need GLEW on MacOS X! Do not use it there.

0
source

Source: https://habr.com/ru/post/977321/


All Articles