C++ tutorial for Amiga coding?

7 posts / 0 new
Last post
billt
billt's picture
Offline
Last seen: 1 year 6 months ago
Joined: 2011-02-04 18:54
C++ tutorial for Amiga coding?

I'm interested in learning C++, and would like to know if there are tutorials for doing Amiga-specific coding with C++. I'm not sure if there is anything special to doing AmigaOS function calls, opening and using Amiga libraries, etc. from within constructors or destructors, or otherwise doing C-ish Amiga stuff within C++ and its way of doing OO coding.

Massi
Massi's picture
Offline
Last seen: 3 years 11 months ago
Joined: 2012-03-28 17:16
@billt http://www.solie.ca/a

@billt

http://www.solie.ca/articles/map/proglang/proglang.html

Welcome and have a look at what current OS4 leader of development says.

Hans
Hans's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 2010-12-09 22:04
@billt I don't remember

@billt

I don't remember seeing any Amiga-specific C++ tutorials. However, C++ is perfectly usable within certain limits. At the moment we don't have support for the C++ 2011 standard or newer (need a compiler update and updated std-lib). IIRC, exceptions work properly in single-threaded environments only.

Also, while you probably could use C++ internally in a shared library, the library's API must be plain C, and I'm not sure if exceptions could be used or not (what would happen if an exception was thrown and not caught within the library?).

I do hope that we can get C++ 2011 and newer at some point. More and more open-source projects use it, and the standardised threading model is very useful (amongst other things).

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project.
http://keasigmadelta.co.nz/ - more of my software.

Massi
Massi's picture
Offline
Last seen: 3 years 11 months ago
Joined: 2012-03-28 17:16
@billt http://os4depot.net/i

@billt

http://os4depot.net/index.php?function=showfile&file=game/board/stockfish-5.lha

I recently built Stockfish 5 chess engine for OS4, see web link above, which is entirely written in (non Amiga-specific) C++.

From OS4 perspective I got the feeling that the OOP "fundamentals" of the language are well supported, while the "newer" (and sometimes "exotic") features may not be available in a short time.

Depending on what you want to achieve, I suggest a bit of research and experimenting to understand the limits and constraints.

billt
billt's picture
Offline
Last seen: 1 year 6 months ago
Joined: 2011-02-04 18:54
Thanks all, I'll read up on

Thanks all,

I'll read up on patterns and check into some code examples out there.

I'm curious, what all would need to happen to bring us up to modern/current C++? Is that merely a new version of g++? Or is that also an update to standard C++ libraries ported to AmigaOS? Or is that also enhancements to AmigaOS itself (such as for C++ threading?)

While I wouldn't expect to need anything fancy as I come up to speed on the basics, I am curious about the effort and pieces required for the fancier stuff, as I do not know at what point I might bang my head into those limitations.

Hans
Hans's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 2010-12-09 22:04
@billt I'm curious, what all

@billt

I'm curious, what all would need to happen to bring us up to modern/current C++? Is that merely a new version of g++? Or is that also an update to standard C++ libraries ported to AmigaOS? Or is that also enhancements to AmigaOS itself (such as for C++ threading?)

I could be wrong, but I think that we need an updated G++ and updated standard C++ libraries.

I'd love to be able to use C++11 on AmigaOS, because the new features such as the threading model are very useful.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project.
http://keasigmadelta.co.nz/ - more of my software.

broadblues
broadblues's picture
Offline
Last seen: 4 years 2 months ago
Joined: 2012-05-02 21:48
If you'd like an example of

If you'd like an example of some amigaish C++ coding take a look at the blender src on os4depot.

Specifically the ghost GUI / system subsystem.

once unpacked find it here

blender-src/intern/ghost/intern/GHOST_WindowOS4.cpp

and other related related files ending in OS4.cpp

You'll see you can mix C++ and AmigaOS C fairly easily, and under OS4 you can take advatantage of interfaces to store local versions in classes as needed.

[edit] fixed lousey grammer

Log in or register to post comments