Hacker News new | ask | show | jobs
by slezyr 2726 days ago
You should use SDL for this and not DirectX. You don't need complex API for GPU to paint line if you concerned about complexity.
2 comments

Have you looked through the SDL source, though? Sure, I can get a window open and paint lines very easily, I only have to write ~50-150 LOC. However, I've silently added thousands of lines (and at least one dll) to my project. The library only hides some of the complexity (which I love about it), but the complexity still exists.
That's just piling on even more abstraction! You may as well use a hex editor and create a single line BMP, then "run" it with any image viewer.
"more abstraction"? It's just one to be cross platform, you can't use OpenGL without it.

No need to go full shit ape and creation of 3D images in bmp is excellent exercise you should try.

https://github.com/ssloy/tinyrenderer

My point is, if you're allowing arbitrarily deep abstraction you can make almost any task trivial by just using something that basically already does what you're trying to do. The point the parent was making was how, with almost no abstraction at all, you could do graphics on an Amiga in a few lines, but to do the equivalent on a modern system at the lowest reasonable level of abstraction takes a lot more effort. Comparing that to a giant abstraction layer is missing the point.

> you can't use OpenGL without it.

Yes you can. You can't even pretend that coding once against SDL will absolve you of having to deal with platform issues, it just helps a lot.

> and creation of 3D images in bmp is excellent exercise you should try.

I'm a hobbiest game dev who almost exclusively uses software rendering (albeit to a framebuffer that gets pasted onto the screen with OpenGL as the path of least resistance). I've also written image libraries. None of this has anything to do with the parent comment.