Raylib: a simple and easy-to-use library to enjoy game programming
raylib.comI use it for playing around with some game ideas, really liked the ease of it. Clean, compact API.
Only nuisance is that SUPPORT_BUSY_WAIT_LOOP is defined in the defaults, so I can't use the package from my distribution but have to compile it myself – as I don't want 100% CPU usage when prototyping (where I can happily live with inaccuracies of the timers). I considered opening an issue and forgot about it. But you, Ray, seem to be reading this thread anyway. :-) Thanks, by the way!
Hey, yeah, actually there have been a couple of issues about it... Using a busy wait loop is the only way to keep a quite stable timming measure, depending on OS, clock granularity could be up to 10 ms (despite raylib tries to enable a hi-res clock with granularity of 1ms), it means, some undesired timming issues...
In any case, you can just comment that line in src/config.h (or even uncomment SUPPORT_EVENTS_WAITING) and recompile the lib. raylib has been designed with customization in mind.
Loving the minimal aesthetic. Will give it a try this weekend ;)
Full API:
Actually cheatsheet is a bit outdated, raylib is growing fast, several functions have been added in latest version 2.4-dev, you can check current API directly in raylib.h: https://github.com/raysan5/raylib/blob/master/src/raylib.h
Prefer the use of types over preprocessor defines - ex: static const vs #define PI, RAD2DEG, etc. (https://github.com/raysan5/raylib/blob/master/src/raymath.h). Also, take a look at using the GLSL data types for vectors and matrices - https://www.khronos.org/opengl/wiki/Data_Type_(GLSL) along with explicit use of SSE when appropriate and supported.
Could you use this for bigger projects? Or would I run into (performance?) problems and have to port the project to another engine?
raylib is not an engine. It's a quite low level library intended to enjoy coding, probably better small games. You can use for a big project but it lacks lots of required elements that engines have, to name some: Screen Manager, Content Manager, Objects Manager. In any case, you can test it and evaluate if it could fit your needs.
>Bindings to Lua (raylib-lua), Go (raylib-go) and more!
Is there a list of other bindings somewhere? I didn't see one in my admittedly cursory look.
yes, actually there are bindings to +15 languages, here it is a list: https://github.com/raysan5/raylib/blob/master/CONTRIBUTING.m...
Cool, thanks!
Looks awesome, but unfortunately a few of the examples don't work for me. Is Firefox not supported?
Web examples are not updated, still using raylib 1.8. But all should work on any browser, which ones fail on Firefox?
Very cool - the syntax reminds me of Blitz3D, the language of choice for 15 year old me :)
Does this work with Swift and iOS - namely, is embedding this library as a dependency likely to pass Apple's App Store review process?
Sorry, no iOS support, it can be ported but I don't have an iOS or a MAC. raylib is plain C and uses OpenGL, lately Apple ecosystem doesn't like those techs.
Looks fun! I have been moving towards using Go for everything so this might be a good excuse for me to figure out how to use C libraries.
Sorry, but this site is illegible on mobile.
Sorry, already working on an updated web.
What would be the similar cross-platform (including mobile) lib in C++?
I think this library, is exactly that. Cross platform in (C), and works on mobile, browsers, as well as desktop environments.
Yes, but I'd prefer something similar in C++, not C :)
SFML is great and has a rather big community.
Does anyone know how the C code is ported to the web in the examples?
Looks like emscripten:
https://github.com/raysan5/raylib/blob/master/games/Makefile
yes, emscriptem, compiled to WASM... but current web examples are still asm.js. Web needs some update...