Welcome, Guest. Please login or register.

Author Topic: Cross Platform Programming  (Read 8615 times)

Description:

0 Members and 4 Guests are viewing this topic.

Offline Crumb

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1786
  • Country: 00
    • Show all replies
    • http://cuaz.sourceforge.net
Re: Cross Platform Programming
« on: May 14, 2013, 06:49:23 PM »
You have to design your code to be portable. Take a look at BasiliskII for example, it was designed with portability in mind. Split the parts that are platform specific, you'll probably gain readability too. Many linux apps are just "hardcoded" posix apps not easily portable to non posix systems (that's why Cygwin exists for Linux and ixemul for Amiga). Take as an example SheepShaver, the latest maintainer posixified all the code making it non-portable to non-posix platforms.

If you decide to learn C amiga is a good platform for that too, the most important part is that you learn to use pointers properly, otherwise there's no much sense in using C.

If you decide to develop games you could use SDL library, it won't be fun to use on miggies. You can create your own functions for drawing sprites, backgrounds... and once SDL works then you can try to make an OCS/AGA/CGX version (it won't be easy but will be more effective than embedding SDL calls everywhere in your code).

If you decide to create an app try to split the logic part from the GUI and the storage one. You may have to rewrite small parts of storage part for taking care of endianness and you will have to rewrite GUI part for sure but it's not such a big problem, there are usually tools for that.

On Amiga systems the GUI of choice would be MUI as it's supported on all systems and for other OSes you can choose GTK, QT... keep in mind that these alien GUIs run awfully on Amiga if they run at all.
The only spanish amiga news web page/club: Club de Usuarios de Amiga de Zaragoza (CUAZ)
 

Offline Crumb

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1786
  • Country: 00
    • Show all replies
    • http://cuaz.sourceforge.net
Re: Cross Platform Programming
« Reply #1 on: May 15, 2013, 12:40:25 AM »
@trekiej:

Quote
I would like to bring more programmers to the Amiga. The ability to bring code from other platforms seems to be a must these days.


Doing proper ports takes much more effort but the result is much more pleasant for both users and developers. I prefer quality rather than quantity. Typing "make" and porting cli linux tools to produce hundreds of ported cli tools that use ixemul doesn't help to make our platform interesting. Imagine that Fab never did a proper OWB*MorphOS*port or that Chris never did a proper Netsurf OS4 port... even if we could run SDL versions I highly doubt it would appeal users much.

It's better to invest more time porting correctly libraries making 1 proper shared library than producing a handful of static libs. As an user it's simply better and as a coder it presents advantages:
-if a library has a bug you can fix it without recompiling&relinking your main app.
-allows using different compilers:*this library may only compile with GCC4.x but another one perhaps can be compiled with GCC2.95 as GCC3 generates buggy code in some situations. You could even create a library using AmigaE for example and call it from C and the opposite too.
-allows more collaboration (using static libs could produce problems: what do you use? ixemul, libnix, clib2...?)
-allows using native library versions if available even if your app is 68k only

For amiga "portability" there are SDI headers, these are used in various amiga projects and make easier making native versions.
The only spanish amiga news web page/club: Club de Usuarios de Amiga de Zaragoza (CUAZ)