• Advertisement
Sign in to follow this  

Multi-purpose library vs Many Libraries

This topic is 2084 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

I have been using SFML - Simple and Fast Multimedia Library to make my games so far, but I am wondering if I should use many seperate libraries (i.e. ImageMagick for graphics, OpenAL for audio etc.) in my game. Will it give me more flexibility and some other unknown advantages?

Additional Details:

I am quite experienced in C++ and have made simple games, e.g. Pong and Tic-Tac-Toe.
I will be using Box2D for physics (hopefully).

Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
My answer would tend to be 'no'. Use the library best suited for the task (in this case, SFML), and add in extra libraries as needed.
I wouldn't use ImageMagick for graphics anyway, that's more suited for things like drawing programs (making your own small Photoshop/Ms Paint/PaintShopPro).

If your project is large, you'll probably end up using multiple libraries anyway, but you might as well start with a good high-quality one that covers the majority of your needs in a consistent way (SFML for audio, graphics, and input, and then other libraries as necessary). Then if you need something SFML doesn't provide, find a different library to use alongside SFML (An example for scripting would be AngelScript or Lua).

SFML is great, fast, and easy to learn. Why force yourself to learn three different libraries with different focuses and different interfaces and different quirks, instead of just using one that handles all three excellently with a common consistent interface, and a single documentation site, and single forum you can visit for help?

(iirc SFML uses OpenAL internally anyway). Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
Thanks for the reply, I think I will stick with SFML, but I know whnere to go if I am developing a graphics application (which doesn't seem unlikely).

Share this post


Link to post
Share on other sites

I have been using SFML - Simple and Fast Multimedia Library to make my games so far, but I am wondering if I should use many seperate libraries (i.e. ImageMagick for graphics, OpenAL for audio etc.) in my game. Will it give me more flexibility and some other unknown advantages?

Additional Details:

I am quite experienced in C++ and have made simple games, e.g. Pong and Tic-Tac-Toe.
I will be using Box2D for physics (hopefully).

Thanks in advance.

That's a really good question and Servant had a great answer to that. I was just curious about this recently. o.o

Share this post


Link to post
Share on other sites
Generally, I prefer libraries that do only and exactly what I want, in a minimalistic way. They should do it with a minimal impact, with a minimal dependency on other libraries.

That is why I don't like Boost. And why glfw is better than freeglut. And the reason I don't like Devil.

I am currently using Assimp, but I will eventually change to a home made file format instead, optimized for my needs.

Of course, a big library may be doing just what you want, in which case it is probably right for you.

Share this post


Link to post
Share on other sites

Generally, I prefer libraries that do only and exactly what I want, in a minimalistic way. They should do it with a minimal impact, with a minimal dependency on other libraries.

This is actually one of the reasons why I like SFML. It's a very minimal and simple wrapper around several libraries that each do one thing, and provides the basic glue that many people normally rewrite and rewrite.

Super bloated libraries that try to do everything (Qt is like that* - though it's designed well, it tries to be everything) aren't to my preference either.
([size=2]IIRC, Boost is actually a collection of separate libraries that are not hyper-dependent on each other (though there are some dependencies), that mostly do one thing. Many of them are even header-file only. I might be mistaken about that though, I've used Boost very little)

*[size=2]I like Qt and use it, because it's good with native GUIs and you can get things running quickly, but I don't enjoy how bloated it is. Edited by Servant of the Lord

Share this post


Link to post
Share on other sites
You are correct about Boost - it is not "a library" but rather a collection of many libraries. I cherry-pick pieces of it all the time with very little issue.

Share this post


Link to post
Share on other sites

You are correct about Boost - it is not "a library" but rather a collection of many libraries. I cherry-pick pieces of it all the time with very little issue.


I tried to use the Options part of Boots, but didn't want to use all of Boost. As I want the source code to be versioned together with my main source code, I wanted to only copy the relevant parts into a sub folder of my project. It turned out not to be feasible, because Options included things that included things, etc. In the end, I wrote my own version as I didn't need all of the Options anyway.

The advantage with saving things like this in a sub folder is that you are ensured that you can recompile your application from older versions. The disadvantage is that it is harder to update when there are newer versions of the library, and you can usually not use the provided installers.

Most "mega libraries" cannot be versioned with the application source code, which is another disadvantage.

Share this post


Link to post
Share on other sites
But completely isolating the pieces of Boost you want from the rest is not an easy thing either.

Most of the time you need Boost.Config, Boost.MPL, Boost.Spirit right away plus a dozen random headers from different Boost libraries (and this is where the fun starts - can you only include those headers oder do you then include the whole library).

I remember writing a shell script that called the compiler, parsed its output for error messages about missing headers and then copied the headers in place -- all just to obtain a minimal Boost subset for my project.

Share this post


Link to post
Share on other sites

Generally, I prefer libraries that do only and exactly what I want, in a minimalistic way. They should do it with a minimal impact, with a minimal dependency on other libraries.

That is why I don't like Boost. And why glfw is better than freeglut. And the reason I don't like Devil.

I am currently using Assimp, but I will eventually change to a home made file format instead, optimized for my needs.

Of course, a big library may be doing just what you want, in which case it is probably right for you.

That's exactly why I asked this question. Of course, SFML is a pretty lightweight library, but sometimes it is better to compile your own library (that's how SFML was made anyway - Laurent obviously felt that the existing libraries were too heavy or outdated and slow. Anyway, it's a good thing that it happened, or otherwise SFML would not have been made.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement