Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


SDL and android?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Bigfatmeany   Members   -  Reputation: 137

Like
0Likes
Like

Posted 20 February 2014 - 08:14 PM

I won't say i'm new to programming, however I am new to android and mobile platforms. My question is simple, How difficult, if possible, would it be to port over a game made for desktop, onto the android platform. I'm not worried about IOS, as I simply have no desire for it. Is this even possible, and excluding modifying controls, what would most likely have to be changes. It's a simple 2D platformer, that is still to early in development to post any preview pics of, or I would as I feel it could help answer my question. Oh and im using Visual Studio 2013, C++11.



Sponsor:

#2 Karsten_   Members   -  Reputation: 1655

Like
3Likes
Like

Posted 21 February 2014 - 03:53 AM

I won't say i'm new to programming, however I am new to android and mobile platforms. My question is simple, How difficult, if possible, would it be to port over a game made for desktop, onto the android platform. I'm not worried about IOS, as I simply have no desire for it. Is this even possible, and excluding modifying controls, what would most likely have to be changes. It's a simple 2D platformer, that is still to early in development to post any preview pics of, or I would as I feel it could help answer my question. Oh and im using Visual Studio 2013, C++11.

 

To port your game to Android it obviously depends entirely on the complexity and dependencies of the game.

Usually I would do the following steps:

 

1) Look at all the dependencies your game has. For example, SDL, OpenAL, libPng.

 

2) Look around for Android ports of those technologies and test them out. If they are messy, then don't spend any further time with them.

 

3) Look at what dependencies your game has left and start duplicating the API but instead hook up the functionality to the underlying Java platform (via JNI). This is the more fiddly step but once you get familiar with JNI, the very large and featureful Android API does provide almost every feature you could require.

 

4) Get a very good system for debugging on the device. You are going to have to do this a lot and if your compile / test / debug cycle is fiddly it will take an enormous amount of time. I.e learn remote gdb. The time really pays off!

 

5) If you are developing the game from scratch to target desktop and Android. It really pays off to setup a build server so whilst you are developing on the desktop version (which is still easier to debug and build) you know you will be alerted if there is a compile failure on the Android side. You can also periodically test the build by simply grabbing it straight via the Androids web browser.

 

Some additional tips.

 

1) Glut has a seemingly more portable design than SDL in that it's callback system is easier to hook up to platforms that do not allow you to control the main loop yourself (such as Android and Emscripten). You don't need to use Glut but perhaps design your SDL application in a way that the main loop is in a callback. This will end up being called from Java on the Android side (unless you go with the NativeActivity which is great but only works on newish devices).

 

2) Prefer individual (swappable) technologies rather than one large massive framework. SDL, SDL_image, SDL_mixer is an example. If you need to replace SDL, you will also be required to replace everything else that relies on it.

 

3) Don't drag in dependencies when you can implement the functionality quite easily yourself. Remember that it is always easier to port your own code between platforms than it is someone elses.

 

4) Avoid locked down platforms (like you are doing with iOS). They are a massive faff unless you jailbreak them but lets be honest, that is barely a permanent solution when your original development device breaks and you have to track down another "hackable" device.


Edited by Karsten_, 21 February 2014 - 04:01 AM.

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.


#3 PauliusM   Members   -  Reputation: 128

Like
0Likes
Like

Posted 22 March 2014 - 03:27 AM

I recently released an android game develped on Android using C/C++ and SDL, what can I say is that the pc code is 99% the same as the android and I think I would use the same code on IOS,Linux and MacOS.


Edited by PauliusM, 22 March 2014 - 03:28 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS