Skip to content

Commit 497879a

Browse files
authored
Merge pull request #1 from 27network/feature/better-readme
Improve project's README.
2 parents 11073a2 + 5b43b47 commit 497879a

File tree

4 files changed

+64
-36
lines changed

4 files changed

+64
-36
lines changed

.github/workflows/linux_clang.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux build(clang)
1+
name: Linux (clang)
22

33
on:
44
pull_request:

.github/workflows/linux_gcc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linux build(gcc)
1+
name: Linux (gcc)
22

33
on:
44
pull_request:

.github/workflows/macos_x86.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: MacOS build
1+
name: macOS
22

33
on:
44
pull_request:

README.md

Lines changed: 61 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,80 @@
1-
# MacroLibX
1+
# MacroLibX [![linux clang workflow][linux-clang_badge]][linux-clang_wf] [![linux gcc workflow][linux-gcc_badge]][linux-gcc_wf] [![macos workflow][macos_badge]][macos_wf]
2+
###### A rewrite of 42 School's MiniLibX using SDL2 and Vulkan.
23

3-
[![linux clang workflow](https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml/badge.svg)](https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml)
4-
[![linux gcc workflow](https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_gcc.yml/badge.svg)](https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_gcc.yml)
5-
[![macos workflow](https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml/badge.svg)](https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml)
4+
The goal of this version is to provide a light, fast, and modern graphical tool while keeping the same API.
65

7-
A rewrite of School 42's MiniLibX using SDL2 and Vulkan. The goal of this version is to give a light, fast and modern graphical tool while keeping the same API as the version currently used at 42.
6+
## 🖥️ Installation
87

9-
# Installation
8+
### Dependencies
109

11-
## Linux
12-
Dependances :
10+
You first need to install the proper dependencies for your operating-system.
1311

14-
For Ubuntu/Debian
15-
```bash
16-
~ sudo apt update
17-
~ sudo apt install libsdl2-2.0-0 libsdl2-dev build-essential
12+
#### 🐧 Linux
13+
14+
Here are a few common cases for different Linux distributions:
15+
16+
<details>
17+
<summary>
18+
For <a href="https://ubuntu.com">Ubuntu</a>/<a href="https://debian.org">Debian</a>-based distros:
19+
</summary>
20+
<pre><code><!--
21+
-->sudo apt update
22+
sudo apt install libsdl2-2.0-0 libsdl2-dev build-essential
23+
</code></pre>
24+
</details>
25+
26+
<details>
27+
<summary>
28+
For <a href="https://archlinux.org">ArchLinux</a>-based distros:
29+
</summary>
30+
<pre><code>sudo pacman -S sdl2</code></pre>
31+
</details>
32+
33+
#### 🍎 macOS
34+
35+
[MacroLibX](#) on macOS requires [SDL2](#) and [MoltenVK](https://github.com/KhronosGroup/MoltenVK). You can install both using the [Homebrew](https://brew.sh) package manager:
36+
```sh
37+
brew install molten-vk
38+
brew install SDL2
1839
```
1940

20-
For Arch based distros
41+
### Clone and Build
42+
43+
Finally, you can clone the Git repository. When inside it, run the GNU `make` command to compile MacroLibX.
2144
```bash
22-
~ sudo pacman -S sdl2
45+
git clone https://github.com/420verfl0w/MacroLibX.git
46+
cd MacroLibX
47+
make
2348
```
2449

25-
### MacOS
26-
Dependances :
27-
* [MoltenVK](https://github.com/KhronosGroup/MoltenVK/)
28-
* SDL2 `brew install SDL2`
50+
## 🔨 Compile your project
2951

30-
# Get MacroLibX
52+
To compile your project with MacroLibX, you just provide the shared library path in your compilation/linking command:
3153

32-
```bash
33-
~ git clone https://github.com/420verfl0w/MacroLibX.git
34-
~ cd MacroLibX
35-
~ make
54+
```sh
55+
clang myApp.c /path/to/MacroLibX/libmlx.so -lSDL2
3656
```
3757

38-
# Compile your project
58+
### ⚠️ Troubleshooting
3959

40-
```bash
41-
clang myApp.c MacroLibX/libmlx.so -lSDL2
60+
#### If you run into glitches when writing or reading pixels from images
61+
62+
You need to add `IMAGES_OPTIMIZED=false` to your `make` command:
63+
64+
```sh
65+
# In your cloned environment, inside the MacroLibX folder
66+
make IMAGES_OPTIMIZED=false
4267
```
4368

44-
## /!\ If you run into glitches when writing or reading pixels from images /!\
69+
## License
4570

46-
You need to add `IMAGES_OPTIMIZED=false` to your make mlx command
71+
This project and all its files, except the [`third_party`](./third_party) directory or unless otherwise mentionned, are licenced under the [GNU GPL v2.0](./LICENSE).
4772

48-
```bash
49-
~ git clone https://github.com/420verfl0w/MacroLibX.git
50-
~ cd MacroLibX
51-
~ make IMAGES_OPTIMIZED=false
52-
```
73+
<!-- Links -->
74+
75+
[linux-clang_badge]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml/badge.svg
76+
[linux-gcc_badge]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_gcc.yml/badge.svg
77+
[macos_badge]: https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml/badge.svg
78+
[linux-clang_wf]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml
79+
[linux-gcc_wf]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_gcc.yml
80+
[macos_wf]: https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml

0 commit comments

Comments
 (0)