Opens an external site in a new window
Mental Health Awareness Month
“Community”
RODNEY LAB
  • Home
  • Plus +
  • Newsletter
  • Links
  • Profile
RODNEY LAB
  • Home
  • Plus +
  • Newsletter
  • Links

C++ Game Dev Libraries: raylib & Flecs 💪🏽 # C++ Game Dev Libraries: raylib & Flecs 💪🏽 #

blurry low resolution placeholder image C++ game dev libraries
  1. Home Rodney Lab Home
  2. Blog Posts Rodney Lab Blog Posts
  3. C++ C++ Blog Posts
<PREVIOUS POST
NEXT POST >
LATEST POST >>

C++ Game Dev Libraries: raylib & Flecs 💪🏽 #

Published: 2 years ago
4 minute read
Gunning Fog Index: 7
Content by Rodney
blurry low resolution placeholder image Author Image: Rodney from Rodney Lab
SHARE:

🖥️ C++ Game Development Libraries #

In this post, we look at a couple of C++ game dev libraries. Godot and Unreal Engine, among others, allow you to create fully-featured games with fantastic lighting using in-built editors. When it comes to learning game development, as well as quick prototyping, a lightweight alternative is often preferable.

raylib is a lightweight C/C++ game development framework, ideal for prototyping. We see some resources for getting up-to-speed with raylib, using C++ in this post.

We will also take a peek at Flecs, a C/C++ entity component system, providing access to a modern, composition over inheritance approach.

raylib and Flecs pair well, and both support compilation to WebAssembly (WASM), which is brilliant for prototyping, letting you share your work on the web. That is with no need for your audience to install apps in order to see your work.

Let me know if you find the post useful, and of course, if you would like to see similar content covering other C++ tooling.

blurry low resolution placeholder image C++ Game Dev Libraries — Arkanoid clone — screen capture shows red ball, which bounces off the window walls and occasionally collides with rows of yellow bricks arranged at the top of the screen, destroying them on contact.
C++ Game Dev Libraries: Arkanoid Clone built with raylib and Flecs

☀️ raylib Getting Started Resources #

Simple, easy-to-use game development library.

raylib 5’s release, last year, marked the tenth anniversary of the raylib 1.0 release. Over that period, the library has been battle-tested and built up a community, which is great for finding content on getting started.

raylib uses OpenGL, has full 3D support, you can develop with it on Linux, macOS and Windows, and you can also compile your game to WASM using Emscripten , making it quite accessible. Set up your raylib project with CMake to make it accessible to developers working on different platforms.

The quickest way to get going with raylib in C++ is to clone a CMake template repo, and get a copy of the raylib Cheat Sheet  (also available as a PDF). The raylib Cheat Sheet is a list of all the functions that the API exposes, great for poking around and modifying demo code for learning purposes.

There are Rust and Zig raylib bindings, though if you prefer working in Rust, you might consider Macroquad, which was inspired by raylib.

Learn more about raylib here:

  • GitHub repo: raysan5/raylib 
  • Official Site: raylib 
  • Code examples: raylib Code Examples 
  • CMake C++ template: CMake template for raylib 
  • Discord: Join the raylib Discord Server 

💪🏽 Flecs Getting Started Resources #

Fast and lightweight ECS.

Entity Component Systems offer an alternative game data storage pattern , to a fully object-oriented approach. The ECS approach can be more maintainable as well as performant. Though not needed for all games, when you do want an ECS, you will want something performant, with a small footprint, which is where Flecs comes in.

Flecs compiles to WASM, using Emscripten, letting you deploy game demos as web pages. It has fantastic documentation, and you can see dozens of examples in C as well as C++ in the Flecs GitHub repo.

An alternative, popular C++ ECS is EnTT , which is used in Minecraft, among other games.

Learn more about Flecs here:

  • GitHub repo: SanderMertens/flecs 
  • Official Quick-start: Flecs Quick-start 
  • Code Examples: Flecs Examples 
  • Discord: Join the Flecs Discord Server 

Other C++ Game Dev Tooling #

Of course, there is other C++ game-dev related tooling, alternative game frameworks to raylib that you might consider are:

  • Cinder ;
  • SDL ; and
  • SFML .

For creating a game backend, or just displaying diagnostics, on-screen during development, Dear ImGui  is also popular.

🗳 Poll #

What’s the best way to get going in C++ game dev?
Voting reveals latest results.

🙌🏽 C++ Game Dev Libraries: Wrapping Up #

In this C++ game dev libraries, we had a look at some C++ game dev tooling and the features offered. More specifically, we saw:

  • why you might consider raylib for prototyping a game;
  • links to content for getting started with the Flecs ECS; and
  • some alternative C++ game frameworks and ECSs.

I hope you found this useful. Do let me know if you would like to see more similar content. Also reach out if there is anything I could improve to provide a better experience for you.

🙏🏽 C++ Game Dev Libraries: Feedback #

If you have found this post useful, see links below for further related content on this site. Let me know if there are any ways I can improve on it. I hope you will use the code or starter in your own projects. Be sure to share your work on X, giving me a mention, so I can see what you did. Finally, be sure to let me know ideas for other short videos you would like to see. Read on to find ways to get in touch, further below. If you have found this post useful, even though you can only afford even a tiny contribution, please consider supporting me through Buy me a Coffee.

blurry low resolution placeholder image ask Rodney X (formerly Twitter) avatar

Rodney

@askRodney

Just dropped a post on resources for getting started with Raylib C/C++ game framework and Flecs C/C++/C# Entity Component System.

Hope you find it useful!

#askRodneyhttps://t.co/0Ueekz9r5W

— Rodney (@askRodney) February 21, 2024

Finally, feel free to share the post on your social media accounts for all your followers who will find it useful. As well as leaving a comment below, you can get in touch via @askRodney on X (previously Twitter) and also, join the #rodney  Element Matrix room. Also, see further ways to get in touch with Rodney Lab. I post regularly on Game Dev as well as Rust and C++ (among other topics). Also, subscribe to the newsletter to keep up-to-date with our latest projects.

Thanks for reading this post. I hope you found it valuable. Please get in touch with your feedback and suggestions for posts you would like to see. Read more about me …

blurry low resolution placeholder image Rodney from Rodney Lab
TAGS:
C++GAMING

Reposts:

Reposts

  • Gaming Feed profile avatar
  • Trinity Paradox profile avatar

Likes:

Likes

  • Terry/terrehbyte profile avatar
  • Trinity Paradox profile avatar
  • Brian Davis profile avatar
  • Nicole Marie T profile avatar
Reposts & likes provided by Mastodon & X via Webmentions.
<PREVIOUS POST
NEXT POST >
LATEST POST >>

Leave a comment …

Your information will be handled in line with our Privacy Policy .

Ask for more

1 Nov 2022 — Astro Server-Side Rendering: Edge Search Site
3 Oct 2022 — Svelte eCommerce Site: SvelteKit Snipcart Storefront
1 Sept 2022 — Get Started with SvelteKit Headless WordPress

Copyright © 2020 – 2025 Rodney Johnson. All Rights Reserved. Please read important copyright and intellectual property information.

  • Home
  • Profile
  • Plus +
  • Newsletter
  • Contact
  • Links
  • Terms of Use
  • Privacy Policy
We use cookies  to enhance visitors’ experience. Please click the “Options” button to make your choice.  Learn more here.