求几个简单的DirectDraw例子

来源:百度知道 编辑:UC知道 时间:2024/06/21 21:52:17
刚学DirectDraw,想求几个简单的DirectDraw例子研究一下。我邮箱为henvensky@sina.com

Introduction

介绍

In this article I will briefly describe the process of using Windows' functions to load a bitmap (.bmp) file of any type, and place it on a newly-created DirectDraw surface. In this particular article, we will be using the DirectX 7.0 SDK.

在这篇文章里,我将简要叙述一下使用Windows函数来载入任何类型的BMP图象文件数据,并将数据存

放到一个新建立的DirectDraw的表面中。在这以后的篇幅里,我们将使用DirectX 7.0 SDK。

DirectDraw Surface Creation

创建DirectDraw表面

Creating a new DirectDraw surface is very easy, and this function will create a surface of any size. This can also be used as a general-purpose surface creation function, and if you were writing an engine class you'd probably put it in there somewhere.

创建一个DirectDraw表面是非常容易的,这个函数将根据大小来创建一个表面。这同样能用于多种多

样的表面创建函数,如果你要制作一个引擎类,你也许会把这个放在引擎的某处。

Listing 1

代码列表 1

void CreateSurface(LPDIRECTDRAWSURFACE7 *lpSource, int xs, int ys)
<