-
Notifications
You must be signed in to change notification settings - Fork 65
Home
Welcome to the MLX42 wiki!
MLX42 is what I deem the successor to the MiniLibX library which was written by Charlie Root and later updated by Olivier Crouzet. Most students agree that the library is written in a, well, mediocre state and isn't the most optimal in terms of usability and documentation. While it is stable and does compile there are many pitfalls with the library including the lack of good documentation, weird function prototypes and/or slow performance, e.g: putpixel.
Most of my 42 peers simply stated that "it is what it is" once I discovered this library. However, personally, I refused to let this cycle continue. So I made it my goal that during one of many Lockdowns to start exploring OpenGL in order to finally fix the mistakes
In my eyes, the 42 Network deserves high quality tools to teach people properly.
A list of improvements include:
- It is norme
- It is easy and straight-forward to install & compile.
- It is cross-platform (Linux, Windows & MacOS)
- Error handling, no more straight up segfaults.
- Clear and understandable English written documentation.
- No Leaks, compiles with
-fsanitize=address
effortlessly. - No abstracted data types, only things relevant to OpenGL are abstracted.
- Open-source, find a bug? Send a PR to this repo!
- Useful extra features such as:
- Apply a custom application icon for your program.
- Apply a custom cursor, finally you can have a cool fire sword cursor!
- Universal enums for keycodes, mouse buttons, no more searching what keycode is for what OS.
- Easy input handling, no more 3 different types of inputs (Events, masks, hooks). Just a single hook or if statement.
- Custom XPM image format (XPM42).
- An actual efficient
mlx_putpixel
function. - Ability to retrieve the delta time, now you can make fancy interpolations.
- Ability to retrieve monitor width and height as well getting and setting window position.
- Ability to focus the window.
- Ability to resize the window.
Q: "ItS NoT In ThE SuBjeCt!"
A: So what ? Subjects can change and so if something is not working correctly it should be replaced. Sure you can argue this point but you can also be the reason that it CAN be in the subject instead. Have an open mind :)
Q: "Ok, so, can I use it ?"
A: Officially, no. However, ask your head of studies first before about using it, see what they think. Some students might be evangelical enthusiasts about what is stated in the subject and are technically in every right to fail you as long as this library is not endorsed, if you were to ask me (W2) then yes why not?
Q: "Can I just drag and drop my old project and just not do anything?"
A: Well, um uh, no ?? That's not how libraries work. Sure they target and do sort of the same thing but the functions each library provides are too different, even a little bit the in terms of behavior. And no there is no easy way to convert from the "old" to the "new" it will be somewhat tedious work.
Q: "We should be able to deal with the fact that MiniLibX is not perfect, it is by design and makes us better programmers."
A: Struggle does bring out the best in most people but it is also not ideal. Its really expected, I think so at least, that libraries that are public and usable should be stable and well documented. Nobody uses a library because it is annoying to work with it and think to themselves they have learned something after they are done struggling.
Q: "Why not use some other library? Why this one and not any other library."
A: It is your choice what to use! I wrote this in my free time in an attempt to introduce some good change and to improve the learning experience @ 42. If you don't like my library at least let me know what it is so I can improve on it.
Q: "Do you hate MiniLibX? Is this some personal vendetta, do you work for the CIA ?"
A: No, I just want 42 to improve, that's it.
That is the goal! In regards to the 42 Network, I will try to see if this is possible, in a perfect world it would just happen. However the main concern I have witnessed is "Can I just compile my existing project with this?" to which the answer is a No.
There are too many function prototype differences to make a proper "drag & drop" replacement.
That is the goal! In regards to the 42 Network, I will try to see if this is possible, in a perfect world it would just happen. However the main concern I have witnessed is "Can I just compile my existing project with this?" to which the answer is a No.
There are too many function prototype differences to make a proper "drag & drop" replacement.