mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
Merge pull request #1 from 27network/feature/better-readme
Improve project's README.
This commit is contained in:
2
.github/workflows/linux_clang.yml
vendored
2
.github/workflows/linux_clang.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Linux build(clang)
|
name: Linux (clang)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|||||||
2
.github/workflows/linux_gcc.yml
vendored
2
.github/workflows/linux_gcc.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: Linux build(gcc)
|
name: Linux (gcc)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|||||||
2
.github/workflows/macos_x86.yml
vendored
2
.github/workflows/macos_x86.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: MacOS build
|
name: macOS
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|||||||
94
README.md
94
README.md
@@ -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.
|
||||||
|
|
||||||
[](https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml)
|
The goal of this version is to provide a light, fast, and modern graphical tool while keeping the same API.
|
||||||
[](https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_gcc.yml)
|
|
||||||
[](https://github.com/420verfl0w/MacroLibX/actions/workflows/macos_x86.yml)
|
|
||||||
|
|
||||||
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
|
You first need to install the proper dependencies for your operating-system.
|
||||||
Dependances :
|
|
||||||
|
|
||||||
For Ubuntu/Debian
|
#### 🐧 Linux
|
||||||
```bash
|
|
||||||
~ sudo apt update
|
Here are a few common cases for different Linux distributions:
|
||||||
~ sudo apt install libsdl2-2.0-0 libsdl2-dev build-essential
|
|
||||||
|
<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
|
```bash
|
||||||
~ sudo pacman -S sdl2
|
git clone https://github.com/420verfl0w/MacroLibX.git
|
||||||
|
cd MacroLibX
|
||||||
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
### MacOS
|
## 🔨 Compile your project
|
||||||
Dependances :
|
|
||||||
* [MoltenVK](https://github.com/KhronosGroup/MoltenVK/)
|
|
||||||
* SDL2 `brew install SDL2`
|
|
||||||
|
|
||||||
# Get MacroLibX
|
To compile your project with MacroLibX, you just provide the shared library path in your compilation/linking command:
|
||||||
|
|
||||||
```bash
|
```sh
|
||||||
~ git clone https://github.com/420verfl0w/MacroLibX.git
|
clang myApp.c /path/to/MacroLibX/libmlx.so -lSDL2
|
||||||
~ cd MacroLibX
|
|
||||||
~ make
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Compile your project
|
### ⚠️ Troubleshooting
|
||||||
|
|
||||||
```bash
|
#### If you run into glitches when writing or reading pixels from images
|
||||||
clang myApp.c MacroLibX/libmlx.so -lSDL2
|
|
||||||
|
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
|
<!-- Links -->
|
||||||
~ git clone https://github.com/420verfl0w/MacroLibX.git
|
|
||||||
~ cd MacroLibX
|
[linux-clang_badge]: https://github.com/420verfl0w/MacroLibX/actions/workflows/linux_clang.yml/badge.svg
|
||||||
~ make IMAGES_OPTIMIZED=false
|
[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
|
||||||
|
|||||||
Reference in New Issue
Block a user