🎠 Powerfull and simple 2D game engine with ecs based on raylib

Should we hide RayLib's public API in carousel? #1

Closed ndraey.tngl.sh
Closed opened by ndraey.tngl.sh

Every example in this project has a dependency on RayLib:

use raylib::ffi::Color;

// In other examples
use raylib::ffi::{Color, MouseButton};

So to start using carousel we also have to add raylib to game's dependency tree.

I think it's slightly bloated, because there is a probability of two different versions of raylib being in one actual project (one from carousel, one from the game itself) and they will bloat the final project.

The solution is to make own versions of data structures that have raylib's structures inside:

// In carousel
pub struct Color { inner: raylib::ffi::Color }
pub enum MouseButton { ... }

// And in the game:
use carousel::{Color, MouseButton};

Thanks for the issue 🙏. I think it's better to use our own types instead of Raylib ones.

Already seen and merged your PR, thanks 🙏

Sign up or Sign in to add to the discussion.