Skip to content

Latest commit

 

History

History
87 lines (76 loc) · 4.12 KB

README.md

File metadata and controls

87 lines (76 loc) · 4.12 KB

SlimApp_logo

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.

Architecture:

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.

Usage:

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

Features:

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)

    1_app 1_app_code

  • Overridable window defaults: Initial dimensions and title.

    2_defaults 2_defaults_code

  • Timers and window-title control:

    3_time 3_time_code

  • Drawable window content: Basic shape drawing (Lines, rectangles, triangles and circles)

    4_shapes 4_shapes_code

  • Text: String and number drawing:

    5_text 5_text_code

  • Mouse: Buttons (+wheel), cursor position/movement and 'raw' mouse input (captured outside the window).

    6_mouse 6_mouse_code

  • Keyboard: General key tracking + built-in tracking of control keys status (Ctrl, Alt, Shift, Space)

    7_keyboard 7_keyboard_code

  • Memory: Arena allocator can be used for heap memory, then bound to the global app instance.

    8_memory 8_memory_code

  • File: Opening/closing and reading/writing files in a platform-agnostic way (using os-specific API).

    9_files 9_files_code

*All input capturing for mouse and keyboard is extendable through callbacks