第一范文网 - 专业文章范例文档资料分享平台

3D游戏编程入门经典(27)

来源:用户分享 时间:2021-06-02 本文由安之若素 分享 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

/// to allow the application to modify the device settings. the supplied

/// settings parameter contains the settings that the framework has

/// selected for the new device, and the application can make any desired

/// changes directly to this structure. note however that the sample

/// framework will not correct invalid device settings so care must

/// be taken to return valid device settings; otherwise, creating the

/// device will fail.

///

public void modifydevicesettings(devicesettings settings, caps caps)

{

// this application is designed to work on a pure device by not using

// any get methods,so create a pure device if supported and using hwvp.

if ( (caps.devicecaps.supportspuredevice) &&

((settings.behaviorflags & createflags.hardwarevertex

processing) != 0 ) )

settings.behaviorflags |= createflags.puredevice;

}

查看声明的第一个方法,isdeviceacceptable方法。当样本框架忙于枚举系统中的设备时,它为所发现的每一个组合调用了该方法。注意该方法是如何返回一个布尔值的。通过这个返回值可以向样本框架指出该设备是否满足需求。然而,在您查看第一个方法中的代码之前,注意已经声明的第二个方法,modifydevicesettings。在创建设备之前样本框架会调用该方法,使您能够选择您需要的任何选项。仔细选择这些选项,因为这可能造成设备创建失败。

现在,回到第一个方法。首先查看它的参数。第一个参数的类型是caps,是capabilities的缩写。该结构用于保存关于特定设备的信息,这些信息将帮助您确定该设备是否是您希望使用的设备类型。后面两个参数是该设备的专用格式:一个用于反向缓冲区,另一个用于设备的格式。

搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新初中教育3D游戏编程入门经典(27)全文阅读和word下载服务。

3D游戏编程入门经典(27).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/wenku/1204157.html(转载请注明文章来源)
热门推荐
Copyright © 2018-2022 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top