c++cgraphicslow-level

How do you draw graphics in C/C++ without external libraries?


I’m trying to find out how to draw graphics in C/C++ without any external libraries. I know it is possible because I’m pretty sure the libraries are programmed in either C or C++ and I want to know how. Do they use their own virtual machine sort of like I’m pretty sure Java works, or do they access your machines video memory? I’m mainly asking about libraries like OpenGL and SDL2.

I’ve tried the win32 api but realized that it’s technically an external library and also even if it isn’t, are there any other ways? I’m also avoiding win32 cuz of how complicated it looks but I might just be being a wussy.


Solution

  • No modern OS that I know of allows direct access to video memory. It is all mediated through the driver for the graphics card or chip. That is in turn mediated by the OS. There is very little to be learned from trying to bypass these two layers.

    If you just want to plot pixels and nothing else, other people have had success with raylib.