Skip to content

Commit 60e9fb3

Browse files
authored
Merge pull request #51 from VNNCC/improve_README
Improve README
2 parents 88f36b4 + 8a425d6 commit 60e9fb3

File tree

1 file changed

+41
-24
lines changed

1 file changed

+41
-24
lines changed

README.md

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616
</div>
1717

18-
A recreation of the MiniLibX library used by 42, using GLFW &amp; glad, running on OpenGL.
18+
A recreation of the MiniLibX library used by 42, using GLFW & glad, running on OpenGL.
1919
The goal of MLX42 is to replace the outdated and stale MiniLibX library.
2020

2121
For information and documentation about MLX42 check the wiki.
@@ -36,6 +36,8 @@ A custom simple to use XPM-like format which has some minor differences to the X
3636
#### Almost identical usage to MiniLibX
3737
Switching to MLX42 from MiniLibX is not a lot of work, most features present in MiniLibX are also present in MLX42, albeit with different prototypes.
3838

39+
---
40+
3941
## Installation
4042

4143
In the very end a library is generated, compile your program with this library!
@@ -59,11 +61,7 @@ Through brew:
5961

6062
Or, if studying at Codam, you can find GLFW in the [Managed Software Center](munki://detail-GLFW).
6163

62-
3. Compile MLX42
63-
```bash
64-
~ cd MLX42
65-
~ make
66-
```
64+
3. [Download and build MLX42](#download-and-build---mlx42)
6765

6866
4. Compile Program
6967

@@ -89,19 +87,17 @@ Or, if studying at Codam, compile using the following flags:
8987

9088
5. Run!
9189

92-
### Pre-compiled libraries
90+
----
91+
92+
### Pre-compiled libraries (GLFW)
9393

94-
2. Download the binaries directly [here.](https://www.glfw.org/download.html)
94+
2. Download the binaries directly [here](https://www.glfw.org/download.html).
9595

9696
3. If possible move the contents of `lib` and `include` of GLFW to `/usr/local/lib` and `/usr/local/include` respectively.
9797
If not possible, move the lib file to the root of MLX42 and move the GLFW directory in include to the include of MLX42.
9898
NOTE: For the lib choose the appropriate `.a` & `.dylib` file depending on your architecture.
9999

100-
4. Compile MLX42
101-
```bash
102-
~ cd MLX42
103-
~ make
104-
```
100+
4. [Download and build MLX42](#download-and-build---mlx42)
105101

106102
When compiling with the static library, directly you should compile your program like this:
107103
```bash
@@ -117,6 +113,8 @@ Else, simply compile like this:
117113
In case of any security warnings or MacOS telling you it can't verify the author/developer, go to ```Settings > Security & Privacy```.
118114
There will be a pop-up at the bottom telling you that an application tried to run, click the option to let it run.
119115

116+
----
117+
120118
### For Linux:
121119

122120
1. Install the necessary packages:
@@ -137,17 +135,14 @@ OR (if you use sway/wlroots compositor or other wayland compositor)
137135
~ sudo pacman -S glfw-wayland
138136
```
139137

140-
2. Download MLX42 & Build
141-
```bash
142-
~ git clone https://github.com/codam-coding-college/MLX42.git
143-
~ cd MLX42
144-
~ make
145-
```
138+
2. [Download and build MLX42](#download-and-build---mlx42)
146139

147140
3. Create a ```main.c``` file, include ```MLX42/MLX42.h```, compile with ```-ldl -lglfw (or -lglfw3) -pthread -lm```, make sure to also do ```-I <include_path>```.
148141

149142
4. Run.
150143

144+
----
145+
151146
### For Windows (with Windows Subsystem for Linux 2 (WSL2))
152147

153148
1. Set these variables in your `.zshrc` or `.bashrc`:
@@ -177,9 +172,11 @@ and they might not even show up in the list until the first time you start the a
177172

178173
5. Probably all the other steps for Linux apply, just clone, build and run.
179174

175+
----
176+
180177
### For Windows:
181178

182-
1. Download & Install MinGW: [Here!](https://sourceforge.net/projects/mingw/)
179+
1. Download & Install [MinGW](https://sourceforge.net/projects/mingw/)
183180

184181
2. Simply click continue, select whatever your choice is.
185182
Once reaching the MinGW Installation Manager select:
@@ -188,16 +185,24 @@ and they might not even show up in the list until the first time you start the a
188185

189186
3. Apply by going to `Installation > Apply Changes`, after it's done, you may close the window.
190187

191-
4. Download & Install CMake: [Here!](https://cmake.org/download/), use the installer. Simply select all default options.
188+
4. Download & Install [CMake](https://cmake.org/download/).
189+
- Use the installer and select all default options.
192190

193-
5. Download & Install GnuWin: [Here!](https://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81.exe/download?use_mirror=altushost-swe&download=)
191+
5. For Windows we need to install an additional component to **make** the **make** command available.
192+
193+
- Using the [chocolatey package manager](https://chocolatey.org/)
194+
```bash
195+
➜ ~ choco install make
196+
```
197+
198+
- Using [GnuWin](https://sourceforge.net/projects/gnuwin32/files/make/3.81/make-3.81.exe/download) (download & install)
194199

195200
6. If you used all default options, add these paths to your SYSTEM Environment variables:
196201
- C:\MinGW\bin
197202
- C:\Program Files\CMake\bin
198203
- C:\Program Files (x86)\GnuWin32\bin
199204

200-
7. Download GLFW: https://www.glfw.org/download.html
205+
7. Download the [GLFW source package](https://www.glfw.org/download.html) and extract it somewhere.
201206

202207
8. Open the terminal and type `cmake-gui`, select the downloaded/extracted
203208
source folder, select any place you want the build output to be.
@@ -214,7 +219,9 @@ and they might not even show up in the list until the first time you start the a
214219

215220
13. Go to the directory you assigned in Step 10. Copy the GLFW folder in the include folder to `C:\MinGW\include` & copy the .a file in the lib folder to `C:\MinGW\lib`.
216221

217-
14. Compile your program with these flags:
222+
14. [Download and build MLX42](#download-and-build---mlx42)
223+
224+
15. Compile your program with these flags:
218225
- `-lglfw3`
219226
- `-lopengl32`
220227
- `-lgdi32`
@@ -226,6 +233,16 @@ and they might not even show up in the list until the first time you start the a
226233

227234
15. Run.
228235

236+
## Download and build - MLX42
237+
238+
```bash
239+
~ git clone https://github.com/codam-coding-college/MLX42.git
240+
~ cd MLX42
241+
~ make
242+
```
243+
244+
The output library file is called `libmlx42.a`.
245+
229246
## Example
230247

231248
![MLX42](https://user-images.githubusercontent.com/63303990/150696516-95b3cd7b-2740-43c5-bdcd-112193d59e14.gif)

0 commit comments

Comments
 (0)