C++ cross-platform library that provides a platform-agnostic access to low-level systems, such as windowing and input.
  • C++ 76.7%
  • CMake 21.1%
  • Shell 1.8%
  • Dockerfile 0.4%
Find a file
Arnor Nolen d414558517
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
chore: Fix warnings coming from clang-tidy 23. (#44)
Fix warnings that started to appear after upgrading to clang-tidy 23. Fix macro usage warnings for Windows builds.

Reviewed-on: #44
2026-11-19 19:32:48 +00:00
.woodpecker fix: Add compatibility with libcxx. (#22) 2026-06-04 23:18:48 +00:00
cmake build: Fix several issues with CMut. (#40) 2026-10-08 20:53:34 +00:00
examples build: Target-based CMut implementation. (#30) 2026-06-30 14:15:56 +00:00
include chore: Fix warnings coming from clang-tidy 23. (#44) 2026-11-19 19:32:48 +00:00
infra fix: Add compatibility with libcxx. (#22) 2026-06-04 23:18:48 +00:00
src fix: Don't use rvalues in nolib::Handle. (#42) 2026-10-13 19:42:50 +00:00
tests build: Target-based CMut implementation. (#30) 2026-06-30 14:15:56 +00:00
thirdparty/wayland-protocols chore: Change project folders to use more widely accepted structure. (#7) 2026-03-16 14:31:54 +00:00
.clang-format chore: Stop using trailing return types. (#13) 2026-04-27 13:04:53 +00:00
.clang-tidy chore: Fix warnings coming from clang-tidy 23. (#44) 2026-11-19 19:32:48 +00:00
.clangd fix: Use umbrella header for win32 includes. (#16) 2026-05-27 18:42:01 +00:00
.gersemirc misc: Provide CMake utility function definitions to gersemi. (#32) 2026-09-14 18:07:24 +00:00
.gitignore chore(misc): Add clangd cache and CLion directory to .gitignore. 2025-12-17 15:26:58 +02:00
CMakeLists.txt build: Fix several issues with CMut. (#40) 2026-10-08 20:53:34 +00:00
LICENSE chore(misc): Update the license year. 2025-12-10 23:09:41 +02:00
README.md misc: Update README. (#43) 2026-11-11 21:52:43 +00:00
suppressions.txt Add reset function. 2025-03-30 21:44:33 +03:00

NDL (Nolen's DirectMedia Library)

C++ cross-platform library that provides a platform-agnostic access to low-level systems, such as windowing and input.

At the moment, the goal of the library is to provide a pixel buffer for a window that the software renderer can render into, and to support interactivity by processing the input.

GPU-accelerated rendering using Vulkan may be added in the future. Vulkan support should be sufficient to cover all GPU-accelerated needs, so there are no plans to provide GPU-accelerated rendering using OpenGL, DirectX or Metal.

Features:

  • Supports creating and managing multiple windows;
  • Provides input events per each window;
  • Proper scaling support for each platform.

Currently supported platforms:

  • Wayland;
  • Windows.

Dependencies

This library makes use of native platform APIs and has NO dependencies. The only exception is system libraries/tools (e.g. libwayland and wayland-scanner on Wayland).

Getting started

The easiest way to get started is to read the example code, which you can find here. Each example is provided as a single, self-sufficient source file, which should make it easy to digest.

Integrating library in your project

The library aims to be consumed like a regular C++ static/shared library.

For CMake users it's even easier, as the library can be consumed via standard CMake mechanisms: find_package(), add_subdirectory() and FetchContent.

Here's an example of how to consume it via FetchContent:

# ...
include(FetchContent)
FetchContent_Declare(
    ndl
    GIT_REPOSITORY https://code.arnor.dev/arnor-nolen/ndl.git
    GIT_TAG        <release_tag_or_commit>
    FIND_PACKAGE_ARGS
)
FetchContent_MakeAvailable(ndl)

find_package(ndl REQUIRED)

add_executable(main)
# ...
target_link_libraries(
    main
    PRIVATE
        ndl::ndl
        ndl::nolib
)

Building

Use the usual cmake workflow to build the project.

With multi-config generators (e.g. MSVC):

cmake . -Bbuild
cmake --build build --config Release -j0

With single-config generators (e.g. Make/Ninja):

cmake . -Bbuild/Release -DCMAKE_BUILD_TYPE=Release
cmake --build build/Release -j0

Testing

To run tests, use ctest after building:

# Adjust according to build directory.
ctest --test-dir=build/Release --output-on-failure --schedule-random -j0

Packaging

To create a package, use cpack after building:

# Adjust according to build directory.
cpack --config build/Release/CPackConfig.cmake

Installing

To install the library on your system, use cmake --install after building:

cmake --install build/Release