DirectX已经过时了吗? [英] Is DirectX obsolete?

查看:173
本文介绍了DirectX已经过时了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了显然免费的DirectX 9 SDK,全部200多MB

,但是当我读到WPF时,我想知道:DirectX是否过时了?应该

我甚至懒得学习如何使用它?毕竟,最终用户必须在他们的PC上安装DirectX库才能使用你编写的任何

视频播放程序。


WPF甚至使用DirectX吗?或者已经''内置于''WPF / Vista中的DirectX功能(主要是视频和图形内容,可能是通过软件或

硬件加速)?


我想在安装SDK之前知道。


谢谢,


RL


播放视频文件


要播放视频文件,首先要创建一个Video

类的实例。您可以在视频构造函数中指定文件名,如下面的C#代码示例,或者使用

文件名调用Open方法。

[C#]

使用Microsoft.DirectX.AudioVideoPlayback; //不是标准的VS2008

库,必须从MSFT下载

公共类MyVideoPlayer:System.Windows.Forms.Form

{

解决方案

8月25日上午9:49,raylopez99< raylope ... @ yahoo.comwrote:


我刚刚下载了明显免费的DirectX 9 SDK,全部200多MB

,但是当我读到WPF时,我想知道:DirectX已经过时了吗?应该

我甚至懒得学习如何使用它?毕竟,最终用户必须在他们的PC上安装DirectX库才能使用你编写的任何

视频播放程序。


WPF甚至使用DirectX吗?或者已经''内置于''WPF / Vista中的DirectX功能(主要是视频和图形内容,可能是通过软件或

硬件加速)?


我想在安装SDK之前知道。


谢谢,


RL


播放视频文件


要播放视频文件,首先要创建一个Video

类的实例。您可以在视频构造函数中指定文件名,如下面的C#代码示例,或者使用

文件名调用Open方法。

[C#]

使用Microsoft.DirectX.AudioVideoPlayback; //不在标准VS2008

库中,必须从MSFT下载

公共类MyVideoPlayer:System.Windows.Forms.Form

{



绝对不是,虽然之前需要的一些应用程序需要

DirectX,现在可以使用WPF实现更少的代码。

它们存在于API堆栈的不同级别。 WPF(Windows

Presentation Foundation)属于.NET 3.0的

技术,最简单(也是最具政治性的)

您可以将WPF视为一种基于XML的标记语言,用于开发类似于Windows的创作的Adobe Flash,这就是您开发的基于矢量的
矢量引擎使用XML标记语言

(XAML)。 WPF的Web子集是Silverlight,它与桌面WPF共享相同的

标记语言(在UI中创建统一开发),虽然功能减少了。


WPF实际上使用Direct3D曲面进行渲染。相对于

WPF,DirectX是一种低级API,针对高性能图形应用程序(即游戏)进行了特定于平台的调整并且调整了b $ b。 DirectX 11

已经宣布并且已经开始了,微软已经表示它将成为Windows Vista的继任者Windows 7的核心API。 ;。所以DirectX

不会去任何地方(还)如果你想写一个高性能的

3D应用程序DirectX或OpenGL真的是你唯一的两个选择。 $>





IMO他们是不同的技术,并将长期共存。

DirectX是windows中大多数游戏的工具

平台。


>

WPF甚至使用DirectX吗? *或者是否已经''内置于''WPF / Vista中的DirectX功能(主要是视频和图形内容,可能是通过软件或

硬件加速)?



我真的不知道,但我敢打赌WPF使用DirectX。它有

无意创建另一个图形库

你想做什么呢?


raylopez99写道:


我刚刚下载了显然免费的SDK for DirectX 9,所有200多MB

,但是当我读到WPF时我想知道:DirectX已经过时了吗?应该

我甚至懒得学习如何使用它?毕竟,最终用户必须

才能在他们的PC上安装DirectX库,然后才能使用你编写的任何

视频播放程序。



DirectX 9包含在Vista中,并且已经很老了,所以每个人都可以在XP上安装它。不幸的是,DirectX可以部分安装,而且有些系统没有托管位。


WPF是否甚至使用DirectX?或者已经''内置''WPF / Vista的DirectX的功能(主要是视频和图形内容,可能是通过软件或

硬件加速)?



WPF使用Direct3D(DirectX的图形位)。


托管DirectX很好,但死了 - 微软杀了开发

管理DirectX 2并鼓励使用XNA。我不能在XNA上评论

因为我没有使用过它。


WPF为你提供了一个比Direct3D标准管道好的抽象

(嗯...... ish)及其3D内容。性能非常好,你可以在.NET 3.5 SP1中编写自己的像素着色器(最近发布)。

你不能编写自己的顶点着色器通过。我也没有看到一种方法

来手动管理每个纹理存储在哪个池中。


简而言之,你可以从Direct3D获得更好的性能因为你可以使用顶点着色器,你可以手动优化需要通过图形总线发送的数据(这很容易成为3D中的瓶颈) >
应用程序)。

Direct3D的缺点是*严重*但是:

1)在Direct3D中,你做了大量的工作,然后调用设备。当下()。如果

你在任何时候做错了什么,唯一的例外就是抛出

就是DirectXExcption带有一条消息:应用程序错误,

,当你调用Present()时,它几乎总是被抛出。

调试是一场噩梦。

2)Direct3D是非常低级别的。在屏幕上绘制一个三角形,以便在奇怪的事情发生时不会崩溃,需要数百个

的代码行。

3)你必须手动管理不同的

