raylib - simple and easy-to-use library to make videogames


14 posts
by raysan5 » Tue Sep 30, 2014 6:04 pm
Hello all,

I work as a videogames programming teacher and videogames developer. Last year I started working in a small C library to teach videogames programming to my students, it's called raylib (http://www.raylib.com). It worked really well with my students and I've continued developing it along this year. Some days ago I released a new version with support for Android devices and Raspberry Pi. raylib also comes with lots of simple code examples (http://www.raylib.com/examples.htm) and some project templates to start mid-size games (https://github.com/raysan5/raylib/tree/master/templates)

In the raylib webpage there is a Windows Installer containing the library, the compiler and a simple code editor for quick installation and usage (really useful for a fast setup), but the library sources, examples and templates also come with RaspberryPi-ready makefiles to be used on Raspberry Pi.

raylib is open source and can be directly downloaded from GitHub repository: https://github.com/raysan5/raylib

I've worked in raylib for more than a year now; I've invested 1000+ hours on its development, getting feedback from more than 80 student and I continuously added required features... raylib worked really well with my students and I think it can be useful for other teachers or Raspberry Pi game developers.

If someone wants to try, just let you know about its existence. Any feedback is welcome! ;)

Note for Moderator: I also posted this info on Education Resources board because raylib is mainly oriented to education but it can also be used for games development. Please, feel free to remove this post if feel convenient.
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by raysan5 » Sat Jan 03, 2015 8:26 am
Hello all!

I just published a new version of raylib adding support for web (html5) through emscripten.

Now with raylib you can code your games in C and compile for Windows, Linux, OSX, Android, RaspberryPi and HTML5.

Oh, and Happy new Year! :)
Last edited by raysan5 on Thu May 25, 2017 7:52 am, edited 1 time in total.
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by DigitalLumberjack » Sat Jan 03, 2015 10:46 am
Hi raysan5,

Your project seems very promising, it's nice to see your are working on it and releasing new versions. I'll take a look at the api but i'm already in love with the whole thing :)

Thank you for sharing this, it might help a lot of new developers to create games for the rpi !
User avatar
Posts: 336
Joined: Thu May 22, 2014 8:55 am
Location: France
by raysan5 » Wed Jan 07, 2015 3:05 pm
Hello DigitalLumberjack!

Thank you very much for your answer! I really appreciate it! :D

I just publised a raylib's API cheatsheet, in case you want to take a look: http://www.raylib.com/cheatsheet/cheatsheet.html

I also check your project: retrobox. It looks amazing! Congratulations!
Last edited by raysan5 on Thu May 25, 2017 7:53 am, edited 1 time in total.
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by raysan5 » Thu Sep 03, 2015 10:59 am
Hello all,

I just published raylib v1.3. That's the biggest raylib update since it's creation about two years ago and comes with lot of new features:

- Shaders support for easy shaders loading and use. Loaded shaders can be attached to 3d models or used as fullscreen postrocessing effects. A bunch of postprocessing shaders are also included in this release, check raylib/shaders folder.

- Textures module has grown to support most of the internal texture formats available in OpenGL (RGB565, RGB888, RGBA5551, RGBA4444, etc.), including compressed texture formats (DXT, ETC1, ETC2, ASTC, PVRT); raylib 1.3 can load .dds, .pkm, .ktx, .astc and .pvr files.

- New camera module offers to the user multiple preconfigured ready-to-use camera systems (free camera, 1st person, 3rd person). Camera modes are very easy to use, just check examples: core_3d_camera_free.c and core_3d_camera_first_person.c.

- New gestures module simplifies gestures detection on Android and HTML5 programs.

- raygui, the new IMGUI (Immediate Mode GUI) module offers a set of functions to create simple user interfaces, primary intended for tools development. It's still in experimental state but already fully functional.

Most of the examples have been completely rewritten and +10 new examples have been added to show the new raylib features: http://www.raylib.com/examples.htm.

You can download raylib from: http://www.raylib.com/
or fork the GitHub repo: https://github.com/raysan5/raylib

A new forum has also been added to the web to allow programming students to ask questions and show their raylib games: http://www.raylib.com/forum/index.php?p=/categories

As always, raylib includes full support for Raspberry Pi.

Any feedback is hightly appreciated!

Cheers,

Ray
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by topguy » Thu Sep 03, 2015 12:24 pm
Nice, I like it.

Just compiled it for Ubuntu (14.04).

I had to change makefile to use "-std=gnu99" because of similar error as this: http://stackoverflow.com/questions/3875 ... t-timespec
User avatar
Posts: 3124
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway
by raysan5 » Fri Sep 04, 2015 4:14 pm
Thanks for the feedback topguy!

I already corrected it in github develop branch (https://github.com/raysan5/raylib/tree/develop).

:)
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by raysan5 » Mon Feb 22, 2016 10:15 pm
Hello all!

