Porting my Raylib + Dear ImGui Template to AmigaOS 4

I’ve just reworked my Raylib + Dear ImGUI template to compile out-of-the-box on AmigaOS 4.1. My goal is to be able to write software for AmigaOS 4, while still be able to earn a living of that software. The Amiga market is too small, so writing multi-platform software that also runs on AmigaOS 4 is how this becomes possible.

My chosen multi-platform framework is: Raylib + Dear ImGUI. Raylib is an easy to use cross-platform game/multi-media library, which is great for multimedia rich applications. Dear ImGUI is an immediate-mode GUI library. You can make highly responsive GUIs with it.

First though, we have to get these two libraries running on AmigaOS. Watch the video above to see how I did it…

The Steps in Brief

set(rlimgui_SOURCE_DIR "ThirdParty/rlimgui")
  • Do the same with imgui. Download Dear ImGui from the same location that cmake/imgui.cmake (direct link), and repace the FetchContent code with:
    set(imgui_SOURCE_DIR "ThirdParty/imgui")
  • You also need to disable ImGui’s default shell functions to avoid the use of fork() (or write an AmigaOS replacement):
target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS=1)
  • Make sure that the main CMakeLists.txt links to raylib and all of its dependencies:
if(AMIGAOS4)
	target_link_libraries(${PROJECT_NAME} raylib glfw3 GL Threads::Threads)
endif()
  • Replace the little-endian fontawesome data with the fixed version (from this pull request)
  • Create a file called AmigaImconfig.h:
/** AmigaImconfig.h
 *
 * Configuration of Dear ImGUI for AmigaOS
 */

#define IM_COL32_R_SHIFT    24
#define IM_COL32_G_SHIFT    16
#define IM_COL32_B_SHIFT    8
#define IM_COL32_A_SHIFT    0
#define IM_COL32_A_MASK     0x0000FF
  • Add a compiler definition (in cmake/imgui.cmake) to tell Dear ImGui to use our AmigaImconfig.h instead of imconfig.h:
if(AMIGAOS4)
    target_compile_definitions(imgui PUBLIC IMGUI_USER_CONFIG="../../AmigaImconfig.h")
endif()

With these steps done, you have a Raylib + Dear ImGui template that works on AmigaOS (and all other major platforms).

Download the Template

Want to skip the steps above? My Raylib + Dear ImGui template is available in the Kea Campus’ Amiga Corner for Creator & higher tier members.

Click here to join, and download the template (plus get access to lots more).

Leave a Comment

Your email address will not be published. Required fields are marked *

 


Shopping Cart
Scroll to Top