DirectX实际上做了什么? [英] What does DirectX actually do?

查看:122
本文介绍了DirectX实际上做了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,Windows为开发人员提供的处理图形和显示它们的唯一API是GDI(图形设备接口)和任何其他简化此工作的库也基于GDI,如System.Drawings(在.net中)框架)...那么究竟什么是DirectX?



它是否也简化了GDI的高级功能?



TIA

解决方案

DirectX是GDI的替代品,速度更快。此外,尽管GDI和DirectX可以一起使用,但它们很难共存。要看到它,就足以将一些GDI对象置于其上,比如基于DirectX的视频并看看会发生什么。为了解决此类冲突,存在一个布局管理器,它是DirectX的一部分,而不是GDI的一部分。



GDI非常间接,DirectX更直接相关硬件。 GDI和GDI +与Windows和Windows消息紧密相关,但DirectX则不然。它可以在不同的平台上使用,并且由许多硬件模型支持,这有助于加速图形。因此,DirectX图形趋于快速;和GDI图形趋于缓慢。



DirectX很好地封装在WPF的托管纯OOP接口中,几乎完全基于在DirectX上,因此也与Windows没有密切关系。 WPF仅在主要输入事件级别和窗口顶层使用Windows API,但窗口的内部内容根本不使用消息泵送,而纯粹的.NET事件系统将替换它。从这个意义上讲,WPF可以被视为GDI的替代品,对GDI架构问题进行了严格审查。



-SA

As i know the only API that windows provides to developers for working with graphics and displaying them is GDI(Graphic Device Interface) and any other library that simplifies this work is also based on GDI such as System.Drawings(in .net framework)... so What is actually DirectX?

Does it also simplifies advanced functionalities of GDI?

TIA

解决方案

DirectX is the way alternative to GDI, a faster one. Moreover, even though GDI and DirectX can be used together, they poorly live together. To see it, it's enough to put some GDI object on top of, say DirectX-based video and see what happens. For resolving such clashes, a layout manager exists, which is a part of DirectX, not a part of GDI.

GDI is very indirect, DirectX is more directly related to hardware. GDI and GDI+ are tightly related to Windows and Windows messages, but DirectX is not. It can be used on different platforms and is supported by many hardware models, which helps to accelerate graphics a lot. So, DirectX graphics tends to be fast; and GDI graphics tends to be sluggish.

DirectX is nicely encapsulated in the managed pure-OOP interface of WPF, which is almost entirely based on DirectX, and, therefore, also not tightly related to Windows. Windows API is used by WPF only at the level of primary input events and top level of a window, but the inside content of the window does not use message pumping at all, which is replaced by pure .NET event system. In this sense, WPF can be considered as the alternative to GDI, with the GDI architectural problems critically reviewed.

—SA


这篇关于DirectX实际上做了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