Reputation: 4903
I'm just migrating my projects from Visual Studio to Eclipse, so I can build them for Linux, but I've run into problem with OpenGl library files. Visual Studio comes with Microsoft's library and header files for including OpenGL in projects, but this is not the case with Eclipse. I don't know what licensing is used for those Microsoft's files, so I don't want just to "steal" them from their SDK, but I can't find any alternative. I've found just MESA. It should be OpenGL-like but I'm not sure what's the difference. So what are my options for including if not Microsoft's one?
Edit: I've been reading through MESA a bit and I can say that it's not an option. They state that their GLSL compiler support only version 1.2. That is VERY old one. I need for my projects at least GLSL 1.5.
Upvotes: 3
Views: 1712
Reputation: 162164
OpenGL is not some library, but an API. The installed graphics driver implement OpenGL and your programm loads OpenGL from the drivers. Mesa3D is the set of open source drivers and implementation of the OpenGL API for Linux. But if you install NVidia or AMD/ATI propriatary drivers, it will be those who implement OpenGL on your system.
For development the only thing you need to know is, that your program shall dynamically link against libGL.so (Linux) or opengl32.dll (Windows) and that any functionality beyond OpenGL-1.1 is made available through the so called extension system, which is most easily utilized through a library like GLEW ( http://glew.sf.net ).
There is no library you need to install or link into your program!
The OpenGL implementation of a system is, of course, a library, but all OpenGL implementations implement the same API, and it is this API you use.
For development under Windows the compilers should ship the right headers (MinGW, Cygwin and Microsoft's SDK come with it), plus a linker information library stub called opengl32.lib.
Under Linux for development you install the Mesa3D development libraries, which supply you with the minimal header and a stub libGL.so giving the linker the information to build the right import table into the executable.
Your program doesn't need to include some OpenGL, but rather expects it to be installed on the system – an assumption very safe to be made. Even Windows Vista and 7 ship with some OpenGL implementation and in Linux it's a commonly installed thing. On MacOS X it's always present, as the whole OS X GUI builds upon OpenGL.
Upvotes: 3