- A minimal cross-platform example using raylib demonstrating a resizable window, simple input handling (keyboard, mouse, touch), and basic rendering.
- Resizable window: The app uses a resizable window and reports current screen size.
- Input: Move the circle with arrow keys, mouse, or touch input.
- Status overlay: Shows FPS and current screen resolution.
- CMake 3.24 or newer
- A C/C++ compiler supporting C++17 (MSVC, clang, gcc)
- raylib library installed and findable by CMake
- Create a build directory and run CMake:
mkdir build && cd build
cmake ..
cmake --build . --config Release- The produced executable name is controlled by
EXE_NAMEin CMakeLists.txt.
Platform notes:
- Windows: Use Visual Studio generator or pass
-G "Ninja"if you prefer Ninja. - macOS: You can build with Xcode or a Unix-style generator; the CMake file has basic Apple bundle settings for iOS/macOS.
- Linux: Ensure
Threadsand common system libraries are available; the CMake script linksmanddlwhere needed.
- Run the generated executable from the build output. Example on Unix-like systems:
./MyRaylibApp- Arrow keys: move the circle
- Mouse / touch: click or touch to move the circle to pointer position
- Esc or close window: exit
src/main.cpp— main application sourceCMakeLists.txt— build configurationLICENSE— project license
- Pre-built raylib library
- raylib 6.0, MSVC 2022 : raylib.zip
See the LICENSE file at the repository root.