An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# MiniWin
a mini cross-platform window creation library in c99

[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/pegvin/miniwin/ci.yml)](#)
[![GitHub License](https://img.shields.io/github/license/pegvin/miniwin)](./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