init¶
MiniLibX: mlx_init
Creates the connection handle that the rest of malibx works through.
Returns¶
An Mlx object. It holds your windows and your loop hook,
and you pass it as the first argument to most other functions.
Notes¶
- Call it once at the start of your program. Each
Mlxis independent: itslooponly runs its own windows, so a second one is rarely useful. - Unlike
mlx_init, it never fails. Nothing talks to the windowing system until you callnew_window, so display errors show up there. - An
Mlxand its windows belong to the thread that created them, so use them only from that thread. Run malibx on your program's main thread: macOS requires windows to live there.
Example¶
See also¶
new_window ยท loop