Skip to content

sky64redstone/window

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libwindow

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.


Usage

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_test

Supported Platforms

Currently supported platforms:

  • Linux (both X11 and Wayland)
  • Windows

Requirements

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.

Windows

Recommended setup:

  1. Install Visual Studio with the Desktop development with C++ workload https://visualstudio.microsoft.com/

  2. Install CMake https://cmake.org/download/

  3. Install Git https://git-scm.com/downloads

After installation you can build the project from a Developer Command Prompt or PowerShell.

Linux (Ubuntu / Debian)

Install the basic build tools:

sudo apt install build-essential cmake git

X11 Support

sudo apt install libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev

Wayland Support

sudo apt install libwayland-dev wayland-protocols libxkbcommon-dev

You only need the packages for the window system you intend to support.


Linux (Arch / Manjaro)

Install the basic build tools:

sudo pacman -S base-devel cmake git

X11 Support

sudo pacman -S libx11 libxrandr libxinerama libxcursor libxi

Wayland Support

sudo pacman -S wayland wayland-protocols libxkbcommon

You only need the packages for the window system you intend to support.


Installation

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 window

Compiling

Build the library with the following commands

mkdir build
cd build
cmake ..
make

Windows users: after running cmake .. you can open the project in Visual Studio, since CMake doesn't create Makefiles on Windows

Cross compiling on Linux

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

About

A library for window, input and OpenGL (windows & linux)

Topics

Resources

Stars

Watchers

Forks

Contributors