I just published raylib 1.4. On this new version, lots of parts of the library have been reviewed, lots of bugs have been solved and some interesting features have been added.

  • First big addition is a set of Image manipulation functions have been added to crop, resize, colorize, flip, dither and even draw image-to-image or text-to-image. Now a basic image processing can be done before converting the image to texture for usage.
  • SpriteFonts system has been improved, adding support for AngelCode fonts (.fnt) and TrueType Fonts (using stb_truetype helper library). Now raylib can read standard .fnt font data and also generate at loading a SpriteFont from a TTF file.
  • New physac physics module for basic 2D physics support. Still in development but already functional. Module comes with some usage examples for basic jump and level interaction and also force-based physic movements.
  • raymath module has been reviewed; some bugs have been solved and the module has been converted to a header-only file for easier portability, optionally, functions can also be used as inline.
  • gestures module has redesigned and simplified, now it can process touch events from any source, including mouse. This way, gestures system can be used on any platform providing an unified way to work with inputs and allowing the user to create multiplatform games with only one source code.
  • Raspberry Pi input system has been redesigned to better read raw inputs using generic Linux event handlers (keyboard:stdin, mouse:/dev/input/mouse0, gamepad:/dev/input/js0). Gamepad support has also been added (experimental).
  • Other important improvements are the functional raycast system for 3D picking, including some ray collision-detection functions, and the addition of two simple functions for persistent data storage. Now raylib user can save and load game data in a file (only some platforms supported). A simple easings module has also been added for values animation.
  • Up to 8 new code examples have been added to show the new raylib features and +10 complete game samples have been provided to learn how to create some classic games like Arkanoid, Asteroids, Missile Commander, Snake or Tetris.

You can download raylib from: http://www.raylib.com/
or fork the GitHub repo: https://github.com/raysan5/raylib

You can try raylib code examples here: http://www.raylib.com/examples.htm. (Yes, they also run on web!)
You can try raylib game samples here: http://www.raylib.com/games.htm. (Yes, they also run on web!)

A new forum has also been added to the web to allow programming students to ask questions and show their raylib games: http://forum.raylib.com

As always, raylib includes full support for Raspberry Pi. All examples and sample games can run on it!

Any feedback is hightly appreciated!

Cheers,

Ray
Last edited by raysan5 on Thu May 25, 2017 7:53 am, edited 1 time in total.
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by raysan5 » Tue Jul 19, 2016 10:31 pm
Image

After 5 months of really hard work, here it is the amazing new raylib 1.5. One of the few C libraries primary intended to learn videogames programming and that let's you compile the same code for multiple platforms, from Raspberry Pi to Oculus Rift CV1.

This new version comes with a lot of features but probably the most amazing one is the support for Oculus Rift CV1 and VR simulator. It means, you can run your raylib games extremely easely in Oculus Rift CV1 but also, if you don't have an VR device connected, you can see an stereo rendering simulation with distortion... even on a Raspberry Pi!

Here it is a full list with main features:

  • VR support: raylib supports Oculus Rift CV1 and, additionally, supports simulated VR stereo rendering, independent of the VR device.
  • New materials system: now raylib supports standard material properties for 3D models, including diffuse-ambient-specular colors and diffuse-normal-specular textures.
  • New lighting system with support for up to 8 configurable lights of 3 types: point, directional and spot lights.
  • Complete gamepad support on Raspberry Pi: Now multiple gamepads can be easily configured and used; gamepad data is read and processed in raw mode in a second thread.
  • Redesigned physics module: physac module has been converted to header only and usage has been simplified. Performance has also been significantly improved.
  • Audio chiptunes support and mixing channels; added support for module audio music (.xm, .mod).
  • Other additions include a 2D camera system, render textures (for offline render) and support for legacy OpenGL 2.1 on desktop platforms.

You can download raylib from: http://www.raylib.com/
or fork the GitHub repo: https://github.com/raysan5/raylib

You can try raylib code examples here: http://www.raylib.com/examples.htm. (Yes, they also run on web!)
You can try raylib game samples here: http://www.raylib.com/games.htm. (Yes, they also run on web!)

A faorum is available to allow programming students to ask questions and show their raylib games: http://forum.raylib.com

As always, raylib includes full support for Raspberry Pi. All examples and sample games can run on it!

Any feedback is highly appreciated!

Cheers,

Ray
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by Morphology » Sun Sep 25, 2016 1:36 pm
Ray, a couple of issues compiling Raylib on a Raspberry Pi by simply following the instructions on your Github page:

I am using a new clean install of Jessie 2016-05-27.

I cloned the Git repository. The initial make failed saying it couldn't create ../release/rpi/libraylib.a so I created the ../release/rpi directory, after which it compiled OK, and created ../release/rpi/libraylib.a

