Members - Reputation: 107
Posted 13 May 2012 - 02:02 AM
Crossbones+ - Reputation: 7132
Posted 13 May 2012 - 03:28 AM
A library is a collection of related stuff. Especially software libraries are a collection of software functions. Software libraries may be linked to a software program statically or dynamically (and then usually are called DLLs ("dynamically linked library" or SOs "shared object"). A related description of how and when to invoke which function, including any necessary structure, is called an API ("application programming interface").
Now, OpenGL is a graphics programming environment. Strictly speaking it is just an API. Implementations of this API are numerous. However, in real life often the belonging libraries are meant when saying "OpenGL".
A wrapper in this context is a piece of software that gives the wrapped piece of software another API. This is usually done to hide implementation specifics of a library from a framework, enabling to easily switch to another library without altering the framework itself. E.g. a wrapper around OpenGL and a wrapper around Direct3D may be written to yield in an own single API for both, so that an engine can deal with any of these graphics using just that single API.
Crossbones+ - Reputation: 779
Posted 13 May 2012 - 08:53 AM
A library is usually just a large collection of code. They are usually found in DLLs and may be linked to dynamically for functions a programmer doesn't feel like writing. Suppose somebody wrote a system of 3+1d vectors for homogenous coordinates and doesn't want to replicate the entire set of functions in all his future programs. He can export those functions inside a DLL so they become a library of functions. You just look inside the library for what you want, and use it.
Strictly speaking, OpenGL and DirectX are APIs/application programming interfaces. They are just a set of libraries that provide lower level code that will get the job done, and nothing more. This is also a reason for creating wrappers and engines. They will usually hide the lower level DirectX/OpenGL code and make things easier for the dev and allow for more readable code.