-how did the first C programmer display graphics without a library made for graphics? |
For your purposes, it doesn't matter. Computers are not the same as they were 30+ years ago, so however it was done then is not how it is done now. Just use a library.
Here's a good starting point for OpenGL:
http://www.arcsynthesis.org/gltut/
Though if you
really want to know.... here is a
very simplified explanation of why you don't do things like they used to be done (note I'm fudging a lot here to keep it simple.. this is not really a technical explanation):
I/O on computers back in the day was accomplished by accessing the hardware directly... typically by performing reads/writes to specific addresses which were mapped to hardware registers. This communication allowed programs to communicate to the hardware and tell it what they wanted it to do.
The problem with that is that each piece of hardware behaves differently. So a program written to use one kind of graphics card would not work on another because the registers would be mapped differently. A solution to this is the idea of "drivers", which provide an abstract interface. The driver communicates with the hardware-specific registers and provides a common interface for the program to use, so it does not need to care which hardware it is using.
The problem with that is that modern computers are multitasking, and giving one program exclusive access to hardware through the use of drivers would prevent other programs from accessing it. Furthermore.. giving one program exclusive access makes the machine more vulnerable. If the program with exclusive access crashes, the entire computer crashes... so no other program will be able to do anything.
So now... the OS is really the only running program that has (or at least should have) direct access to anything. And everything else goes through libraries which allow secondary access. This protects the OS by allowing it to share resources and hardware access as necessary, allowing the machine to be more stable and more multi-tasking friendly.
is it really wrong to reinvent the wheel for learning purposes? |
No. But the question is... "what do you want to learn?"
If you want to learn how to program graphical applications... then yes... learning how to communicate directly with hardware is a complete waste of time.
But if you want to learn how to write drivers, then no... it wouldn't be.