5 ms·
Your modern OS and graphics hardware is way more complex. In DOS you wrote something that took over exclusive access to all the PC hardware and didn't have to m
by qbasic_forever 4y ago
Your modern OS and graphics hardware is way more complex. In DOS you wrote something that took over exclusive access to all the PC hardware and didn't have to multitask or share it with any other apps or code (more or less). You could directly write to hardware memory with no need to have some intermediate layers arbitrating access like today. The hardware itself was extremely simple and just a buffer of bytes that represented pixel colors, not like modern GPUs that are entirely distinct computers themselves that you have to pass messages and cooperate with for rendering even basic pixels.
Check out a modern library like raylib, it makes blasting out pixels on modern hardware easy: https://www.raylib.com/ https://www.raylib.com/
- rep_lodsb 4y agoI'm not an expert, but can't modern GPUs just take a "texture" in shared memory that is e.g. 640x480 and render it to some window? Having your code write directly to that memory wouldn't interfere with anything else. Would obviously require some setup, but that functionality could come standard with the OS instead of requiring countless libraries. Also half the article is about setting up a build system.
- legosexmagic 4y agothats how it works. its called a swapchain and its usually more than one texture. to avoid artifacts.
- flohofwoe 4y agoSetting up a correct swapchain, with correct frame timing and no microstutter, across Windows, Linux and macOS is a very non-trivial task though. This was no issue on 8-bit home-computers, and where it's basically a handful lines of assembly code to install a vsync interrupt service routine. (modern GPUs gained performance at the cost of latency, but a lot of the complications are also just pointless over-engineering on the software side)
- mananaysiempre 4y agoThe standard “hello Wayland” project[1] is basically that, using an interface called wl_shm. You still need to do some IPC in order to arrange for the environment to so that for you, obviously, so a library called libwayland-client handles the necessary Unix socket handshake, plus some more of that to tell the system you’re done with the buffer and want to submit it. It would be possible to isolate the first part into a reusable executable that performs it then execs you leaving a well-known mmapable fd for the buffer, but the second you’d still need to do yourself. (Wayland isn’t willing to just use a pixel buffer you’re still writing to—indeed I don’t think discrete GPUs can do that as opposed to requiring an explicit transfer to video memory.) [1] https://github.com/emersion/hello-wayland https://github.com/emersion/hello-wayland