My experience with SDL2 and game development, part 2

Acid_Snake

I like beer.

9 Responses

  1. wololo says:

    For graphics/sounds, if you don’t find a designer, I also recommend this article I wrote a long time ago about free and open resources: http://wololo.net/2011/10/29/free-art-for-your-games/ . In particular, I strongly recommend opengameart.org

  2. Nobody says:

    You can check out TIG Source.

  3. meysam25 says:

    i am envy to you :((

  4. MrNetrix says:

    From my experience with SDL2 on Android, you have to completely reinitialize the graphics through SDL (after all, you have a new GL context) and not simply reload the textures. Just exiting the game is the “screw it, just work” method, but at least it fixes the issue.

    • Acid_Snake says:

      Well, exiting the game does add the aditional value that the game resources are completely free. People with little ram on their phone such as myself appreciate this.
      Plus, many games out there just save the state and exit then reload the state when you go back like I did here.

  5. Martin Caine says:

    FYI, we also use SDL2 on Android for Z Steel Soldiers. You should be able to respond to messages SDL sends when it is entering the background state or resuming from it such as SDL_APP_WILLENTERBACKGROUND. You shouldn’t need to modify the onPause method yourself.

    Also, whenever possible you should ultimately pause all activity of your application when in the background. You shouldn’t need to actually exit the game. You can ensure all your GL resources are manually freed when you get the background signal and restore them when you get the foreground signal (thus reducing your memory usage in the background and enabling a quick restart on resume.

    Note that many devices actually don’t lose the GL context (but many also do, so it’s usually best to just assume things have been lost or as I said above, free them all yourself when entering the background.