Live data from Hacker News

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

github.com

21–30 of 100 posts

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

#21

Earlier quoted context omitted.

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

If its OpenGL why is it CPU only ?

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.

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

#22
post #21

Earlier quoted context omitted.

If its OpenGL why is it CPU only ?

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.

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

#24
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?

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

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

#25
post #17

Earlier quoted context omitted.

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.

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.

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

#27

> OpenGL 1.1-style implementation on software How many lines to implement OpenGL 2.0 (non ES) ?

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.

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

#29
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.

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/

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

#30

Does this support CUDA?

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

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