Cross-platform, free (for commercial use) C/C++ 2d game library or rendering engine?

| | August 11, 2015

i need a C/C++ engine that should be really cross platform (or at least windows, android, and iphone).

The 2d engine should be written in C or (better) C++, should permit the rendering of animated sprites, permit transparency, collisions (but i can integrate box2d for that), rotations (eventually with opengl support to accelerate things), handle tile-based games. If it could be a game engine (with support for events/actions, scripting and generally have the features needed when developing a 2D game) it would be fantastic.

There are a lot of open source free 2d engine out there, but soon or later you find that:

  1. the documentation is not so good and/or the tutorials are not so good (or there are
    not tutorial at all), the examples are missing (or are too few or are missing)
  2. the community is too small and not so supportive
  3. the engine doesn’t abstract system things enough. That is bad, because you
    soon find out that there is support for X and Y but not Z. With abstraction, you can
    use even Z adding system specific code
  4. the engine is a game engine but does not have an associated editor. scripting is
    good, but an editor would save a lot of time i think
  5. the engine writers have spent too much time to develop a complex (that will probably
    fails) compilation tools.

It would be useful to have something that:

#define WIN_PLATFORM
#define IOS_PLATFORM
#define ANDROID_PLATFORM
#define UNKNOWN_PLATFORM

In that way, using an empty implementation of the relevant interfaces, you
can simply code what you need

6 . You come to the conclusion that usually there is not a sufficient conceptual separation from what really needs to be abstracted and what can be supposed to be found on almost all systems (e.g. opengl).

Ok. The question is, regarding a free, open source 2d rendering engine or a 2d rendering engine+2d game engine for at least ios and android: in your experience, what would be a good/wise choice?

3 Responses to “Cross-platform, free (for commercial use) C/C++ 2d game library or rendering engine?”

  1. but soon or later you find that:

    You’re not going to find anything that user-friendly in the open-source world. Not full-fledged game engines.

    If you don’t want to spend money on an engine, then you’re going to have to accept one immutable law: you get what you pay for. Let’s go through your points:

    1. People who don’t get paid have little incentive to write documentation, unless they’re particularly anal about it. Remember: free programmers get into a project to code, not to document.

    2. There are a lot of tools out there. Some are going to be more popular than others.

    3. Each engine is designed for a specific purpose. You can’t make everything abstract, because then everything is abstract and nothing is defined. You’d have a library that does nothing. Every engine must decide what it is going to make easy to do and what it isn’t. The kind of games that the engine is made for fall in the former category, and the kind of games that it isn’t made for fall in the latter.

      This is true regardless of whether the engine is free or not.

    4. Pretty much the same as #1. If you’re making an engine, you’re not making a game. And people who are interested in making engines aren’t necessarily interested in going through the other 80% of the work necessary to make a game. Part of that work is a good suite of tools.

      Also, editors are very closely tied into the kinds of games they make. It’s hard to “abstract” an editor. So if you have a general-purpose engine, it’s going to be hard to create an editor for it that doesn’t in some way limit what the user can do. Editors also require a lot more planning than many open-source projects get.

    5. I’ve generally never seen this. Usually, the build process will be CMake, some form of Autoconfig stuff, or just straight-up Makefiles. If they do use a more complex build system, it is only because they want to give the user the ability to configure the software as they wish. SFML and Allegro allow you to pick-and-choose different tools to work with.

    Ultimately, there are plenty of C/C++ tools out there which you can pull together into a game engine. But there is no one-stop-shop for them. There is no one engine that ties them all together in a nice, well-documented package. Which is why serious indie game developers either pick tools they like using and build what they need, or just buy something off-the-shelf.

  2. There is a gameengine named cocos2d-x. it’s c++ port of well-known cocos2d-iphone engine. So far this engine supports iOS, Android, Windows and some other platforms (there is a complete list here). But according to it’s own site windows should only be used for development and debug purposes but I think with a little modification you can release windows version of your game using this engine too.

  3. Arcane Engineer on November 30, -0001 @ 12:00 AM
    1. SDL.
    2. Allegro.
    3. SFML.

    SDL is probably the most popular and known for producing AAA-quality titles.
    Allegro is the oldest (first built for Atari ST I believe) and has seen a huge amount of use. It’s fast and efficient 2D, like SDL.
    SFML is a much newer contender and, as I understand, assumes OpenGL support. However both SDL and Allegro support OpenGL seamlessly in their most recent versions.

    Allegro and SDL are written in C, and plot pixels about as fast as a software renderer could be expected to (which is pretty damn fast on today’s systems). SFML is C++.

    Documentation is decent for all of these, but with SDL and Allegro you may sometimes be slightly confused by articles online that are out of date. The official docs are current, however.

    As for editors, well, you may have to pay for something like Torque2D if that’s what you really need. I haven’t heard the greatest things about that library’s in terms of stability, though. Else go for Java / jME, or C# / Unity.

Leave a Reply