P
P
Pavel Padozhnikov2015-08-30 11:16:06
linux
Pavel Padozhnikov, 2015-08-30 11:16:06

How did the graphics come about?

I want to know how operating systems manage (succeeded) to draw graphically. Let me explain what I mean, there is a standard character set KOI-8, with the help of them they made programs on DOS like those in windows (some linux) it turned out to make any graphic model, and it is possible to make a graphical interface in C / C ++, LUA using this method . Yes, maybe someone will say: "Don't reinvent the wheel." But I want to understand how it works and see at least a small example that could draw a circle or square of a given size.
not pseudographics.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2015-08-30
@PaveL152

I will answer to the best of my understanding about displaying graphics on the screen.
Working with graphics is based on working with a raster (matrix) at a low level. Vector graphics are implemented at the program level, above the raster one, in the form of libraries. The same OpenVG, for example, which implements vector graphics in the form of instructions in OpenGL.
In DOS in text mode (80x25, 80x43) everything was displayed in bitmap fonts that covered the range of 256 ASCII characters .
KOI8-R contains pseudographic characters among others. These pseudo-graphics were used for drawing tables, decorating windows, and other things like the "shadow" effect from the window.
Each character is a bit set of pixels: on - off. In DOS, fonts were, I remember, fixed sizes 8x8, 8x16 and were loaded into memory when the OS was loaded.
How to display a sign on the screen: apply an AND mask at a certain position of the sign.
How to display something on the screen: work through interrupts in DOS or with the help of video drivers. Since the OS and drivers (today) are usually written in X, the API is also in C.
Fonts in modern operating systems are often rendered using font rasterizer libraries like FreeType . They output the text mask to the buffer according to the specified font and text. And this buffer is already programmatically applied to the background / texture.

S
Stanislav Makarov, 2015-08-30
@Nipheris

And, all the same, real graphics, I don’t know what for, in general, you remembered these symbols.
There is quite a lot of literature on graphics. It is very difficult to explain this in a nutshell, but I will try:
1) as you have already noticed, there are two fundamentally different ways of representing graphs. information - vector and raster. There is a lot of information about each of them, start with the wiki.
2) there are various graphics APIs and libraries, some of them are platform-specific (like GDI/GDI+/Direct3D on Windows), some are cross-platform, like OpenGL for example. Low-level APIs work directly with drivers and with various system structures to implement the necessary graphical tasks (draw a triangle / rectangle), higher-level libraries can be "add-ons" over low-level APIs and provide other interfaces that are more convenient for the programmer.
3) depending on the task, select the required graphical API/library. For example, large game developers usually need high performance and maximum efficiency of their engines, so they usually take a low-level API like Direct3D / OpenGL (they work fine with C ++, by the way, for D3D this is the "main" language, for OpenGL the main language is C).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question