Haiku API examples

I’m looking to learn the Haiku API.

Are there any good pointers to some code examples available illustrating each kit ?

Below is what I have found so far which is not not satisfactory to me :

  • BeBook : should be able to describe the API but not to give examples
  • HaikuBook : same as BeBook with missing API part (I’ve been able to have a draft working example of BJoystick via BeBook/Haiku + HaikuPorts “unreal_speccy_portable” + ChatGPT)
  • BeSampleCode : but some examples might not work for Haiku (GitHub - HaikuArchives/BeSampleCode: Original BeOS developer sample code for learning the BeOS / Haiku API.)
  • haiku/src/tests : more tests oriented I think than explaining the API through examples
  • haiku sources or haikuports : good source of information, however it requires to search what is the good piece of code through all the lines of sources which is not always easy

Additional note : I plan to propose a repo with some basic examples on each kit, but I’m starting from scratch here, so I will rely mostly on the BeBook/HaikuBook to be sure there’s no mistake

2 Likes

There is the published book (https://www.haiku-os.org/legacy-docs/programming_the_be_operating_system.pdf) its a bit dated and you need to skip the Metrowerks IDE sections.

DarkWyrm also publisged a more modern set of tutorials (https://www.hai ku-os.org/blog/darkwyrm

Haiku newsletters: (OpenBeOS Project - Newsletter Archive)

Finally, the old BeInc newsletters have a ton of information about how the backend worked. (Be Newsletters)

More programming books about Haiku: GitHub - theclue/programming-with-haiku: Learning to program with Haiku and Programming with Haiku books

Some API examples meant to eventually replace/complement the old Be ones, but definitely deserves some updates: GitHub - drcouzelis/HaikuApiExamples: Small and simple applications that show how to do various things with the Haiku API, for education or writing new software for the Haiku OS

2 Likes