My impressions

I was googling ways of easily doing graphics on a Raspberry Pi when i came across RayLib and decided to give it a shot.

Im not trying to make a game or anything, just visualize some sensor data on screen and i wanted to do it from C/C++ just because that's what i like to work in. So i download the windows installer, ran it and explored the folder it made and i was quickly up and running. Really love the fact that it gives you everything you need in that one folder. So i started going trough the examples and looking at source code to see how it worked and i was amazed how simple and to the point the whole library is.

Firstly the SetFPS function was a delightful surprise, so easy to make my program run at the exact speed i want. Moving on i got another surprise to find out that this not only does graphics but also handles all the input too. Then i looked in to 3D examples and found they are actually 10 times simpler than i expected, and it also makes using custom shaders as simple as loading a text file?! What is this witchcraft? Im used to libraries where you need to define and initialize all sorts of crap before it does anything useful at all, yet here its one line to do most stuff id want to do. I mean sure its not nearly as flexible as something like that, but as i look trough the very helpful cheatsheet i find that it still can do almost anything one would normally need using some combination of the provided functions.

So then i want to make it interactive by adding GUI elements like buttons and sliders, but doing it the way that a button is done in raylib examples would get cumbersome real fast if i made 20 such buttons. Okay so time to get things more organized. So i need a Button Class that handles that, and since i want other controls it needs to be inside a Control superclass and that needs to contain a Paint function to draw it and mouse events and such. Then i need to keep it all in array so that i can call those events for all controls at appropriate times... etc well okay this is getting involved i will do it later. So i go fool around with some and come across the raygui project. But when i go look for a download all i find is a single *.h file, so where is the code for it, is it unfinished? But then i actually go read that file and... wait a minute its actualy all in here. I tag the h file on to one of my programs and start to figure out how to actually use it. It seams like i just have to call a button? I stick it in my draw loop and suddenly there is a button on my screen with mouseover and everything. That part just blew me away. Just 1 line of code containing a single function call is all it takes to put a interactive button there. No classes, no stucts, no arrays just a simple function call to a function containing like 20 lines of code and its all still oldschool C without any C++.

I should rant about the terrible lack of documentation on its API, but i quickly found that it doesn't need any documentation. Every function is simple enough to be explained in that 10 word long comment next to it, if you still don't get it just look at an one of the very well commented examples.

This library is a work of art. No complex programing abstractions at all, every part of it is easy to understand at a glance and yet it does something as powerful as 3D OpenGL to a point where it is useful and not just a toy. Amazing work Raysan! The world needs more programmers like you!

Comments

  • Hey Berni!

    Wow! Thank you very much for those nice words! You really made my day! :D

    I've worked quite hard on raylib to make it simple and easy-to-use for everybody, it's always great to see it fulfills that purpouse.

    About raygui, despite being completely functional, it's not finished yet, so the lack of documentation... Some extra documentation needs to be added, some functions need review and light/dark styles need to be adjusted. The objective of that module was using it for simple tools (i.e. https://github.com/raysan5/rFXGen).

    Now working on raylib v1.7 with several additions and improvements... and also some parts simplified...

    Again, thanks for your words, you really motivated me to keep working hard on raylib. :)

    Any bug, any issue, any question, just let me know!
  • No problem.

    Looking forwards to the next version!
Sign In or Register to comment.