显卡之间的差异(不同的功能可以在不同的图形上使用

卡)。

4 )管理DirectX不再被积极开发(我不是

确定它甚至得到支持)。


Alun Harford


I just downloaded the apparently free SDK for DirectX 9, all 200+ MB
of it, but as I read about WPF I wonder: is DirectX obsolete? Should
I even bother learning how to use it? After all, the end user must
have the DirectX library installed on their PC before they can use any
video playing program you write.

Does WPF even use DirectX? Or are the functions of DirectX (mostly
video and graphics stuff, possibly accelerated via software or
hardware) already ''built into'' WPF/Vista?

I would like to know before I install the SDK.

Thanks,

RL

Playing a Video File

To play a video file, start by creating an instance of the Video
class. You can specify the file name in the Video constructor as in
the following C# code example, or else call the Open method with the
file name.
[C#]
using Microsoft.DirectX.AudioVideoPlayback; //not in standard VS2008
library, must download from MSFT
public class MyVideoPlayer : System.Windows.Forms.Form
{

解决方案

On Aug 25, 9:49 am, raylopez99 <raylope...@yahoo.comwrote:

I just downloaded the apparently free SDK for DirectX 9, all 200+ MB
of it, but as I read about WPF I wonder: is DirectX obsolete? Should
I even bother learning how to use it? After all, the end user must
have the DirectX library installed on their PC before they can use any
video playing program you write.

Does WPF even use DirectX? Or are the functions of DirectX (mostly
video and graphics stuff, possibly accelerated via software or
hardware) already ''built into'' WPF/Vista?

I would like to know before I install the SDK.

Thanks,

RL

Playing a Video File

To play a video file, start by creating an instance of the Video
class. You can specify the file name in the Video constructor as in
the following C# code example, or else call the Open method with the
file name.
[C#]
using Microsoft.DirectX.AudioVideoPlayback; //not in standard VS2008
library, must download from MSFT
public class MyVideoPlayer : System.Windows.Forms.Form
{

Absolutely not, although some applications that would have required
DirectX before can now be implemented using WPF with much less code.
They exist at different levels in the API stack. WPF (Windows
Presentation Foundation) is under the .NET 3.0 umbrella of
technologies, In the most simple (and most inpolitically correct)
terms you can think of WPF as an XML based markup language for
developing Adobe Flash like creations for Windows, that is it''s a
vector based engine that you develop for using an XML markup language
(XAML). The web subset of WPF is Silverlight and it shares the same
markup language as desktop WPF (creating unification in UI
development) albeit with a reduced set of features.

WPF actually uses Direct3D surfaces for its rendering. Relative to
WPF, DirectX is a low-level API which is platform specific and tuned
for high performance graphics applications (namely games). DirectX 11
has been announced and is on it''s way and Microsoft has said it will
be a core API for Windows Vista''s successor "Windows 7". So DirectX
isn''t going anywhere (yet) and if you want to write a high performance
3D application DirectX or OpenGL are really your only two options.






IMO they are different technologies and will coexist for a long time.
DirectX is the tool used for the majority of games in the windows
platform.

>
Does WPF even use DirectX? *Or are the functions of DirectX (mostly
video and graphics stuff, possibly accelerated via software or
hardware) already ''built into'' WPF/Vista?

I do not know really, but I would bet that WPF uses DirectX. It has
no sense to create another graphic library
What you want to do though?


raylopez99 wrote:

I just downloaded the apparently free SDK for DirectX 9, all 200+ MB
of it, but as I read about WPF I wonder: is DirectX obsolete? Should
I even bother learning how to use it? After all, the end user must
have the DirectX library installed on their PC before they can use any
video playing program you write.

DirectX 9 is included in Vista, and is so old that practially everybody
will have it installed on XP. Unfortunately, DirectX can be partially
installed and some systems don''t have the managed bits.

Does WPF even use DirectX? Or are the functions of DirectX (mostly
video and graphics stuff, possibly accelerated via software or
hardware) already ''built into'' WPF/Vista?

WPF uses Direct3D (the graphics bit of DirectX).

Managed DirectX is nice, but dead - Microsoft killed the development of
Managed DirectX 2 and encourages the use of XNA. I can''t really comment
on XNA as I''ve not used it.

WPF gives you a nice abstraction over the Direct3D standard pipeline
(well... ish) with its 3D stuff. Performance is pretty good, and you can
write your own pixel shaders in .NET 3.5 SP1 (very recently released).
You can''t write your own vertex shaders through. I also don''t see a way
to manually manage which pool each texture are stored in.

In short, you can get better performance from Direct3D because you can
use vertex shaders and you can manually optimise what data needs to be
sent over the graphics bus (which can easily be the bottleneck in a 3D
application).
The disadvantages of Direct3D are *serious* though:
1) In Direct3D, you do a load of work and then call Device.Present(). If
you''ve done something wrong at any point, the only exception that is
ever thrown is DirectXExcption with a message: "Error in application",
and it will pretty much always be thrown when you call Present().
Debugging is a nightmare.
2) Direct3D is very low level. Drawing a triangle on the screen in a
robust way that won''t crash when odd things happen takes hundreds of
lines of code.
3) You have to manually manage the differences between different
graphics cards (different features are avaliable on different graphics
cards).
4) Managed DirectX is no longer being actively developed (and I''m not
sure it''s even supported).

Alun Harford


这篇关于DirectX已经过时了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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