﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Reiks的技术博客-随笔分类-Direct3D</title><link>http://www.cppblog.com/reiks/category/16915.html</link><description>C/C++/STL/Algorithm/D3D</description><language>zh-cn</language><lastBuildDate>Thu, 19 May 2011 06:36:41 GMT</lastBuildDate><pubDate>Thu, 19 May 2011 06:36:41 GMT</pubDate><ttl>60</ttl><item><title>如何在Direct3D里面使用GDI</title><link>http://www.cppblog.com/reiks/archive/2011/05/19/146744.html</link><dc:creator>reiks</dc:creator><author>reiks</author><pubDate>Thu, 19 May 2011 05:45:00 GMT</pubDate><guid>http://www.cppblog.com/reiks/archive/2011/05/19/146744.html</guid><wfw:comment>http://www.cppblog.com/reiks/comments/146744.html</wfw:comment><comments>http://www.cppblog.com/reiks/archive/2011/05/19/146744.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/reiks/comments/commentRss/146744.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/reiks/services/trackbacks/146744.html</trackback:ping><description><![CDATA[<h3>步骤：</h3>1、用D3D的GetBackBuffer得到一个IDirect3DSurface9<br />2、然后使用IDirect3DSurface9的GetDC接口得到dc<br />3、使用dc绘图<br />4、用IDirect3DSurface9的ReleaseDC释放dc<br /><h3>注意：</h3>1、buffer的格式必须是以下几种之一：<br />D3DFMT_R5G6B5,D3DFMT_X1R5G5B5,D3DFMT_R8G8B8,D3DFMT_X8R8G8B8<br /><br />2、D3DPRESENT_PARAMETERS 的 Flags需要设置D3DPRESENTFLAG_LOCKABLE_BACKBUFFER<br /><br />3、GetDC接口在以下情况下会失败：<br />1）surface已经被锁定了<br />2）surface对应的dc没有被释放<br />3）surface包含在一张texture中，而这个texture中的另一个surface已经被锁定了<br />4）surface存在于default memory pool，并且没有设置dynamic usage flag<br />5）surface存在于scratch pool<br /><h3>参考文献：<br /><p><a href="http://www.xmission.com/~legalize/book/download/04-2D%20Applications.pdf"><font class="Apple-style-span" color="#000000" style="font-weight: normal;">http://www.xmission.com/~legalize/book/download/04-2D%20Applications.pdf</font></a></p></h3><img src ="http://www.cppblog.com/reiks/aggbug/146744.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/reiks/" target="_blank">reiks</a> 2011-05-19 13:45 <a href="http://www.cppblog.com/reiks/archive/2011/05/19/146744.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>