| Language: | C++ |
| Category: | Multimedia |
| Date: | 2008-09-11 |
| Author: | .NET File Explorer Control |
Since the times when Microsoft was not yet a full-fledged operation system but just a shell to MS-DOS, the GDI had been the programming basis for graphics operations. It was initially a successful technology that made it possible to work with any type of video card. The PC platform employed a variety of video chips, each with different capabilities, and GDI offered a universal way to access their video functions. Even though the technology greatly improved, is still used in Windows.
While universality was definitely a plus, the video performance left a lot to be desired. When I played the Doom game for the first time, I wondered how the game could create such complex scenes on an x396 computer when Windows could not. Of course, the resolution used in the game was lower, but the scenes of the 3D world were more complex. This difference in performance occurs because with the GDI, applications cannot directly access the video card or the video buffer. Allowing them to do this would make it difficult to implement a multi-window system. And while the GDI’s universality is an advantage, it is also a shortcoming, because it does not allow the capabilities of a good video chip to be used to their full extent.
Thus, the slow graphics system made the Windows perform unusable for direct developing games. Even though there were developments directed at speeding up the graphics processing, the effect was much like flogging a dead horse.
To solve this problem, a fundamentally graphics-orientated applications programming interface (API) was needed that address the following main problem areas:
All of these issues were addressed quite efficiently by the DirectX graphics API. This interface is allocated the maximum amount of computer resources and is given direct access to the video buffer if the application runs in the full-screen mode. In my opinion, this is the easiest setup. If a process takes the entire screen, it can be given more resources then if it runs in a window. In the latter case, the OS has to draw everything in background, and graphics is the program’s week spot.
The most difficult task is fully using the video chip’s capabilities. Today PCs are equipped with video cards based on NVIDIA GeForce, ATI Redeon, Matrox, and other video chips, which are not compatible. One video card may support one set of features, and another may support an entirely different set. Moreover, video chips with minimal graphical capabilities exist (e.g., Intel video chips). So how can universally be implemented in this situation? One approach could be to implement in DirectX only those capabilities supported be all video ships; however, something similar was attempted with the GDI, resulting in inferior performance. Another approach would be to implement only those functions considered necessary. However, such a program will not work on all computers, and problems with video cards will arise.
There are only two practical solutions to achieving universality:
Initially, Microsoft chose the first approach, because video accelerators were expensive and far from all computers was equipped with them. The DirectX engine can work in the following modes:
It is better to avoid the HEL mode in production application and use it only during the application development stage. Most modern video chips have hardware implementation for almost all DirectX functions, and there is no need to emulate them programmatically. Emulating complex effects places an overly heavy workload on the central processor, and it may not be able to handle the necessary calculations, resulting in slow graphics output.
In my opinion, DirectX is one of the best technologies for game developing.
: Nice but smallNice but too small. I think it might be more detailed.