https://github.com/tsherif/xogl
Minimal OpenGL loader for X11.
https://github.com/tsherif/xogl
3d linux opengl
Last synced: about 1 year ago
JSON representation
Minimal OpenGL loader for X11.
- Host: GitHub
- URL: https://github.com/tsherif/xogl
- Owner: tsherif
- License: mit
- Created: 2017-12-26T15:06:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-03T13:51:04.000Z (over 8 years ago)
- Last Synced: 2025-03-24T08:55:11.219Z (over 1 year ago)
- Topics: 3d, linux, opengl
- Language: C
- Homepage:
- Size: 431 KB
- Stars: 23
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
XOGL
====
Minimal OpenGL loader for X11.
XOGL consists of three functions:
- `xogl_init()`: Initialize an OpenGL context and load OpenGL functions.
- `xogl_swapBuffers()`: Swap front and backbuffers. Use after finished drawing.
- `xogl_destroy()`: Destroy the OpenGL context.
Basic usage:
```C
Display* disp = XOpenDisplay(NULL);
Window win = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 20, 20, 1024, 1024, 0, 0, 0);
XMapWindow(disp, win);
// Attempt to initialize an OpenGL 4.5 context
if (xogl_init(disp, win, 4, 5)) {
fprintf(stderr, "Unable initialize OpenGL!\n");
return 1;
}
// OpenGL function calls
while(1) {
if (!running) {
break;
}
// OpenGL function calls
xogl_swapBuffers();
}
xogl_destroy();
```