I’m creating a fictional architecture and other fictional components for this computer/emulator. I’m facing an issue, this being the virtual display.
I need to be able to create a Window in which my program has access to all pixels contained inside, this is to emulate video memory/access.
For the best speed I was thinking the best way to do this is to use native system API and conditional compilation for cross platform support, but I don’t know if this is the best option.
So essentially I just need some sort of way to create a cross platform window in which I can draw pixels in.
I’m writing in the D language but almost any solution in C can be translated to D with C linkage.
Thanks for any help.
1
Sounds like you want SDL. It’s easy to create a window in it and it used to be completely CPU-driven so it’s based on the grid-of-pixels/framebuffer abstraction you’ll be using. SDL 2.0 is hardware-accelerated so performance should be all right. Take a look at the tutorials section in their wiki. This tutorial should help get you started, and there’s more in the SDL wiki.
I know there’s some D bindings floating around going by the name “derelict” but I’m not sure where the most recent version of it is. You’ll have to Google around a bit.