Color

Is there any way to change the color of a program with nothing but the standard library? I've always been curious about how people create color in their programs before the major operating systems like windows had even come out. They had to have started somewhere. Where did they start and how did they do this?
Last edited on
They got a Library from the GPU-Creators to access the GPU and then they sent some bytes to the GPU.

So no, this is not possible with the standard library alone because you can't make a GUI with the standard library alone.
No. Standard library does not about existence of color or screen at all. C++ program's only way to communicate with outside world is to receive and send a sequence of characters through standard streams. THose streams are processed by calling program (OS, other user program, etc...) and program does not know what will happen with those stream: will they be printed on screen, send to printer, send over the net, or just processed and stored in a file. As there might be even different terminals with different approach to setting colors, or even different displays, there is no sure way to manage colors. That is why we need to call OS dependend functions or use some public API (like DirectX or OpenGL) to do something graphical.

Another way to manipulate colors and screen content was to directly write in the video memory and modify what will be seen on screen. This was wery hardware dependend and had to be done through OS and its device driver.


On the other hand, there is a movement to include standard way to create simple graphics as optional part of standard library for supported systems.
Last edited on
OK! Awesome. I think I understand now. Thanks guys!
Topic archived. No new replies allowed.