Noob question

Hello,

I know that SDL is written in C, but works with C++ natively, and has
bindings to several other languages…

and supports Linux, Windows, … Mac OS X, … and AmigaOS, Dreamcast,
Atari, … not officially.

and IPhone, NDS, (PS3?) too in 1.3 (officially?)

But my question is, for the best compatibility with all that (especially
with IPhone, NDS and others videogames, in order), what is the preferred
language, C or C++?

I mean, if I use C++ (classes, inheritance, encapsulation… etc) will the
code be still portable to all that? Or should I use C (typedef struct, no
bool type, etc…) besides the fact that I will loose some productivity?

Thank you all.__
\//-

As long as your language is supported on the platforms that you want
to use it on (i.e. has a compiler that targets that platform), then
you are free to use whatever you like. Platforms without a C++
compiler are pretty rare nowadays.

Jonny DOn Wed, Sep 9, 2009 at 10:37 AM, Cleber Tavares Jr. wrote:

Hello,

I know that SDL is written in C, but works with C++ natively, and has
bindings to several other languages…

and supports Linux, Windows, … Mac OS X, … and AmigaOS, Dreamcast,
Atari, … not officially.

and IPhone, NDS, (PS3?) too in 1.3 (officially?)

But my question is, for the best compatibility with all that (especially
with IPhone, NDS and others videogames, in order), what is the preferred
language, C or C++?

I mean, if I use C++ (classes, inheritance, encapsulation… etc) will the
code be still portable to all that? Or should I use C (typedef struct, no
bool type, etc…) besides the fact that I will loose some productivity?

Thank you all.

__
\//-


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

But you still be aware that not all C++ compilers are made alike.

If you program in what is consider nowadays good C++, by making use of STL,
exceptions,
and other high level libraries and only go low level when you really need
to, you might still
face some issues.

For example not all C++ compilers are providing the same support level, or
proper implementation
for Exceptions or RTTI. Just to name two areas where you can find problems.

One way to avoid this is to try to make use of the same compiler on all
platforms that you are
targeting, but this is not always possible.

Oh and avoid some fancy C++ like exports or exception declarations.On Wed, Sep 9, 2009 at 4:46 PM, Jonathan Dearborn wrote:

As long as your language is supported on the platforms that you want
to use it on (i.e. has a compiler that targets that platform), then
you are free to use whatever you like. Platforms without a C++
compiler are pretty rare nowadays.

Jonny D

On Wed, Sep 9, 2009 at 10:37 AM, Cleber Tavares Jr. wrote:

Hello,

I know that SDL is written in C, but works with C++ natively, and has
bindings to several other languages…

and supports Linux, Windows, … Mac OS X, … and AmigaOS, Dreamcast,
Atari, … not officially.

and IPhone, NDS, (PS3?) too in 1.3 (officially?)

But my question is, for the best compatibility with all that (especially
with IPhone, NDS and others videogames, in order), what is the preferred
language, C or C++?

I mean, if I use C++ (classes, inheritance, encapsulation… etc) will
the
code be still portable to all that? Or should I use C (typedef struct, no
bool type, etc…) besides the fact that I will loose some productivity?

Thank you all.

__
\//-


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org