A minimalist(*) and platform-agnostic application layer for writing graphical applications.
A bare-bone application executable on Windows measures at around 13 KB(!)
Available as either a single header file or a directory of headers (a "unity build" setup).
Can be complied in either C or C++.
Examples of projects using this one are SlimEngine and SlimTracin.
The platform layer only uses operating-system headers (no standard library used).
The application layer itself has no dependencies whatsoever.
It is just a library that the platform layer uses - it has no knowledge of the platform.
More details on this architecture here.
The single header file variant includes everything.
Otherwise, specific headers can be included from the directory variant.
Only the entry point needs to be defined (see example below).
SlimApp comes with pre-configured CMake targets for all examples.
For manual builds on Windows, the typical system libraries need to be linked
(winmm.lib, gdi32.lib, shell32.lib, user32.lib) and the SUBSYSTEM needs to be set to WINDOWS
All examples were tested in all combinations of:
Source: Single header file (SlimApp.h), Directory of headers (specific includes)
Compiler: MSVC, MinGW, CLang
Language: C, C++
CPU Arch: x86, x64
SlimApp aims to provide only the absolute bare necessities needed for a windowed application.
For a more feature rich base for a 2D/3D graphical application, see: SlimEngine.
Well documented example applications cover the features:
- Bare-bone application (one-liner): Well-behaved window (can be resized minimized/maximized and closed)
- Overridable window defaults: Initial dimensions and title.
- Timers and window-title control:
- Drawable window content: Basic shape drawing (Lines, rectangles, triangles and circles)
- Text: String and number drawing:
- Mouse: Buttons (+wheel), cursor position/movement and 'raw' mouse input (captured outside the window).
- Keyboard: General key tracking + built-in tracking of control keys status (Ctrl, Alt, Shift, Space)
- Memory: Arena allocator can be used for heap memory, then bound to the global app instance.
- File: Opening/closing and reading/writing files in a platform-agnostic way (using os-specific API).
*All input capturing for mouse and keyboard is extendable through callbacks