Live data from Hacker News

Software rendering in 500 lines of bare C++

haqr.eu

61–70 of 83 posts

Re: Software rendering in 500 lines of bare C++

#61

I went through this a few months ago in Rust. I wrote all the code by hand, no LLMs. Then I went ahead and added a small "game" on top, plus some special effects like pixelization shaders and chromatic aberration at the edge of a flashlight. https://github.com/kshitijl/tinyrenderer-rs if anyone is interested! The repo has lots and lots of in-progress screenshots so you can see the renderer come to life, plus all the…

[flagged]

It is a fashion thing, it is more relevant to discuss about a game engine does ECS, than what the game is all about.

Meanwhile, games like Minecraft, Balatro, Stardew Valley, Celeste, Geometry Wars,... blow up in adoption.

Re: Software rendering in 500 lines of bare C++

#63
post #47

Earlier quoted context omitted.

Not necessarily. Most desktop OS compositors provide a void** buffer that can be blitted to. Sure, this buffer will probably end up going through the compositor which does GPU hardware acceleration anyway, but it is definitely possible to shrink the application-side stack without relying on D2D/GLUT/GLEW/GLFW/SDL/WGPU in this case. On Windows: CreateDIBSection and BitBlt On macOS: CALayer and CATransaction commit Not…

I have done this on a number of platforms over the years. Going back to before createDIBSection existed (In fact I had something break when Windows provided an easy path and took away the method I had been using). Linux has always been a weird kettle of fish, the thing that worked best for me was imlib2 which was originally part of enlightenment. It did what it was supposed to do, hid pixel format conversion without…

Before those days, the solution would be to make use of WinG, the DirectX precursor, still introduced in Windows 3.0

https://www.gamedeveloper.com/programming/a-whirlwind-tour-o...

https://betawiki.net/wiki/WinG

Re: Software rendering in 500 lines of bare C++

#64

Is the Foley/Van Dam book still a go to resource for this? It seems it was updated in 2013, but, honestly, I’m more familiar with the ‘82 edition that was dedicated to 2D. Back in the day, it was The Book for computer graphics.

I also learnt with the second edition, I own the last one from 2013, it is alright.

The languages have evolved across editions, from Pascal, to C, to C and C++, and a bit of C# as well on the last one.

Naturally it misses on several new concepts, however I would assert it has quite valuable content.

Re: Software rendering in 500 lines of bare C++

#65
post #33

Ok I'm following along but how do I view the tga files that this program produces? Windows can't open them.

Irfanview?

Now that is an application I don't see in a long time, it used to be part of my default set of stuff to install on a new Windows PC.
Post reply on HN