2 AnswersNew Answer
You like the difficult subjects! Graphics programming at the lowest level is very system dependant. Windows has the Graphics Device Interface (GDI) while unix has the xWindow system (xlib). These libraries are the absolute basics for drawing lines and geometric shapes and it takes a great deal of code to get even the most minimal work done. There are various libraries built on top of these minimal libraries that simplify the process and make coding more productive. Windows has the DirectX and Direct3D API, and the now defunct XNA API. Unix systems have Motif, GIMP, KDE, GNOME and others; some of these are desktop widget toolkits in addition to graphics libraries. There are also cross platform APIs such as Qt and OpenGL. See https://en.wikipedia.org/wiki/Graphics_library for more information.