✅ Simplest way to take a 2d grid of pixel colors and display a window
Here's the situation, I'm going through a book on raytracing (raytracing in a weekend) and it's teaching to write a software renderer, rendering to a grid of pixels then writing it to a ppm file.
That's well and good, now I wanna make it so it spawns a window of the given size, and displays the grid of rgb pixels I have. But I have no experience with any graphics apis. I don't want to go for a game engine like unity or monogame, I want the simplest thing imaginable.
I'm on windows, cross platform is not a concern. I don't know if I should be looking at Directx or opengl or anything else, never did any graphics stuff like that. Not really a C# question sorry, just looking for advice, thanks a lot!
5 Replies
depends how fast you neet this to be
if it's not fast you can just create a bitmap, draw the pixels in there, and show the bitmap
if you need an actual framerate then it's different
Can you elaborate slightly, how to show a bitmap? Really doesn't need to be fast, 1 fps will be good enough
WriteableBitmap in WPF or Avalonia
It's also decently fast
Thanks, I will look at these things
$close
If you have no further questions, please use /close to mark the forum thread as answered