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
- Use the Raylib on AmigaOS 4 template from here as a starting point.
- Merge the Raylib + Dear ImGui template (link) into the project. Take extra care with the CMakeLists.txt file, because you need to preserve all the AmigaOS 4 specific script code.
- Download rlImgui from the same location as FetchContent does (see cmake/rlImgui.cmake in the template), and dearchive into ThirdParty/rlimgui. Here’s a direct link: https://github.com/raylib-extras/rlImGui/archive/c87062ac11a1ed1145f075f022470ae77a03c734.tar.gz
- Now replace the FetchContent code in cmake/rlimgui.cmake with the following:
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).