https://github.com/pegvin/miniwin
a mini cross-platform window creation library in c99
https://github.com/pegvin/miniwin
Last synced: 12 months ago
JSON representation
a mini cross-platform window creation library in c99
- Host: GitHub
- URL: https://github.com/pegvin/miniwin
- Owner: pegvin
- License: bsd-3-clause
- Created: 2024-03-06T16:44:12.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-10T09:25:36.000Z (about 2 years ago)
- Last Synced: 2025-05-18T13:49:47.847Z (about 1 year ago)
- Language: C
- Homepage:
- Size: 55.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MiniWin
a mini cross-platform window creation library in c99
[](#)
[](./LICENSE)
---
### Backends
- [x] X11
- [x] Win32
- [ ] Cocoa
### Compiling
compiling this library is easy enough, just put [miniwin.c](./src/miniwin.c) & [miniwin.h](./src/miniwin.h)
somewhere in your project and when compiling you can choose to specify what backend you want to use. The library
by default will check if `MWIN_BACKEND_*` is defined, if not it will use x11 if `__linux__` is defined or Win32
if `_WIN32`/`_WIN64` is defined.
| Backend | Definition | Linker Flags |
|---------|----------------------|--------------|
| Win32 | `MWIN_BACKEND_WIN32` | `-lgdi32` |
| X11 | `MWIN_BACKEND_X11` | `-lX11` |
### API
The API is pretty self-explanatory & can be found in [miniwin.h](./src/miniwin.h), except
the Pixel buffer you will be writing into will be allocated, resized & deallocated by the
library itself, you just have to write into the Pixel buffer and call `mwin_swap(...)`
to show the updated buffer onto the screen.
---
## Thanks