![]() |
RGFW
A multi-platform single-header very simple-to-use framework library for creating GUI Libraries or simple GUI programs.
|
A cross-platform lightweight single-header very simple-to-use window abstraction library for creating graphics Libraries or simple graphical programs. Written in pure C99.
RGFW is a free multi-platform single-header very simple-to-use window abstraction framework for creating graphics Libraries or simple graphical programs. It is meant to be used as a very small and flexible alternative library to GLFW.
The window backend supports XLib (UNIX), Cocoas (MacOS), wasm (emscripten) and WinAPI (tested on windows XP, 10 and 11, and reactOS)\ Windows 95 & 98 have also been tested with RGFW, although results are iffy
Wayland: to compile wayland add (RGFW_WAYLAND=1). Wayland support is very experimental and broken.
The graphics backend supports OpenGL (EGL, software, OSMesa, GLES), Vulkan, DirectX, Metal and software rendering buffers.
RGFW was designed as a backend for RSGL, but it can be used standalone or for other libraries, such as Raylib which uses it as an optional alternative backend.
RGFW is multi-paradigm,\ By default RGFW uses a flexible event system, similar to that of SDL, however you can use callbacks if you prefer that method.
This library
1) is single header and portable (written in C99 in mind) 2) is very small compared to other libraries 3) only depends on system API libraries, Winapi, X11, Cocoa 4) lets you create a window with a graphics context (OpenGL, Vulkan or DirectX) and manage the window and its events only with a few function calls 5) is customizable, you enable or disable features
This library does not
1) Handle any rendering for you (other than creating your graphics context) 2) do anything above the bare minimum in terms of functionality
XDL can be used to dynamically link X11 functions to RGFW using dl
. It allows X11 functions to loaded at runtime.
To enable RGFW's use of XDL, add this line to your code:
This only applies to Windows, macOS and X11 (with XDL.h
):
By default, OpenGL does not need to be explicitly linked unless you are directly using OpenGL functions in your code. If you rely on a OpenGL loader library, you don't need to explicitly link OpenGL at all!
The examples/gl33/gl33 example demonstrates using OpenGL without explicitly linking it.
You can find more examples [here](examples) or run it in your browser with emscripten
A list of GUI libraries that can be used with RGFW can be found on the RGFW wiki here
There is a lot of in-header-documentation, but more documentation can be found at https://colleagueriley.github.io/RGFW/docs/index.html If you wish to build the documentation yourself, there is also a Doxygen file attached.
A list of bindings can be found on the RGFW wiki here
A list of projects that use RGFW can be found on the RGFW wiki here
There is a RGFW wiki page about things you can do if you want to support the development of RGFW here.
A comparison of RGFW and GLFW can be found at on the wiki
RGFW uses the Zlib/libPNG license, this means you can use RGFW freely as long as you do not claim you wrote this software, mark altered versions as such and keep the license included with the header.