I'm really interested in diving deep into programming graphics and handling keyboard/mouse inputs without using any libraries at all, including OpenGL, SDL, or even the standard library. My goal is to understand how these libraries were initially created by exploring low-level programming in C or assembly language. Can anyone point me to resources or GitHub examples that demonstrate this level of programming?
3 Answers
It's tough to program without libraries on modern systems because you typically need to go through the OS for hardware access. If you're using Linux, check out the X Window System or Wayland protocol specifications—they're complex, but they show how GUIs work at a low level. You could technically recreate these with raw syscalls, but it's a massive undertaking. Windows and MacOS systems are trickier since their protocols aren't open-source, so it might be hard to find detailed info there.
Writing something like DirectX from scratch is quite a task! Just starting out, maybe look into embedded graphics or simpler projects. You'll want to build your knowledge gradually instead of jumping straight into complex graphics programming.
I love Ben Eater's YouTube series! He does an awesome job showing how to construct things like a simple 'Hello, World' program from scratch in assembly, and even builds a computer step by step. It's a fantastic resource for low-level programming.
Thanks for the recommendation! I’ll definitely check out his series.