Sign in to follow this  

Libraries

This topic is 2346 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Game Dev Community

I want to ask the question what is a library. I have on numbers of sites now and still don't understand. All I have got out of it is there are different types of libraries example graphic and the libraries in that section example OpenGL is a graphic. The question is what are libraries, what to use them for,and what types and if you want to add in the library or libraries you us.

I program in C++

Share this post


Link to post
Share on other sites
A library is a collection of code that you can use in your code. In C++ you probably have seen part of the C++ Standard Library that comes with your compiler. It contains a lot of functions, classes and other useful stuff so you don't have to write it all from scratch. There are many different libraries for different purposes and which to use depends on what you want to do.
Examples of libraries are:
SDL - multimedia
zlib - compression
libpng - png files
Eigen - matrix math
...

You often don't have to worry very much of how exactly the libraries are implemented. The user of the library only sees the interface of the library and the actual implementation is hidden and might not even be the same for all platforms.

Share this post


Link to post
Share on other sites
[quote name='MasterMas' timestamp='1310901844' post='4836332']
Hi Game Dev Community

I want to ask the question what is a library. I have on numbers of sites now and still don't understand. All I have got out of it is there are different types of libraries example graphic and the libraries in that section example OpenGL is a graphic. The question is what are libraries, what to use them for,and what types and if you want to add in the library or libraries you us.

I program in C++
[/quote]

A library is a compilation of code that is designed to tackle a specific task. For instance the OpenGL library is designed for Real time 3D graphics, SDL is a library for Multimedia and 2D graphics, tinyxml is a library designed to handle the parsing and manipulation of XML. Boost is a suite of libraries for various other tasks like syntax parsing, and memory management. The purpose of a library is to provide the programmer with a tested solution to a particular problem that arises when developing an application so they don't have to write it themselves.

In the example of say a game you may need to use OpenGL, SDL, DeviL, and tinyxml. OpenGL handles the graphics, SDL for a cross platform window and sound, DeviL for loading images for textures in OpenGL, and tinyxml to handle the configuration of the application.

Share this post


Link to post
Share on other sites
Usually when you write code, you compile it into an application (e.g. EXE). Instead of doing this, you can compile it into a library (e.g. DLL) and then you can write an application that uses that library-code.

e.g. instead of copying and pasting the same code into several applications, you can write that code once and compile it into a library, then you can use that single library in multiple applications.
A simpler way to put it might be: [i]it's a bunch of code that someone wrote.[/i]
[i]
[/i][url="http://en.wikipedia.org/wiki/Library_(computing)"]http://en.wikipedia....ary_(computing)[/url]

Share this post


Link to post
Share on other sites

This topic is 2346 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this