32 comments

  • az09mugen an hour ago

    Curious to hear the take Tsoding has on that news.

  • ciroduran 7 hours ago

    Raylib's author was very happy to announce that you can compile an entire raylib program with no dependencies other than, say, being a win32 app https://x.com/raysan5/status/1980322289527976202

    • smlacy 6 hours ago

      but ... why?

      • zamadatix 5 hours ago

        The mantra for the library is "raylib is a simple and easy-to-use library to enjoy videogames programming." It's for hobbyist, learners, tinkerers, or just those that want to enjoy minimalistic graphics programming without having to deal with interfacing with modern machines yourself.

        The default Windows installer bundles the compiler and a text editor to make poking at C to get graphics on the screen (accelerated or not) a 1 step process. Raylib is also extremely cross platform, has bindings in about every language, and has extra (also header only, 0 dependency) optional libraries for many adjacent things like audio or text rendering.

        When I first started to learn C/C++ in the 2000s I spent more time fighting the IDE/Windows/GCC or getting SDL/SFML to compile than I did actually playing with code - and then it all fell apart when I tried to get it working on both Linux and Windows so I said fuck it and ignored that kind of programming for many years. Raylib is about going the opposite direction - start poking at C code (or whatever binding) and having it break and worry about the environment later when you're ready for something else.

      • rererereferred 16 minutes ago

        Why not? The original Doom didn't use a GPU renderer. It should be possible to do simple 3d stuff in today's computers without it.

      • foota 6 hours ago

        As someone who was once a child trying to figure out how to compile and link things to use SDL, I think there's some educational value in letting people make games without having to dive deep into how to use C++ toolchains.

        • SJC_Hacker 5 hours ago

          If you want to do that, skip C++ entirely and just use Javascript or Python. You can get shiny things really quickly.

          • irilesscent 4 hours ago

            I think there's still value in learning the C++ language and making a game or a demo is quite rewarding although raylib does have bindings for basically every conceivable language.

      • abnercoimbre 4 hours ago

        I mean this with all the appropriate venom we can muster: this attitude is why software quality is nonexistent.

  • pbohun 4 hours ago

    What's cool about this is that computers are so fast that you could probably make a decent 2D game using only this software-rendered OpenGL 1.1 library.

    • YesBox 3 hours ago

      Edit: I missed this was software rendered. I’m one gen-iteration ahead. Prob would still be possible to render my game cpu side provided I use the most efficient sprite depth ordering algorithm possible (my game is isometric pixel art like rollercoaster tycoon)

      Ha! That’s what I’m stuck with for Metropolis 1998. I have to use the ancient OpenGL fixed function pipeline (thankfully I discovered an AB extension function in the gl.h file that allows addition fields to be passed to the GPU).

      I’m using SFML for the graphics framework which I think is OpenGL 1.x

      Game to show what’s possible: https://store.steampowered.com/app/2287430/Metropolis_1998/

  • bsder 7 hours ago

    Fabrice Bellard also wrote an OpenGL thing: https://bellard.org/TinyGL/

    • bigfishrunning 4 hours ago

      What an aspirational figure, that guy does it all!

  • Archit3ch 7 hours ago

    > OpenGL 1.1-style implementation on software

    How many lines to implement OpenGL 2.0 (non ES) ?

    • Pannoniae 7 hours ago

      An order of magnitude more ;) You need to implement user-programmable shaders, both ARB assembly and GLSL. That needs a GLSL parser, a shader interpreter (talking about compiling it to machine code would add another magnitude of complexity).

      You also need to implement multitexturing (probably the easy part) but also all the texture combiner stuff too. This one is not hard but also a good chunk of code...

      All in all, at least 40K if you ask me, but that's a very lowball estimate.

      Of course if you don't care about implementing the full spec, you can get away with a lot less.

    • 0x0203 4 hours ago

      Not sure what the line count is, but PortableGL is a software renderer for 3.x(ish):

      https://github.com/rswinkle/PortableGL

      Cool project, and fun to play with.

  • brcmthrowaway 7 hours ago

    Does this support CUDA?

    • Pannoniae 6 hours ago

      No, this is CPU rendering only! Not even SIMD, just straightforward integer (and float) code.

      • bee_rider 3 hours ago

        It would be kind of neat to have OpenGL running on AVX-512, just for fun…

      • SJC_Hacker 5 hours ago

        If its OpenGL why is it CPU only ?

        • bitwize 5 hours ago

          OpenGL is an API. Software renderers for it—like the one that originally came with Windows NT, or even early versions of Mesa—have been out for a long time.

          • SJC_Hacker 5 hours ago

            I haven't messed with it for a while, but last I checked it really wasn't that much code to make it run on the GPU. Maybe an extra 100 lines or so. Although you couldn't use windowed mode, had to be fullscreen.

            • apgwoz an hour ago

              Haven’t messed with what?

              This is an implementation of the OpenGL API interface. It is not OpenGL. It does not support GPU acceleration. It does math with floating point on the CPU. It then draws points and lines on a 2D surface provided by raylib.

              Could this be adapted to use SIMD, or a GPU? Sure. That is not what this is today.

      • brcmthrowaway 6 hours ago

        Now make it fixed point

        • avadodin an hour ago

          Fixed point would be hell trying to keep track of the ranges. Maybe Posits or LNSs.

  • mouse_ 7 hours ago

    This will be perfect for Nintendo 3DS!

    • JoeyJoJoJr 4 hours ago

      Interesting. Does this mean it could be used for creating games for NES, SNES, Genesis, etc?

  • nnevatie 9 hours ago

    *OpenGL-style.

    • Pannoniae 8 hours ago

      Congrats for only reading the header ;) It's actually a pretty decent OpenGL 1.1 software implementation, obviously not complete and spec-correct though. It's more like those MiniGL drivers back in the day, implementing just enough of the spec so the game can run ;)

      In a similar way, this implements just enough so Raylib's OpenGL backend can run! It was done so you can use the library without external graphics dependencies if you really want to.

      • furyofantares 7 hours ago

        That's an extremely snarky reply given the post is just a direct link to the header.

        • Pannoniae 7 hours ago

          No, the doc-header of the header! Apologies if I wasn't clear. I just thought the GP zoomed in on the word "-style" in the first line without reading more (it's probably since it's not a full 1.1 implementation, just something which can do enough to shim a good chunk of 1.1 functions so the RL GL1.1 backend can run)

          • furyofantares 6 hours ago

            Still, if you post a link to a roughly 5k line raw source file, rather than like, some post about it, roughly nobody is gonna read much of the file before commenting.

            edit: I stand corrected by the downmods!