A simple RPN Calculator, demonstrating how easy it can be to create a truly multi-platform application with Dear ImGui, and Hello ImGui.
Works under Windows, Linux, macOS, emscripten, iOS (as a native app, or as a Web Clip), Android
Note: This step is optional, since the CMakeLists.txt file will be default download and build hello_imgui at configure time.
In this example, we clone hello_imgui inside external/hello_imgui
.
Note: external/
is mentioned in .gitignore
mkdir -p external && cd external
git clone https://github.com/pthom/hello_imgui.git
cd ..
Add this line at the top of your CMakeLists.txt
add_subdirectory(external/hello_imgui)
mkdir build && cd build
cmake ..
make -j 4
Follow step 1 from the Linux/macOS section above.
mkdir build && cd build
cmake ..
It should be located in build/rpn_calculator.sln
You will need to clone hello_imgui. In this example, we clone hello_imgui inside hello_imgui_template/external/hello_imgui
Note: external/ is mentioned in .gitignore
mkdir -p external && cd external
git clone https://github.com/pthom/hello_imgui.git
cd ..
Add this line at the top of your CMakeLists.txt
add_subdirectory(external/hello_imgui)
mkdir build_android && cd build_android
../external/hello_imgui/tools/android/cmake_arm-android.sh ../
It should be located in build_android/rpn_calculator_AndroidStudio.
mkdir -p external && cd external
git clone https://github.com/pthom/hello_imgui.git
cd ..
mkdir build_ios && cd build_ios
Run CMake with the following command, where you replace XXXXXXXXX with your Apple Developer Team ID, and com.your_website with your website (e.g. com.mycompany).
cmake .. \
-GXcode \
-DCMAKE_TOOLCHAIN_FILE=../external/hello_imgui/hello_imgui_cmake/ios-cmake/ios.toolchain.cmake \
-DPLATFORM=OS64COMBINED \
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=XXXXXXXXX \
-DHELLO_IMGUI_BUNDLE_IDENTIFIER_URL_PART=com.your_website \
-DHELLOIMGUI_USE_SDL_OPENGL3=ON
mkdir build_ems && cd build_ems/
source ~/emsdk/emsdk_env.sh # Activate emscripten (see https://emscripten.org/docs/getting_started/downloads.html)
emcmake cmake ..
make -j
Then, run a web-server, e.g.
python3 -m http.server # and then browse to http://localhost:8000