https://github.com/colleagueriley/xdl
A single header file that dynamically loads the Xlib and GLX library. Written in/for ANSI C.
https://github.com/colleagueriley/xdl
ansi-c c c89 cpp dymanic header-only public-domain rsgl single-header x11 xlib
Last synced: 4 months ago
JSON representation
A single header file that dynamically loads the Xlib and GLX library. Written in/for ANSI C.
- Host: GitHub
- URL: https://github.com/colleagueriley/xdl
- Owner: ColleagueRiley
- License: other
- Created: 2023-04-16T18:00:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-26T14:13:56.000Z (5 months ago)
- Last Synced: 2025-05-26T15:30:37.062Z (5 months ago)
- Topics: ansi-c, c, c89, cpp, dymanic, header-only, public-domain, rsgl, single-header, x11, xlib
- Language: C
- Homepage:
- Size: 101 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XLib Dynamic Loader

A single header file that dynamically loads the Xlib and GLX library
# Use
First, define XDL_IMPLEMENTATION and include the library
```c
#define XDL_IMPLEMENTATION
#include "XDL.h"
```
Next, use XDL_init to load the X11 module
```c
XDL_init();
```
When you're done, make sure to close the module, this frees all the allocated data and stored functions
```c
XDL_close();
```
You can also define XDL_NO_GLX before including XDL if you don't want to include the GLX module
```c
#define XDL_NO_GLX
#define XDL_IMPLEMENTATION
#include "XDL.h"
```
# Credits
* [GLFW](https://github.com/GLFW/GLFW) Much of this implementation is based on GLFW's internal x11 dynamic loader
A great portion of the declarations for the X11 module are sourced from GLFW
* [stb](https://github.com/nothings/stb/) This project is heavily inspired by the stb single header files
# License
This project is public domain but credit would be greatly appreciated.