- C++ 76.7%
- CMake 21.1%
- Shell 1.8%
- Dockerfile 0.4%
|
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
Fix warnings that started to appear after upgrading to clang-tidy 23. Fix macro usage warnings for Windows builds. Reviewed-on: #44 |
||
|---|---|---|
| .woodpecker | ||
| cmake | ||
| examples | ||
| include | ||
| infra | ||
| src | ||
| tests | ||
| thirdparty/wayland-protocols | ||
| .clang-format | ||
| .clang-tidy | ||
| .clangd | ||
| .gersemirc | ||
| .gitignore | ||
| CMakeLists.txt | ||
| LICENSE | ||
| README.md | ||
| suppressions.txt | ||
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