9 ms·
Raylib – A simple and easy-to-use library to enjoy video games programming
- pantsforbirds 3y agoRaysan5 (the author), has built a really neat ecosystem from tools he's also made. I really enjoy the way he has gone about it. It honestly reminds me of a minecraft world or something. Check out the full repo and see the projects!
- bibanez 3y agoThe pixel artstyle he uses for his websites and raylib helps haha
- streamer45 3y agoBeen using raylib for years to power generative digital paintings on embedded systems (RPI and the like). I have been really impressed with its performance and accessible API. Plus it's a very active and welcoming open source project, kudos to the maintainer.
- Renaud 3y agoDo you have any examples of code and/or art you can share? I’ve always been fascinated by generative art.
- speps 3y agoI don't know how known it is but Jared Tarbell has an excellent gallery: http://www.complexification.net/gallery/ http://www.complexification.net/gallery/ EDIT: nevermind, bio says he co-founded Etsy... he's probably well known
- Al0neStar 3y agoAfter cleaning up my bookmarks i narrowed down my "Creative Coding" folder to these. "Generative Design: Visualize, Program, and Create with JavaScript in p5.js": http://www.generative-gestaltung.de/2/ http://www.generative-gestaltung.de/2/ Articles by Tyler Hobbs specially the one on "Flow Fields" : https://tylerxhobbs.com/essays/2020/flow-fields https://tylerxhobbs.com/essays/2020/flow-fields Articles by Sighack specially the one on "Watercolor Techniques": https://sighack.com/post/generative-watercolor-in-processing https://sighack.com/post/generative-watercolor-in-processing "Steve's Makerspace" on Youtube: https://youtube.com/@StevesMakerspace https://youtube.com/@StevesMakerspace
- Cloudef 3y agothey actually use zig as build system, and it can be compiled (and cross-compiled) with zig cc
- planetis 3y agoOne of the options is zig cc. The default is makefiles and there's also good cmake support and plain bash/batch scripts.
- planetis 3y agoActually the Nim wrapper use none of the above, instead compiles and links the static library per project, recompiling only when the C source files has changed. Allows for the best flexibility if you are using nim.
- abnercoimbre 3y agoRaysan5 is giving us a masterclass [0] next month on his path to making raylib (and how other people might build something similar.) Worth checking out - there's an online track for it. [0] https://handmadecities.com/boston https://handmadecities.com/boston
- mcpackieh 3y agoThis looks awesome. I used to use ncurses for casual game development, but this looks like a good way to get back into it.
- kramerger 3y ago> Written in plain C code (C99) using PascalCase/camelCase notation Is this really something to be proud of? I thought snake_case was the common way of writing C?
- tnecniv 3y agoC styling varies quite a bit between libraries in my experience. Unfortunately, this means your code often looks kind of ugly. The most standard thing I can think of is appending _t to structs / types but I’m pretty sure I’ve used libraries that don’t do that.
- lionkor 3y agoappending _t is not allowed under POSIX, for what that's worth.
- unwind 3y agoThere is no solid standard, since it's C we're talking about. I would kind of agree that lower case is more common. More weirdly (from reading the header [1], I have not worked with raylib) the public types and function names are not namespaced so if your code already used Texture or Camera those become clobbered along with DrawPixel(), InitWindow() and hundreds more (the header is ~1,500 lines). I'm not saying that's bad, and the API seems really nice to work with, it's just a bit odd and against the "common wisdom" on how to design C libraries. I guess for a game there might not be a lot of need for other libraries, since raylib really does a lot of stuff. [1]: https://github.com/raysan5/raylib/blob/master/src/raylib.h https://github.com/raysan5/raylib/blob/master/src/raylib.h
- krstffr 3y agoSince there are no namespaces in C one kind of weird advantage of this is that raylib will stay out of your own (proper) namespace :)
- flohofwoe 3y agoI don't think there's an agreed-upon standard. There's a couple of 'conventions' to avoid collisions between types and names, one would be PascalCase for types and camelCase for anything else, another is using snake_case for both, but use the _t postfix for types (which is a bit shunned upon because the _t postfix is reserved by POSIX - but not the C standard).
- lbussell 3y agoI’ve been using the Raylib_cs bindings for C# to write a CHIP-8 interpreter. It was by far the fastest library to get up and running and drawing things to a Window, although my use case is extremely simple. I’d likely come back to it if I were to make something more complicated!
- cellularmitosis 3y agoThe Janet bindings work great as well. Lots of fun! https://github.com/janet-lang/jaylib https://github.com/janet-lang/jaylib
- chii 3y agoand there's even a haxe binding https://github.com/haxeui/raylib-haxe https://github.com/haxeui/raylib-haxe
- citeguised 3y agoHaha, I used it for the exact same thing in C#. And for visualising Advent-of-Code output under NodeJS. Just as quick, pretty much just an npm-install away. Great community, too!
- bibanez 3y agoI used Raylib to make an interactive simulation of earthquakes I had modeled in C++. Very easy to use and it was very rewarding
- kalekold 3y agoRaylib is awesome! It reminds me of the old school days of using BlitzBASIC to get things drawn on screen because it's easy and so much fun. This is how programming used to be, no fuss, just easy to use libraries. I currently use Raylib with Go and the Go bindings[1] to create screensavers for Linux and I'm really happy with the results. I even use it at work to draw interactive infrastructure diagrams that animate dependencies, allow controlling start-up etc. It's really flexible and simpler than anything else I've found to get stuff on-screen. I love it! [1]: https://github.com/gen2brain/raylib-go https://github.com/gen2brain/raylib-go
- progx 3y ago"Access to this site has been restricted."??? Github problem?
- sillysaurusx 3y agoOne big problem holding devs back from enjoying gamedev is a lack of quality 3D assets. The engine can be wonderful, but mods were successful due to the availability of existing models and textures that they can poach from the parent game. I’ve been trying to fix this. It’s not quite ready for showing, but whatever: https://github.com/shawwn/noh https://github.com/shawwn/noh I used to work on Heroes of Newerth, a dota clone. The parent company (S2 Games) sold it to Garena, who shut it down last year. In other words, there are ~80 unique characters with wonderful animations that no commercial entity cares about. I offer them to you. The gamble is that no one will care; Garena is a massive entity focused on the bottom line, and they’re based outside of the US. The main thing I’d like to do is to get together the names of all the artists that made these cool characters and promote their current work. HoN’s main strength was its graphics and fluidity, which even today some prefer over dota. That was thanks to an incredibly talented art team whose office was based in California, and I had the pleasure of watching them work for six months or so before the devs were relocated to Michigan. I miss them, and I should’ve spent more time learning the tricks of their trade. I’ve been making a converter from the HoN format to collada, so hopefully this can be a drop-in addition to raylib. Then you can make your own games with characters and props from HoN. EDIT: the author of raylib is here! https://news.ycombinator.com/item?id=36614060 https://news.ycombinator.com/item?id=36614060
- suby 3y agoJust glancing at it, it looks cool and it's clear you've put a lot of work into the project. I will say though, as a piece of feedback, I personally wouldn't want to build on top of it due to the provenance of the assets. They may not care about it, but they also (correct me if I'm wrong) have not approved of external parties using them or released the assets under any open source license. I have no way of verifying that they don't care, and should a project built with these assets become successful, I can imagine them going from not caring to caring very quickly. I don't mean to put out a negative comment though, the project does look very cool. It's just a risk.
- sillysaurusx 3y agoMe too! If I was an outsider, I know exactly how I’d feel. And that worry is entirely warranted. If you make a viral success with these assets, Garena might come knocking. But that’s the thing. I fell in love with the engine during my time there. And the only reason was thanks to the assets. I didn’t want to make a million bucks, I just wanted to tinker and play with it. My hope is that fellow tinkerers will find this useful. If nothing else, they can be stub assets till you’re able to swap them out for your own. And they certainly look gorgeous in comparison to most free models. More importantly, it’s a cohesive dataset —- the entire world is built from parts that all have the same style, which is quite hard to cobble together from random assets you find online. If Garena ever does have an issue, I’m hoping I can get them on the phone and work out a deal. They want money, we make money, there are ways of transferring some money to Garena to make everyone happy. It’s also a way to reboot an otherwise dead franchise. Plus it costs them nothing to wait and see. But yeah, this is ultimately a labor of love, and I have no idea how it’ll turn out. In the meantime, it’s at least an incredible reference of one way to implement a modern (circa 2011) game engine.
- raysan 3y agoHey! Just saw an increment in raylib github stargazers and raylib Discord members and someone point me to HN! I'm the author of raylib, feel free to ask me about it if you want.
- sillysaurusx 3y agoNo questions, just wanted to say thank you for helping to make gamedev actually fun again. I had no idea raylib existed till now. Unity and Unreal Engine have formed such a depressing monoculture that it’s no wonder gamedev has gone out of fashion in the last decade, and projects like yours help to rekindle it. Oh, one question, I was hoping to convert a bunch of models to raylib’s format. Right now my exporter goes from Heroes of Newerth format to Collada. What would be the best way to import from there into raylib? (They’re rigged character meshes with 15+ animations for each, so it’s a bit tricky since there’s no universal simple format like obj.)
- raysan 3y agoThank you very much! Glad you enjoy raylib! I know it's not that popular like the big engines but, actually, next month raylib will be 10 years old! :D raylib supports several 3d model formats (obj, gltf/glb, iqm, m3d, vox), I think Blender has exporters for most of them. Note that some formats support must be enabled in raylib/src/config.h file!
- sillysaurusx 3y agoOkay, I’ll try converting the meshes to iqm. Thanks. I edited in some context — they’re rigged character meshes with animations, so a few formats are unusable here (like obj) since it can’t handle skeletons. Would you guess that iqm is the best one to look into out of the ones you listed? Otherwise I guess I’ll buckle up and look at all of them. (Kind of sheepish that the only formats I’ve heard of are obj and m3d…)
- lasagna_coder 3y agoNot author but if you're sharing these assets, distributing them in the gltf (json/ascii, not binary) format is really helpful, as it seems to quite easily be imported into tools like blender and threejs.
- sarchertech 3y agoI’ve been using the Raylin bindings in Odin for a little side project I’m working on. The API is really nice. Also nice that the Raylib bindings are packaged along with the language.
- AlbertoGP 3y agoTurns out that raylib works quite well with FORTRAN: "Tic-Tac-Toe in Fortran with Raylib”: https://www.twitch.tv/videos/1861499073 https://www.twitch.tv/videos/1861499073 “Fortran is the Next Rust”: https://www.twitch.tv/videos/1864047709 https://www.twitch.tv/videos/1864047709 https://github.com/tsoding/tic-tac-toe-fortran-raylib https://github.com/tsoding/tic-tac-toe-fortran-raylib
- 4pkjai 3y agoRaylib is excellent, I've been working on it with the Rust bindings to build a little game. Very good API and awesome performance. Reminds me of Microsoft's XNA Framework.
- raysan 3y agoActually raylib was highly inspired by XNA, it was my main reference framework.
- tralarpa 3y agoIsn't it very inefficient to pass structs like Model by value to functions? I guess it doesn't matter for the matrix operations since they will be probably inlined, but what about the bigger functions?
- qbasic_forever 3y agoDepends what's inside model, if it's just a bunch of pointers to meshes, materials, etc. that are allocated and owned elsewhere then it's really not a big deal or concern.
- tralarpa 3y agoWhat is "a bunch of" nowadays? My knowledge about efficient programming is still at the level of 20 years ago :) Looking at the DrawModel function, it looks like it's passing around 400 bytes of data structures for a model with one mesh (assuming that matrix operations are inlined).
- TeaDude 3y agoGenuinely love this little thing. Its API is really ergonomic and it has plenty of things that are missing even from libs like SDL like some nice filesystem utilities. I'd consider it the Godot equivalent for C programmers.
- ape4 3y agoNice to see the influence of Borland noted.
- iamleppert 3y agoLooks like GitHub just killed this project.
- pests 3y agoI had watched a YT video of a developer using this library. His main complaint was the library polluting the global namespace. None of the functions are prefixed and there is a ton of generic named functions and it does define some common constants like for the colors (RED, BLUE, etc.) Is this an actual issue or was he just being too judgemental?
- gauddasa 3y agoWhy does the page claim "no external dependencies" as the very first feature, which is utterly false given it requires 26 additional libraries to be installed first: libasound2-dev libegl-dev libgl-dev libgl1-mesa-dev libgles-dev libgles1 libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libglx-dev libopengl-dev libpthread-stubs0-dev libx11-dev libxau-dev libxcb1-dev libxcursor-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxrandr-dev libxrender-dev x11proto-dev xorg-sgml-doctools xtrans-dev
- hotdogscout 3y agoI've been wanting to use your library recently coming from SDL and GLFW/GLEW, thank you so much for making it. Would you say it's easier to use than Monogame or equivalent?
- raysan 3y agoraylib is highly inspired by XNA so it has many similitudes to MonoGame but being plain C is not object-oriented like MonoGame.