📄 direct3d对象.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0049)http://www.gesoftfactory.com/developer/D3DObj.htm -->
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v =
"urn:schemas-microsoft-com:vml" xmlns:o =
"urn:schemas-microsoft-com:office:office" xmlns:w =
"urn:schemas-microsoft-com:office:word"><HEAD><TITLE>Direct3D对象</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content=Word.Document name=ProgId>
<META content="MSHTML 6.00.2900.3314" name=GENERATOR>
<META content="Microsoft Word 10" name=Originator><LINK
href="D3DObj_files/filelist.xml" rel=File-List><LINK
href="D3DObj_files/editdata.mso" rel=Edit-Time-Data><!--[if !mso]>
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
.shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>SGuy</o:Author>
<o:LastAuthor>SGuy</o:LastAuthor>
<o:Revision>1</o:Revision>
<o:TotalTime>1</o:TotalTime>
<o:Created>2003-05-17T04:06:00Z</o:Created>
<o:LastSaved>2003-05-17T04:07:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>87</o:Words>
<o:Characters>501</o:Characters>
<o:Company>G.E.Studio</o:Company>
<o:Lines>4</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>587</o:CharactersWithSpaces>
<o:Version>10.2625</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:GrammarState>Clean</w:GrammarState>
<w:PunctuationKerning/>
<w:DrawingGridVerticalSpacing>7.8 pt</w:DrawingGridVerticalSpacing>
<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>
<w:Compatibility>
<w:SpaceForUL/>
<w:BalanceSingleByteDoubleByteWidth/>
<w:DoNotLeaveBackslashAlone/>
<w:ULTrailSpace/>
<w:DoNotExpandShiftReturn/>
<w:AdjustLineHeightInTable/>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:UseFELayout/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@font-face {
font-family: 宋体;
}
@font-face {
font-family: @宋体;
}
@page {mso-page-border-surround-header: no; mso-page-border-surround-footer: no; }
@page Section1 {size: 595.3pt 841.9pt; margin: 72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin: 36.0pt; mso-footer-margin: 36.0pt; mso-paper-source: 0; layout-grid: 15.6pt; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-fareast-language: EN-US; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: 宋体
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-fareast-language: EN-US; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: 宋体
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman"; mso-fareast-language: EN-US; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font-family: 宋体
}
SPAN.GramE {
mso-style-name: ""; mso-gram-e: yes
}
DIV.Section1 {
page: Section1
}
</STYLE>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]--></HEAD>
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation; tab-interval: 21.0pt">
<DIV class=Section1 style="LAYOUT-GRID: 15.6pt none">
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1"><A
name=Direct3D对象><B><SPAN lang=EN-US
style="FONT-SIZE: 24pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 18.0pt; mso-fareast-language: ZH-CN">Direct3D对象</SPAN></B></A><B><SPAN
lang=EN-US
style="FONT-SIZE: 24pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-font-kerning: 18.0pt; mso-fareast-language: ZH-CN"><o:p></o:p></SPAN></B></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">
<HR align=center width="100%" SIZE=1>
</SPAN></DIV>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">Microsoft®
Direct3D®是通过组件对象模型(COM)对象和接口实现的。C++应用程序可以直接访问这些接口和对象,而Microsoft Visual
Basic®应用程序则与一层被称为Microsoft DirectX® for Visual Basic Classes的代码进行交互,它们为Visual
Basic应用程序组织数据并传送给DirectX运行库(run time)。<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">Direct3D对象是应用程序第一个创建并最后一个释放的对象。可以通过Direct3D对象访问一些函数,用它们枚举并取得Direct3D设备的能力,这允许应用程序选择设备而无需创建它们。<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">当一个<SPAN
lang=EN-US>C++应用程序启动时,它必须取得一个指向<U>IDirect3D9</U>接口的指针以使用Direct3D的功能。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">以下示例代码显示了如何用<U><SPAN
lang=EN-US>Direct3DCreate9</SPAN></U>函数取得一个指向<SPAN
lang=EN-US>Direct3D接口的指针。<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal
style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">LPDIRECT3D9
g_pD3D = NULL;<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><o:p> </o:p></SPAN></P>
<P class=MsoNormal
style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN
class=GramE><SPAN lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">if(</SPAN></SPAN><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">
NULL == (g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)))<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN
lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN"><SPAN
style="mso-spacerun: yes"> </SPAN><SPAN
class=GramE>return</SPAN> E_FAIL;<o:p></o:p></SPAN></P>
<P class=MsoNormal
style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"><SPAN
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">要从<SPAN
lang=EN-US>Direct3DDevice对象取得创建它的Direct3D对象,可以用<U>IDirect3DDevice9::GetDirect3D</U>方法。<o:p></o:p></SPAN></SPAN></P>
<DIV class=MsoNormal style="TEXT-ALIGN: center" align=center><SPAN lang=EN-US
style="FONT-FAMILY: 宋体; mso-bidi-font-family: 宋体; mso-fareast-language: ZH-CN">
<HR align=center width="100%" SIZE=1>
</SPAN></DIV>
<P class=MsoNormal><SPAN
lang=EN-US><o:p> </o:p></SPAN></P></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -