How to Program Graphics and Input in C Without Any Libraries?
Asked by
CuriousCoder42
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?
Answers
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.
Reply to this answer
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.
Reply to this answer
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.
Reply to this answer
Add your answer
Answers are reviewed before publication.
CuriousCoder42: Thanks for the recommendation! Iโll definitely check out his series.