Live data from Hacker News

rlsw – Raylib software OpenGL renderer in less than 5k LOC

github.com

31–40 of 100 posts

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#31

Earlier quoted context omitted.

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

Now make it fixed point

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

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#32
post #21

Earlier quoted context omitted.

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.

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.

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.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#34
post #16

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

but ... why?

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.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#36
post #16

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

but ... why?

Because GPU APIs are a nightmare clustertruck.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#38
post #16

Earlier quoted context omitted.

but ... why?

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…

I never ever bothered to compile SDL/SFML from source, what is so hard dumping the binaries into a folder, set the include paths for the compiler and linker?

Although I may imagine newbies may face some challenges dealing with compiler flags.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#39

Earlier quoted context omitted.

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

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.

Agreed, especially since it is the main language in the games industry, however that doesn't mean it should be the very first experience.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#40
post #28

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.

Software rendering is the future anyway, with the caveat that it is actually hardware accelerated, by making use of compute (GPGPU).
Post reply on HN