DirectX Programmer's Reference Components

11 篇文章 0 订阅

标题取自MSDN for VC6(另外MSDN中Platform SDK/Graphics and Multimedia Services/GDI/OpenGL中有OpenGL相关资料)

DirectX包含下面几个组件:

DirectDraw、DirectSound、DirectPlay、Direct3D、DirectInput、DirectSetup和AutoPlay(MSDN for VC6)

在MSDN for VS 2005中,可以看到DirectMusic、DirectPlay Voice、DirectShow等组件,不知道有没有重复,没有深入地了解。

DrectDraw

DirectDraw is a software interface that provides direct access to display devices while maintaining compatibility with the Windows graphics device interface (GDI). It is not a high-level application programming interface (API) for graphics. DirectDraw provides a device-independent way for games and Windows subsystem software, such as 3-D graphics packages and digital video codecs, to gain access to the features of specific display devices.

      DirectDraw是一套类似GDI(兼容GDI)的software interface,能充分利用硬件加速——在计算机中通过把计算量非常大的工作分配给专门的硬件来处理来减轻中央处理器的工作量的技术。

Device-Independent Bitmaps

Windows, and therefore DirectX, uses the Device-Independent Bitmap (DIB) as its native graphics file format. Essentially, a DIB is a file that contains information describing an image's dimensions, the number of colors it uses, values describing those colors, and data that describes each pixel.  For example, the following application-defined function, taken from the ddutil.cpp file that comes with the DirectX APIs in the Platform SDK, combines Win32 and DirectX functions to load a DIB onto a DirectX surface.

Bitmaps与GDI中Bitmaps(VC中DDB与DIB位图编程)类似。

Drawing Surfaces

On the other hand, DirectDraw can give you drawing surfaces that represent actual video memory. This means that when you use DirectDraw, you can write directly to the memory on the video card, making your graphics routines extremely fast. These surfaces are represented as contiguous blocks of memory, making it easy to perform addressing within them.

GDI也是与设备无关,但是GDI没有充分利用如显卡等硬件的硬件加速。

A surface, or DirectDrawSurface object, represents a linear area of display memory. A surface usually resides in the display memory of the display card, although surfaces can exist in system memory.Unless specifically instructed otherwise during the creation of the DirectDrawSurface object, DirectDraw object will put the DirectDrawSurface object wherever the best performance can be achieved given the requested capabilities. DirectDrawSurface objects can take advantage of specialized processors on display cards, not only to perform certain tasks faster, but to perform some tasks in parallel with the system CPU.

DirectDrawSurface Object可以充分利用显卡(类似GPU编程?),不仅仅是更快地完成指定的计算任务(perform certain tasks faster),还能与CPU一起完成并行计算。

可以使用IDirectDraw2::CreateSurface来创建DirectDrawSurface Object,包括IDirectDrawSurface3.

 

From this illustration, you can see that all surface are created by a DirectDraw object and are often used closely with palettes. Although each surface object can be assigned a palette, palettes aren't required for anything but primary surfaces that use pixel formats of 8-bits in depth or less.

 

 DirectDrawSurface可以附加到不同的Palette(调色板?)上。

DirectDrawSurface objects expose their functionality through the IDirectDrawSurface, IDirectDrawSurface2, and IDirectDrawSurface3 interfaces. The IDirectDrawSurface interface is the oldest version of the interface and is provided by default when you create a surface by using the IDirectDraw2::CreateSurface method.

DirectDrawSurface对象的功能都是通过IDirectDrawSurface的接口来提供的。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
最新版OpenGL 2.1 Reference 函数速查手册CHM格式 ------------ 1992年7月,SGI公司发布了OpenGL的1.0版本,随后又与微软公司共同开发了Windows NT版本的OpenGL,从而使一些原来必须在高档图形工作站上运行的大型3D图形处理软件也可以在微机上运用。1995年OpenGL的1.1版本面市,该版本比1.0的性能有许多提高,并加入了一些新的功能。其中包括改进打印机支持,在增强元文件中包含OpenGL的调用,顶点数组的新特性,提高顶点位置、法线、颜色、色彩指数、纹理坐标、多边形边缘标识的传输速度,引入了新的纹理特性等等。OpenGL 1.5又新增了“OpenGL Shading Language”,该语言是“OpenGL 2.0”的底核,用于着色对象、顶点着色以及片断着色技术的扩展功能。   OpenGL 2.0标准的主要制订者并非原来的SGI,而是逐渐在ARB中占据主动地位的3DLabs。2.0版本首先要做的是与旧版本之间的完整兼容性,同时在顶点与像素及内存管理上与DirectX共同合作以维持均势。OpenGL 2.0将由OpenGL 1.3的现有功能加上与之完全兼容的新功能所组成(如图一)。借此可以对在ARB停滞不前时代各家推出的各种纠缠不清的扩展指令集做一次彻底的精简。此外,硬件可编程能力的实现也提供了一个更好的方法以整合现有的扩展指令。 OpenGL 2.1版相比2.0版主要的更新包括: 1. GLSL升级至1.2版 2. 支持非正方形的矩阵. UniformMatrix {2x3,3x2,2x4,4x2,3x4,4x3}fv 3. 象素缓冲对象(Pixel Buffer Object). 它扩充了缓冲对象的接口.现在缓冲区对象可以支持顶点数组和象素数据了.象素缓冲对象能加速在GPU内存中进行的缓冲区之间的数据拷贝及其他象素操作. 4. sRGB纹理. 遵循IEC 61966-2-1.标准的sRGB颜色空间的纹理格式(包括压缩和非压缩格式).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值