https://github.com/ilkou/minilibx
A Guide to setup the MiniLibX library environment for Windows & Linux
https://github.com/ilkou/minilibx
1337 42 graphical-programming graphical-programs linux minilibx windows
Last synced: 5 months ago
JSON representation
A Guide to setup the MiniLibX library environment for Windows & Linux
- Host: GitHub
- URL: https://github.com/ilkou/minilibx
- Owner: ilkou
- Created: 2019-08-19T17:41:03.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-05T22:37:42.000Z (almost 2 years ago)
- Last Synced: 2024-08-15T04:01:46.727Z (9 months ago)
- Topics: 1337, 42, graphical-programming, graphical-programs, linux, minilibx, windows
- Language: C
- Homepage:
- Size: 16.6 KB
- Stars: 44
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [MiniLibX in Linux / Windows](https://github.com/ilkou/minilibx) · [](https://www.gnu.org/software/bash/) [](https://GitHub.com/ilkou/minilibx/graphs/commit-activity) [](https://ilkou.github.io) [](https://github.com/ilkou/minilibx/stargazers) [](https://github.com/ilkou/minilibx/graphs/contributors)
Minilibx is a very basic graphical library written in C used in 42
and in Epitech for infography project.## Steps :
### Update/upgrade your system:
* apt-get update
* apt-get upgrade### Install the following packages:
* apt install libx11-dev
* apt install libxext-dev
* apt install libbsd-dev
* apt install clang## Get minilibx sources:
```
git clone https://github.com/42Paris/minilibx-linux minilibx_linux
```#### Compile and install mlx.a in minilibx_linux with
* cd minilibx_linux; make && sudo ./configure
#### Change MLXFLAGS in your makefile to:
* MLXFLAG = -lmlx -lXext -lX11
## Notes for windows
```
* install ubuntu terminal (or other distribution linux ) on windows 10 from windows store* do the previous steps + you have to install gcc and make
```
### Graphical programsto run graphical programs on your windows 10 desktop
you need a GUI server, such as X11. Such doesn’t not exist for Windows,
but there are alternatives, one of which is Xming, which can be downloaded
free of charge, from [SourceForge](https://sourceforge.net/projects/xming/) (set private when ask)
then enable bash to use xming which can be done by typing the following line
```
echo "export DISPLAY=localhost:0.0" >> ~/.bashrc
```its preferable to launch xming automatically after boot, move xming program to the following repo:
* C:\Users\login\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
- after adding variables such DISPLAY, open a new bash session by typing
```
bash
```
or
```
source ~/.bashrc
```
### Extra notes:
* the process is explained using bash shell, you should modify it by whatever shell you are using (zsh, sh, ..)
* for events management, the mask should be (1L << 0) instead of 0
```
mlx_hook(p.win_ptr, 2, (1L << 0), ft_event_keys, &p);
```
* to simplify the usage of keys macros in mac os and linux, include key_macos.h and key_linux.h files:
```
# if defined(__APPLE__)
# include
# else
# include
# endif
```### Docker image
based on alpine: `ilkou/minilibx` or `ilkou/minilibx:1.0.0`
based on ubuntu: `ilkou/minilibx:ubuntu`