The first thing to do is to determine the source of the data-will it use files, windows resources, or a custom format ? In what format are the images saved ? Here we will introduce the bitmaps saved in the windows DIB s ( device independent bitmap ) format, In this way, you can use the same method to deal with customized formats in the future.Ĭalling into the drawing looks simple, but in fact it is more complicated than you think. Here, many existing Windows features can help us save a lot of time-for device independence, Windows is good at converting bitmap formats to other formats. These buffers can be used to form the main drawing or switch the drawing.Īfter the drawing is created, if the application does not load data in it, then it is basically useless. It is mainly used as a storage buffer for storing visual parts. The Off-screen drawing cannot be seen directly. The main drawing is what GDI uses to draw the windows user interface. In the term of DrawDraw, the main drawing surface is the current interface that the user can see, and each DirectDraw object has only one main drawing surface. Īll DriectDraw drawings are made CreateSurface begin their life cycle In addition, it does not support high-level functions such as overlay. It does not support low-level operations such as direct access to display memory. The main task of GDI is to provide device independence and a high-level abstraction.
A good display driver can use most of the potential of the graphics card, and supports hardware-accelerated windows operations where possible.
The functions of the DDI layer are developed by hardware manufacturers, who provide display drivers for their products. GDI operates specific graphics hardware through a driver called Display Driver Interface (DDI). GDI provides many device-independent graphics interfaces, which include almost all functions from font processing to bitmap operations. We call this memory non-local display memory.īefore DirectDraw, Windows developers had to use Graphic Device Interface (GDI) to develop applications. By using this port, the display system can quickly access the system memory that has been specially set up, and the data transfer rate through this port is much faster than passing through the bus. The graphics coprocessor cannot access the system memory at all, while the CPU must access the display memory through the bus.īy moving the display system to the other side of the expansion bus and providing it with a port to the system's memory, AGP technology solves the problem of bus congestion and memory usage suitability. Between them is the relatively slow expansion bus. Memory data copy operation (via expansion bus).Īdvances in hardware design technology have brought us two separate memory systems: one for the coprocessor and the other for the CPU. The system memory can be easily accessed by the CPU, but the graphics protocol processor cannot be freely accessed, so the CPU must handle all system memory and display memory. It is used to store all application data. The system memory is physically located in the motherboard. Therefore, the speed of BLT ( bandwidth ) is an important performance indicator of the graphics card. However, BLT operation is still the basis of many other graphics operations.
It can perform a series of functions such as shrinking, stretching, format conversion, and even some coprocessors have specially designed some functions to speed up the operation of windows.
Later, the functions of the graphics coprocessor became more and more complex. It works in parallel with the central processor to move the data in a certain memory to another place. When the hardware bit converter function appears, all the central processor (cpu) needs to do is to establish the bit converter with a few instructions, and then the coprocessor will continue the subsequent graphics operations. Since the most operations for graphics display are to move the content of a certain memory to another memory, the original graphics coprocessor only provides referred to as a bit converter (Blitter) operated - name is lead out of the graphics coprocessor from the primary function, i.e., the BLT ( bit transitions ) obtained in the past. The image coprocessor is mainly used to process the display. The most important part of DirectX is DirectDraw, which is the first component developed by Microsoft, which has a concept image coprocessor. Ddraw can directly operate the video memory, and gdi or your method is to process the memory, and then copy the data from the memory to the video memory, so DDRAW is more efficient than GDI!