Rework README.md and add better formatting and form

This commit is contained in:
killian
2023-10-30 01:26:35 +01:00
committed by GitHub
parent 0134e4e55d
commit 9dfd3ab971

View File

@@ -1,52 +1,80 @@
# MacroLibX
# 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]
###### A rewrite of 42 School's MiniLibX using SDL2 and Vulkan.
[![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)
[![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)
[![macos workflow](https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml/badge.svg)](https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml)
The goal of this version is to provide a light, fast, and modern graphical tool while keeping the same API the same.
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.
## 🖥️ Installation
# Installation
### Dependencies
## Linux
Dependances :
You first need to install the proper dependencies for your operating-system.
For Ubuntu/Debian
```bash
~ sudo apt update
~ sudo apt install libsdl2-2.0-0 libsdl2-dev build-essential
#### 🐧 Linux
Here are a few common cases for different Linux distributions:
<details>
<summary>
For <a href="https://ubuntu.com">Ubuntu</a>/<a href="https://debian.org">Debian</a>-based distros:
</summary>
<pre><code><!--
-->sudo apt update
sudo apt install libsdl2-2.0-0 libsdl2-dev build-essential
</code></pre>
</details>
<details>
<summary>
For <a href="https://archlinux.org">ArchLinux</a>-based distros:
</summary>
<pre><code>sudo pacman -S sdl2</code></pre>
</details>
#### 🍎 macOS
[MacroLibX](#) on macOS requires [SDL2](#) and [MoltenVK](https://github.com/KhronosGroup/MoltenVK). You can install both using the [Homebrew](https://brew.sh) package manager:
```sh
brew install molten-vk
brew install SDL2
```
For Arch based distros
### Clone and Build
Finally, you can clone the Git repository. When inside it, run the GNU `make` command to compile MacroLibX.
```bash
~ sudo pacman -S sdl2
git clone https://github.com/420verfl0w/MacroLibX.git
cd MacroLibX
make
```
### MacOS
Dependances :
* [MoltenVK](https://github.com/KhronosGroup/MoltenVK/)
* SDL2 `brew install SDL2`
## 🔨 Compile your project
# Get MacroLibX
To compile your project with MacroLibX, you just provide the shared library path in your compilation/linking command:
```bash
~ git clone https://github.com/420verfl0w/MacroLibX.git
~ cd MacroLibX
~ make
```sh
clang myApp.c /path/to/MacroLibX/libmlx.so -lSDL2
```
# Compile your project
### ⚠️ Troubleshooting
```bash
clang myApp.c MacroLibX/libmlx.so -lSDL2
#### If you run into glitches when writing or reading pixels from images
You need to add `IMAGES_OPTIMIZED=false` to your `make` command:
```sh
# In your cloned environment, inside the MacroLibX folder
make IMAGES_OPTIMIZED=false
```
## /!\ If you run into glitches when writing or reading pixels from images /!\
## License
You need to add `IMAGES_OPTIMIZED=false` to your make mlx command
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).
```bash
~ git clone https://github.com/420verfl0w/MacroLibX.git
~ cd MacroLibX
~ make IMAGES_OPTIMIZED=false
```
<!-- Links -->
[linux-clang_badge]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml/badge.svg
[linux-gcc_badge]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_gcc.yml/badge.svg
[macos_badge]: https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml/badge.svg
[linux-clang_wf]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml
[linux-gcc_wf]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_gcc.yml
[macos_wf]: https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml