libwindow is a lightweight library for creating and managing cross-platform windows in C++. It provides a simple interface for opening, controlling, and interacting with windows while keeping dependencies minimal.
The project is designed as a small utility library and can serve as a starting point for building window-based tools, graphical experiments, or platform abstraction layers.
A minimal usage example can be found in:
test/main.cpp
After building the project, the example program will be compiled automatically.
Run it with:
cd build
./window_testCurrently supported platforms:
- Linux (both X11 and Wayland)
- Windows
To build libwindow, you need a C++ compiler, CMake, and a build tool. On Linux you will also need development libraries depending on whether you use X11 or Wayland. Alternatively, you could install the necessary libraries for both window servers, and this library would automatically select the appropriate server at runtime.
- A C/C++ compiler (e.g. GCC or Clang)
- CMake
- Git
Warning
The external links and package names below are provided for convenience only, and I do not guarantee their validity, safety, or that they are free of malware, so you should verify downloads and sources yourself before installing any software.
Recommended setup:
-
Install Visual Studio with the Desktop development with C++ workload https://visualstudio.microsoft.com/
-
Install CMake https://cmake.org/download/
-
Install Git https://git-scm.com/downloads
After installation you can build the project from a Developer Command Prompt or PowerShell.
Install the basic build tools:
sudo apt install build-essential cmake gitsudo apt install libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-devsudo apt install libwayland-dev wayland-protocols libxkbcommon-devYou only need the packages for the window system you intend to support.
Install the basic build tools:
sudo pacman -S base-devel cmake gitsudo pacman -S libx11 libxrandr libxinerama libxcursor libxisudo pacman -S wayland wayland-protocols libxkbcommonYou only need the packages for the window system you intend to support.
Make sure you have installed make, cmake and a compiler that is supported by cmake
Clone the repository:
git clone https://github.com/sky64redstone/window.git
cd windowBuild the library with the following commands
mkdir build
cd build
cmake ..
makeWindows users: after running
cmake ..you can open the project in Visual Studio, since CMake doesn't create Makefiles on Windows
This project supports cross-compiling to Windows. It uses mingw-w64 to compile and wine to test the generated executable.
# Just compile it
bash cross-compile.sh
# Compile and run it with wine
bash cross-compile.sh run