window-c is a lightweight c port of the libwindow library for creating and managing cross-platform windows.
A minimal usage example can be found in:
test/main.c
After building the project, the example program will be compiled automatically.
Run it with:
cd build
./window_c_testFor API details, refer to the headers:
include/window_c.h
include/window_input_c.h
Currently supported platforms:
- Linux (both X11 and Wayland)
- Windows
To build window-c, 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-c.git
cd window-cBuild the library with the following commands
Windows users: after running
cmake ..you can open the project in Visual Studio, since CMake doesn't create Makefiles on Windows
mkdir build
cd build
cmake ..
make