Then when I tried to compile any of the examples, I got the following error:

/usr/bin/ld: cannot find -lraylib

Looking at the gcc string, it contains -L../src so I copied ../release/rpi/libraylib.a into ../src after which all the examples compiled fine.

Perhaps you might need to update the makefile and/or instructions, as it's likely to trip up a newbie?

Morph.
Posts: 34
Joined: Tue Jan 10, 2012 11:16 am
by raysan5 » Thu Nov 24, 2016 11:56 pm
Hi!

Just updated raylib to version 1.6 to commemorate the 3rd anniversary of its development. New version comes with a bunch of changes:

  • Complete raylib binding to LUA. All raylib functions plus the +60 code examples have been ported to LUA, now LUA users can enjoy coding videogames in LUA while using all the internal power of raylib.
  • Completely redesigned audio module. Based on the new direction taken in raylib 1.5, it has been further improved and more functionality added (+20 new functions) to allow raw audio processing and streaming.
  • Physac module has been moved to its own repository and it has been improved A LOT, actually, library has been completely rewritten from scratch by @victorfisac, multiple samples have been added together with countless new features to match current standard 2D physic libraries. Results are amazing!
  • Camera and gestures modules have been reviewed, highly simplified and ported to single-file header-only libraries for easier portability and usage flexibility.
  • Improved Gamepad support on Windows and Raspberry Pi with the addition of new functions for custom gamepad configurations but supporting by default PS3 and Xbox-based gamepads.
  • Improved textures and text functionality, adding new functions for texture filtering control and better TTF/AngelCode fonts loading and generation support.
  • Build system improvement. Added support for raylib dynamic library generation (raylib.dll) for users that prefer dynamic library linking.

You can see all work done in the last 3 years with this library here: https://www.youtube.com/watch?v=o8T9oNfsCOs

You can download latest version from GitHub: https://github.com/raysan5/raylib

You can try raylib code examples here: http://www.raylib.com/examples.htm. (Yes, they also run on web!)
You can try raylib game samples here: http://www.raylib.com/games.htm. (Yes, they also run on web!)

A forum is available to allow programming students to ask questions and show their raylib games: http://forum.raylib.com

As always, raylib includes full support for Raspberry Pi and it's completely free and open source.
Last edited by raysan5 on Thu May 25, 2017 7:55 am, edited 2 times in total.
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by Morphology » Fri Nov 25, 2016 9:16 am
Great work Ray!

I am really loving Raylib. I'm not a games developer, but am finding it ideal for conventional 2D GUI development on the Raspberry Pi. The examples are an invaluable learning resource.

Morph
Posts: 34
Joined: Tue Jan 10, 2012 11:16 am
by raysan5 » Sun Dec 04, 2016 12:58 pm
Hi Morph!

Thanks for your answer! That's the objective of raylib, make easy to draw some graphics on Raspberry Pi! :D

Ray
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
by raysan5 » Thu May 25, 2017 7:52 am
Image

Hello all,

After almost 6 months of hard work, new raylib 1.7 is ready! Some highlights of this new version are:

  • More than 30 new functions added to the library: functions to control Window, utils to work with filenames and extensions, functions to draw lines with custom thick, mesh loading, functions for 3d ray collisions detailed detection, functions for VR simulation and much more!
  • Support of configuration flags on every raylib module. Advance users can customize raylib just choosing desired features, defining some configuration flags on compilation. That way advance users can control library size and available functionality.
  • Improved build system for all supported platforms (Windows, Linux, OSX, RPI, Android, HTML5) with a unique Makefile to compile sources. Added support for Android compilation with a custom standalone toolchain and also multiple build compliation flags.
  • New examples and sample games added. All samples material has been reviewed, removing useless examples and adding more comprehensive ones; all material has been ported to latest raylib version and tested in multiple platforms. Examples folder structure has been improved and also examples build systems.
  • Improved library consistency and organization in general. Functions and parameters have been renamed, some parts of the library have been cleaned and simplified, some functions have been moved to examples (lighting, Oculus support) towards a more generic library implementation.
  • Some other features: Gamepad support on HTML5, RPI touch screen support, 32bit audio support, frames timming improvements, public log system, rres file format support, automatic GIF recording...

For a detailed list of changes, check CHANGELOG.

You can download latest version from GitHub: https://github.com/raysan5/raylib

You can try raylib code examples here: http://www.raylib.com/examples.htm. (Yes, they also run on web!)
You can try raylib game samples here: http://www.raylib.com/games.htm. (Yes, they also run on web!)

A forum is available to allow programming students to ask questions and show their raylib games: http://forum.raylib.com

As always, raylib includes full support for Raspberry Pi and it's completely free and open source.
Posts: 33
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona