From d9864aa588ab0954273586e8353825be17c5ce13 Mon Sep 17 00:00:00 2001 From: Nils Laeremans Date: Sat, 4 Nov 2023 19:49:37 +0100 Subject: [PATCH 1/7] v1 --- CMakeLists.txt | 2 +- include/.mlx.h.swp | Bin 0 -> 16384 bytes mlx42.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 include/.mlx.h.swp create mode 100644 mlx42.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ce27d7..fe9edf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ # CMake specifications # ----------------------------------------------------------------------------- -cmake_minimum_required (VERSION 3.18.0) +cmake_minimum_required (VERSION 3.16) project(mlx42 VERSION 2.3.2) message(STATUS "MLX42 @ ${CMAKE_PROJECT_VERSION}") diff --git a/include/.mlx.h.swp b/include/.mlx.h.swp new file mode 100644 index 0000000000000000000000000000000000000000..a1338e8dcd0e4f0bcd38c3a1011439b9cd3d9a5f GIT binary patch literal 16384 zcmeI3Ym6jS6~_w{VdNPgMq>zffw-{D&P?|_c7}D)-kzS_c6)k;dF%^GThn!Wy4dcj zrmA{oniZ6&#F%K11R)3n6%#jZB1ZgVP!PpLNWg$fFb1N?5+5AGvu~sHKFp_P^y1f#}fm(39`ZvZM4o=GOP~^7;r#n+^uNt|&H`sJNx8W|W4Z2>n z(RSouv#~Z%KVCPfEcHO@fw$^`c2wIse&*tEHZw#`FTQA#IPcuWx7tfuKlMQBfz$)3 z2T~8D9!NcqdLZ>c>Vf}b4@9j~txrJzleG<>)4#9NzfaP?U;D56iS*}FbwOPIA6@R~ z^20sluj=wpmp|82{%>90(dBbmp}7Bl>GF8|$9l@&q1(mde@F}B_HR_Ko2S2052PMQ zJ&<}J^+4)@)B~vpQV*maNIj5xAoal8(gQXw%;)2hyq_+}`2Ih>|G#v$W&I312#$c; zz)heD4uAs4fD1q$`14to^$hqCxF6gFJ_{o7F;D{I;1X~Sc=b%ndI>xY9s)UqPbK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=NY6Vj^(B25wKDVxPyyIt8S7 z{5Zs`@Pn1i7NMOdLcHfF140~lYSkuIBYi+$#sLt=pKj>yjr=DH{5>yuDpaTdh_k=O zTMP?U1=iShG7oRm@s?L#M)Cn~oCOXJsQ~S?NWbFp0KE%w{cMOEDaq@#c{7VQkLkkK Sb@Be^P>xR=>P<`4`T9RRl1=0Q literal 0 HcmV?d00001 diff --git a/mlx42.h b/mlx42.h new file mode 100644 index 0000000..3ee1e63 --- /dev/null +++ b/mlx42.h @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* mlx42.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: nlaerema +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2023/07/05 10:58:17 by nlaerema #+# #+# */ +/* Updated: 2023/11/04 19:49:00 by nlaerema ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef MLX42_H +# define MLX42_H + +# include "include/MLX42/MLX42.h" + +#endif From 4d24c14997f138c9b20c0f7d810ef3f5358126b4 Mon Sep 17 00:00:00 2001 From: Nils Laeremans Date: Sat, 4 Nov 2023 20:47:56 +0100 Subject: [PATCH 2/7] correct header --- include/MLX42/MLX42.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/MLX42/MLX42.h b/include/MLX42/MLX42.h index d1ea543..1155fca 100644 --- a/include/MLX42/MLX42.h +++ b/include/MLX42/MLX42.h @@ -1,12 +1,12 @@ /* ************************************************************************** */ /* */ /* :::::::: */ -/* MLX42.h :+: :+: */ +/* MLX42.h :+: :+: :+: */ /* +:+ */ /* By: W2Wizard +#+ */ /* +#+ */ /* Created: 2021/12/28 02:29:06 by W2Wizard #+# #+# */ -/* Updated: 2023/03/30 16:23:19 by ntamayo- ######## odam.nl */ +/* Updated: 2023/11/04 20:46:37 by nlaerema ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,8 +27,8 @@ * for the inner workings eitherway (shaders, vertex buffer, ...). */ -#ifndef MLX42_H -# define MLX42_H +#ifndef MLX42 +# define MLX42 # include # include # include From a7a12aae46b06a289b870785340206b3e8f65ac1 Mon Sep 17 00:00:00 2001 From: Nils Laeremans Date: Tue, 9 Jan 2024 14:30:44 +0100 Subject: [PATCH 3/7] add supp file --- mlx42.supp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 mlx42.supp diff --git a/mlx42.supp b/mlx42.supp new file mode 100644 index 0000000..735f45a --- /dev/null +++ b/mlx42.supp @@ -0,0 +1,34 @@ +{ + + Memcheck:Leak + ... + obj:/usr/lib/x86_64-linux-gnu/libnvidia* +} + +{ + + Memcheck:Leak + ... + obj:/usr/lib/x86_64-linux-gnu/libdbus* +} + +{ + + Memcheck:Leak + ... + obj:/usr/lib/x86_64-linux-gnu/libglfw* +} + +{ + + Memcheck:Leak + ... + obj:/usr/lib/x86_64-linux-gnu/libX11* +} + +{ + + Memcheck:Leak + ... + fun:_dl_open +} From 9ab445de758e2233a0fcd9045e18d09898d3fbc7 Mon Sep 17 00:00:00 2001 From: Nils Laeremans Date: Thu, 11 Jan 2024 10:33:25 +0100 Subject: [PATCH 4/7] update mlx42.supp --- mlx42.supp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mlx42.supp b/mlx42.supp index 735f45a..06bb237 100644 --- a/mlx42.supp +++ b/mlx42.supp @@ -26,6 +26,20 @@ obj:/usr/lib/x86_64-linux-gnu/libX11* } +{ + + Memcheck:Leak + ... + obj:/usr/lib/x86_64-linux-gnu/dri* +} + +{ + + Memcheck:Leak + ... + obj:/usr/lib/x86_64-linux-gnu/libLLVM* +} + { Memcheck:Leak From 0e38d1e8fca21c6b43283be30acb3790e1651561 Mon Sep 17 00:00:00 2001 From: kodokaii <110056528+kodokaii@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:41:40 +0100 Subject: [PATCH 5/7] Update README.md --- README.md | 309 ++---------------------------------------------------- 1 file changed, 6 insertions(+), 303 deletions(-) diff --git a/README.md b/README.md index 7595645..776f5f4 100644 --- a/README.md +++ b/README.md @@ -18,310 +18,13 @@ It provides primitive tools to draw textures onto the window as well as modifyin # Features ✨ -MLX42 comes with a plethora of features that make using it actually a joy instead of a chore. +this fork is to adapt the lib to the computer of 42 Le Havre -## Cross-Platform 🖥️ +To hide memory leaks from external libraries, add a .valgrindrc file to the repository root. -Run it on your grandma's WindowsXP, on your uncle's debian or on a hipster's MacOS! -No matter what the platform, if MLX42 can build on it, it will run on its native windowing system. - -This allows you to work on your project no matter which machine it is on. - -## Documented 📚 - -MLX42 cares about good documentation, every function, usage and even some internal workings are documented! -No more guessing and searching how something functions or is supposed to work. - -## Performance 🚀 - -It is built on OpenGL and uses batched rendering to speed up the rendering process compared to other libraries. - -## Open source && Community driven 🌐 -This project is being actively maintained by Codam as well as students from the 42 Network. This gives students the direct opportunity to learn more about the library itself as well as fix any potential bugs instead of merely accepting them. - ---- - -## Installation 🏗️ -### General compilation - -Overall the building of this project is as follows for ALL systems. As long as CMake can make sense of it. - -1. [Download and build MLX42](#download-and-build---mlx42) - -In case your system doesn't have [glfw](https://github.com/glfw/glfw) installed cmake will detect this and download it for you. -You can then run `sudo make install` in the `_deps` directory of glfw. If you're using a 42 Computer (MacOS, Linux), ask your favourite sysadmin to install it. -Same goes for CMake or any other dependencies you might need for your system. - -However if you can't do either CMake will still be able to fetch GLFW and build it. You can then statically link it from the `_deps` folder. - -> **Note**: For Codam, GLFW is already installed on the Macs. - -> **Note**: During the linking stage, the flag to link GLFW can either be: -lglfw3 or -lglfw depending on your system. - -1. Compile your program with the library: - - For: [MacOS](#for-macos) - - For: [Linux](#for-linux) - - For: [Windows](#for-windows) - -2. Profit! - -### Installing to the system - -To fully build the library and install it to your system run the following command: -```bash -cmake -B build && cmake --build build --parallel --config (Debug|Release|RelWithDebInfo|MinSizeRel) --target install ``` - -By default windows will place the installed lib into: `C:\Program Files (x86)\mlx42` and for MacOS / Linux it will be placed into `/usr/local/lib` and `/usr/local/include` respectively. - -### Unit tests -MLX42 comes with some unit tests to ensure the integrity of the library, to build them run the following command: -```sh -cmake -DBUILD_TESTS=ON -B build && cmake --build build --parallel -``` - -Then simply run them with: -```sh -ctest --output-on-failure --test-dir build -``` - ----- - -## Download and build - MLX42 - -```bash -➜ ~ git clone https://github.com/codam-coding-college/MLX42.git -➜ ~ cd MLX42 -➜ ~ cmake -B build # build here refers to the outputfolder. -➜ ~ cmake --build build -j4 # or do make -C build -j4 -``` - -The output library file is called `libmlx42.a` and is located in the `build` folder that you specified. - -### Available Options - -You can pass build [options](./docs/index.md#available-options) to cmake, e.g: `cmake -DDEBUG=1 -DGLFW_FETCH=0...`. These will for instance let you build it in DEBUG mode or alter any sort of behaviour at build-time. - -You can find an example makefile in the documentation [here](https://github.com/codam-coding-college/MLX42/blob/master/docs/Basics.md). - ----- - -## For MacOS: - -### Installing the dependencies - -If your system has neither GLFW nor CMake its highly recommended you use brew to install those missing dependencies. - -For 42 Campuses you can use: [42Homebrew](https://github.com/kube/42homebrew) -```bash -# This will also install CMake. -# Be aware that this may take a while so be patient. -➜ ~ brew install glfw -``` - -For MacOS you need to use the following flags to compile your program with the library -in order to link the program with the correct frameworks: -```bash --framework Cocoa -framework OpenGL -framework IOKit -``` - -Normally if you simply installed / built `glfw` from source or already have it installed -the compilation should be: -```bash -➜ ~ gcc main.c ... libmlx42.a -Iinclude -lglfw -``` - -#### Via [Homebrew](https://brew.sh/) / [42Homebrew](https://github.com/kube/42homebrew) -```bash -# Homebrew -➜ ~ gcc main.c ... libmlx42.a -Iinclude -lglfw -L"/opt/homebrew/Cellar/glfw/3.3.8/lib/" - -# 42Homebrew -➜ ~ gcc main.c ... libmlx42.a -Iinclude -lglfw -L"/Users/$(USER)/.brew/opt/glfw/lib/" -``` - -#### MacOS Security: - -When running your program in MacOS it may complain, because with Macs you just gotta think differently. -In case of any security warnings or MacOS telling you it can't verify the author/developer, go to ```Settings > Security & Privacy```. - -There will be a pop-up at the bottom telling you that an application tried to run, click the option to let it run. - ----- - -## For Linux: - -1. Install the necessary packages: - -For Debian like (Ubuntu, Mint, Pop OS...): -```bash -➜ ~ sudo apt update -➜ ~ sudo apt install build-essential libx11-dev libglfw3-dev libglfw3 xorg-dev -``` - -For Arch-linux (Manjaro, Endeavor, Garuda): -```bash -➜ ~ sudo pacman -S glfw-x11 -``` -OR (if you use sway/wlroots compositor or other wayland compositor) - -```bash -➜ ~ sudo pacman -S glfw-wayland -``` - -2. [Download and build MLX42](#download-and-build---mlx42) - -3. Compile your program with the library: - -```bash -➜ ~ gcc main.c ... libmlx42.a -Iinclude -ldl -lglfw -pthread -lm -``` -4. Profit! - ----- - -## For Windows (with Windows Subsystem for Linux 2 (WSL2)) - -> **Warning**: Before starting with all these steps, [read this](https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps) - -1. Set these variables in your `.zshrc` or `.bashrc`: -```bash -export DISPLAY=$(ip route list default | awk '{print $3}'):0 -export LIBGL_ALWAYS_INDIRECT=0 -``` -(If the DISPLAY export command is failing, see this [StackOverflow](https://stackoverflow.com/a/61110604) post for alternatives) - -2. Download and install an XServer application with extended configuration (XMing does not qualify) -VcXsrv works: https://sourceforge.net/projects/vcxsrv/ - -3. Open Windows Defender Firewall, and follow these steps: -- Go to 'Allow an app or feature through Windows Defender Firewall' -- Change Settings -- Find the installed XServer, for VcXsrv that's 'VcXsrv windows server' -- Enable communication over Private **and** Public network -Optionally you might be able to provide these settings on first launch of the XServer application, -and they might not even show up in the list until the first time you start the app. - -4. Start the XLaunch application (for VcXsrv) and provide these configuration settings: -- Leave Display number on auto -- Start no client -- **UNTICK** `Native opengl` option -- **TICK** `Disable access control` -- Finish starting the server - -5. Probably all the other steps for Linux apply, just clone, build and run. - ----- - -## For Windows Native: - -> **Warning**: Be aware that Visual Studio (2022) is required for this. Developing on Windows can be somewhat frustrating. - -We highly recommend you simply use [WSL2](#for-windows-with-windows-subsystem-for-linux-2-wsl2) to make this as painless as possible. -However if you insist on building for windows natively then all you need in terms of dependencies is: - -- [CMake](https://cmake.org/download/) -- [GLFW](https://www.glfw.org/download.html) - -Once you have all the dependencies correctly installed `CMake` will generate -the visual studio project files. Simply build it and once you have a `.lib` file -move them to your actual project and install them as you would with any other library. - -Just in case here's a [video](https://youtu.be/or1dAmUO8k0?t=494) showing you how this can be done. Conveniently this video also covers how you can link `glfw`. - -Of course it's up to you to make sure that the code you write is portable. Things that exist on `Unix` don't necessarily exist on `Win32`. - -## Example - -![MLX42](docs/assets/demo.gif) - -```c -// ----------------------------------------------------------------------------- -// Codam Coding College, Amsterdam @ 2022-2023 by W2Wizard. -// See README in the root project for more information. -// ----------------------------------------------------------------------------- - -#include -#include -#include -#include - -#define WIDTH 512 -#define HEIGHT 512 - -static mlx_image_t* image; - -// ----------------------------------------------------------------------------- - -int32_t ft_pixel(int32_t r, int32_t g, int32_t b, int32_t a) -{ - return (r << 24 | g << 16 | b << 8 | a); -} - -void ft_randomize(void* param) -{ - for (int32_t i = 0; i < image->width; ++i) - { - for (int32_t y = 0; y < image->height; ++y) - { - uint32_t color = ft_pixel( - rand() % 0xFF, // R - rand() % 0xFF, // G - rand() % 0xFF, // B - rand() % 0xFF // A - ); - mlx_put_pixel(image, i, y, color); - } - } -} - -void ft_hook(void* param) -{ - mlx_t* mlx = param; - - if (mlx_is_key_down(mlx, MLX_KEY_ESCAPE)) - mlx_close_window(mlx); - if (mlx_is_key_down(mlx, MLX_KEY_UP)) - image->instances[0].y -= 5; - if (mlx_is_key_down(mlx, MLX_KEY_DOWN)) - image->instances[0].y += 5; - if (mlx_is_key_down(mlx, MLX_KEY_LEFT)) - image->instances[0].x -= 5; - if (mlx_is_key_down(mlx, MLX_KEY_RIGHT)) - image->instances[0].x += 5; -} - -// ----------------------------------------------------------------------------- - -int32_t main(int32_t argc, const char* argv[]) -{ - mlx_t* mlx; - - // Gotta error check this stuff - if (!(mlx = mlx_init(WIDTH, HEIGHT, "MLX42", true))) - { - puts(mlx_strerror(mlx_errno)); - return(EXIT_FAILURE); - } - if (!(image = mlx_new_image(mlx, 128, 128))) - { - mlx_close_window(mlx); - puts(mlx_strerror(mlx_errno)); - return(EXIT_FAILURE); - } - if (mlx_image_to_window(mlx, image, 0, 0) == -1) - { - mlx_close_window(mlx); - puts(mlx_strerror(mlx_errno)); - return(EXIT_FAILURE); - } - - mlx_loop_hook(mlx, ft_randomize, mlx); - mlx_loop_hook(mlx, ft_hook, mlx); - - mlx_loop(mlx); - mlx_terminate(mlx); - return (EXIT_SUCCESS); -} - +--keep-debuginfo=yes +--leak-check=full +--show-leak-kinds=all +--suppressions=minilibx/mlx42.supp ``` From f24e6049d1f91d103d305fcfb6c4ac125f32ed88 Mon Sep 17 00:00:00 2001 From: kodokaii <110056528+kodokaii@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:38:31 +0100 Subject: [PATCH 6/7] Update README.md --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.md b/README.md index 776f5f4..ca22131 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,54 @@ To hide memory leaks from external libraries, add a .valgrindrc file to the repo --show-leak-kinds=all --suppressions=minilibx/mlx42.supp ``` + +Makefile exemple: + +``` +NAME = + +CC = cc +RM = rm -f +CLONE = git clone --depth=1 + +CFLAGS += -Wall -Wextra -Werror -O3 +CLINKS = -ldl -lglfw -pthread -lm + +MLX = minilibx +LIBMLX = $(MLX)/libmlx42.a + +SRC = +OBJ = $(SRC:.c=.o) + +all: $(NAME) + +bonus: $(NAME) + +$(NAME): $(LIBMLX) $(OBJ) + $(CC) $(CFLAGS) -o $(NAME) $(OBJ) $(LIBMLX) $(CLINKS) + +$(LIBMLX): $(MLX) + $(MAKE) -C $(MLX) + +$(MLX): + cmake $(MLX) -B $(MLX) + $(CLONE) https://github.com/kodokaii/MLX42.git $(MLX) + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + $(RM) $(OBJ) + $(MAKE) clean -C $(MLX) + +fclean: clean + $(RM) $(LIBMLX) + $(RM) $(NAME) + +clear: fclean + $(RM) -r $(MLX) + +re: fclean all + +.PHONY: all bonus clear clean fclean re +``` From aa3abd530d4703144ef802a5a3e478acf50dec82 Mon Sep 17 00:00:00 2001 From: kodokaii <110056528+kodokaii@users.noreply.github.com> Date: Sun, 25 Feb 2024 17:56:50 +0100 Subject: [PATCH 7/7] thanks Lullabye ! --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca22131..27f5876 100644 --- a/README.md +++ b/README.md @@ -58,8 +58,8 @@ $(LIBMLX): $(MLX) $(MAKE) -C $(MLX) $(MLX): - cmake $(MLX) -B $(MLX) $(CLONE) https://github.com/kodokaii/MLX42.git $(MLX) + cmake $(MLX) -B $(MLX) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@