Advertisement
2002C DirectX #14457

DirectX BASIC Tutorial

I am just trying to learn DirectX 8.0 right now. I am finding it tough even with ome really good tutorials. I thought there might be some other people in the same situation so here is a simple tutorial on the very basics of programming with DirectX 8.0. Hope you find this useful. Please leave feedback so that I can hopefully improve it for the future.

AI

Resumen de IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Código fuente
original-source
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name="Microsoft Theme 2.00" content="blueprnt 011">
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./Learn%20DirectX%208_files/filelist.xml">
<title>Learn DirectX 8</title>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
 <o:Author> Thomas Waddell</o:Author>
 <o:LastAuthor> Thomas Waddell</o:LastAuthor>
 <o:Revision>1</o:Revision>
 <o:TotalTime>99</o:TotalTime>
 <o:Created>2001-06-14T18:48:00Z</o:Created>
 <o:LastSaved>2001-06-14T20:27:00Z</o:LastSaved>
 <o:Pages>4</o:Pages>
 <o:Words>1332</o:Words>
 <o:Characters>7595</o:Characters>
 <o:Lines>63</o:Lines>
 <o:Paragraphs>15</o:Paragraphs>
 <o:CharactersWithSpaces>9327</o:CharactersWithSpaces>
 <o:Version>9.3821</o:Version>
 </o:DocumentProperties>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:"Century Gothic";
	panose-1:2 11 5 2 2 2 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:647 0 0 0 159 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Century Gothic";
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";
	color:#003399;}
h1
	{mso-style-next:Normal;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:24.0pt;
	font-family:"Century Gothic";
	color:#660066;
	mso-font-kerning:0pt;
	font-weight:normal;}
h2
	{mso-style-next:Normal;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:2;
	font-size:18.0pt;
	font-family:"Century Gothic";
	color:#660066;
	font-weight:normal;
	text-decoration:underline;
	text-underline:single;}
h3
	{mso-style-next:Normal;
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:3;
	font-size:14.0pt;
	font-family:"Century Gothic";
	mso-bidi-font-family:Arial;
	color:#660066;
	font-weight:normal;
	mso-bidi-font-weight:bold;}
h4
	{mso-style-next:Normal;
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:4;
	font-size:12.0pt;
	font-family:"Century Gothic";
	color:#660066;
	font-weight:normal;
	mso-bidi-font-weight:bold;}
h5
	{mso-style-next:Normal;
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:5;
	font-size:10.0pt;
	font-family:"Century Gothic";
	color:#660066;
	font-weight:normal;
	mso-bidi-font-weight:bold;
	mso-bidi-font-style:italic;}
h6
	{mso-style-next:Normal;
	margin-top:12.0pt;
	margin-right:0cm;
	margin-bottom:3.0pt;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:6;
	font-size:8.0pt;
	font-family:"Century Gothic";
	color:#660066;
	font-weight:normal;
	mso-bidi-font-weight:bold;}
p.MsoHeading7, li.MsoHeading7, div.MsoHeading7
	{mso-style-next:Normal;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:7;
	font-size:22.0pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:purple;
	text-decoration:underline;
	text-underline:single;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:center;
	mso-pagination:widow-orphan;
	font-size:22.0pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Century Gothic";
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";
	color:red;}
p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	text-indent:36.0pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Century Gothic";
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";
	color:#003399;}
a:link, span.MsoHyperlink
	{color:#3366FF;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:#9900FF;
	text-decoration:underline;
	text-underline:single;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
@list l0
	{mso-list-id:507139514;
	mso-list-type:hybrid;
	mso-list-template-ids:630850502 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
	{mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
 <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white background="./Learn%20DirectX%208_files/image001.gif"
lang=EN-GB link="#3366ff" vlink="#9900ff" style='tab-interval:36.0pt'>
<!--[if gte mso 9]><xml>
 <v:background id="_x0000_s1025" o:bwmode="white" o:targetscreensize="800,600">
 <v:fill src="./Learn%20DirectX%208_files/image001.gif" o:title="blutextb"
  type="frame"/>
 </v:background></xml><![endif]-->
<div class=Section1>
<p class=MsoTitle><a name="_top"></a><u><span style='font-size:24.0pt;
mso-bidi-font-size:12.0pt;font-family:"Times New Roman";color:navy'>Learn
DirectX 8.0<o:p></o:p></span></u></p>
<p class=MsoNormal align=center style='text-align:center'><span
style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";
color:red'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:red'>Contents:<o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:navy'>1. <a href="#_Getting_started_1">Introduction</a><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:navy'>2. <a href="#_Getting_started_1">Getting started</a><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:navy'>3. <a href="#_Declarations_1">Declarations</a><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:navy'>4. <a href="#_Initialisation_1">Initialisation</a><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:navy'>5. <a href="#_Initialisation_1">Rendering</a><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:navy'>6. <a href="#_Initialisation_1">Main loop</a><o:p></o:p></span></p>
<p class=MsoNormal style='text-align:justify'><span style='font-family:"Times New Roman";
color:navy'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<h1 align=center style='text-align:center'><a name="_INTRODUCTION"></a><u><span
style='font-size:22.0pt;mso-bidi-font-size:24.0pt;font-family:"Times New Roman";
color:purple'>Introduction<o:p></o:p></span></u></h1>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><span
style='mso-tab-count:1'>            </span>DirectX is a very powerful Tool or
creating amazing graphics and effects. If you like making games or animations
then DirectX is what you are looking for. The newest version, DirectX 8.0, can
support everything from drawing <span style='mso-tab-count:1'>      </span>3D
shapes, right up to creating the lighting and shading effects on them. To give
you some idea of the power behind DirectX consider the fact that many of the
most popular PC games harvest the power and peed of DirectX. Just think, you
too could achieve graphics such as that in Unreal Tournament one day. <o:p></o:p></span></p>
<h2><a name="_Declarations"></a><a name="_Requirements"></a><a
name="_Getting_started"></a><span style='font-size:12.0pt;mso-bidi-font-size:
18.0pt;font-family:"Times New Roman";color:windowtext;text-decoration:none;
text-underline:none'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></h2>
<h2><a name="_Getting_started_1"></a><span style='font-family:"Times New Roman";
color:purple'>Getting started<o:p></o:p></span></h2>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><span
style='mso-tab-count:1'>            </span>Before you even begin bare in mind
that you should have a reasonable knowledge of visual basic. If not then learn
something a bit easier. I will assume that you do have a reasonable knowledge
of Visual Basic. In order to make a DirectX 8.0 project, you must have the
necessary components installed including the Dll files and type libraries.
First open up a new project in visual basic. A standard exe will do perfectly
well. On the &#8220;Projects&#8221; menu on the menu bar, select &#8220;References&#8221; near the
bottom. A large list should appear. Look for the &#8220;DirectX 8.0 for visual basic
type library&#8221;. Once you have found it, check the box net to it and click &#8220;OK&#8221;.
If you don&#8217;t see it then you don&#8217;t have DirectX 8.0 Installed. You can download
it <a href="http://www.microsoft.com/directx/homeuser/downloads/default.asp">here</a>.
(Also worth mentioning that the visual basic DirectX SDK is also downloadable <a
href="http://www.msdn.microsoft.com/downloads/default.asp?URL=/code/topic.asp?URL=/msdn-files/028/000/114/topic.xml">here</a>.
I recommend it.) If you succeed in loading the type library then Visual basic
will now be able to recognise every single Type Structure, Constant and
Variable that exists in DirectX 8.0. You are now ready to create a DirectX 8.0
application. If your lost right now then give it up now and go back to bed!<o:p></o:p></span></p>
<p class=MsoNormal align=center style='text-align:center'><u><span
style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";
color:red'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></u></p>
<h2><a name="_Declarations_1"></a><span style='font-family:"Times New Roman"'>Declarations<o:p></o:p></span></h2>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><span
style='mso-tab-count:1'>            </span>Well done you made it this far. Be
warned, it gets hard from here now. To get a direct reference to DirectX you
must create it as an object. This will be your master object so to speak. O.K.
You should have a standard exe in Visual Basic with a reference to DirectX by
now. Name your form &#8220;FrmMain&#8221;. Copy and paste this code into the declarations
section of the form code window and then I will try to explain some of it.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Option
Explicit </span><span style='font-family:"Times New Roman";color:#339966'>&#8216;DirectX
likes all its variables to be declared first. This makes sure we declare them
all first</span><span style='font-family:"Times New Roman";color:blue'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> DX </span><span style='font-family:"Times New Roman";
color:blue'>As</span><span style='font-family:"Times New Roman"'> </span><span
style='font-family:"Times New Roman";color:blue'>New</span><span
style='font-family:"Times New Roman"'> DirectX8<span style="mso-spacerun:
yes">  </span></span><span style='font-family:"Times New Roman";color:#339966'>&#8216;This
is the main DirectX object. You will notice that when you press the spacebar
after you type &#8220;As&#8221; that the list of variables and types appears. You can have
a look at the hundreds of DirectX Type structures and types here.</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> D3D </span><span style='font-family:
"Times New Roman";color:blue'>As</span><span style='font-family:"Times New Roman"'>
Direct3D8<span style="mso-spacerun: yes">  </span></span><span
style='font-family:"Times New Roman";color:#339966'>&#8216;This is your Direct 3D
object. A small part of DirectX. This also explains why you don&#8217;t need to set
it as a &#8220;New&#8221; object. It is part of DirectX! </span><span style='font-family:
"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> D3DDevice </span><span style='font-family:
"Times New Roman";color:blue'>As</span><span style='font-family:"Times New Roman"'>
Direct3DDevice8 </span><span style='font-family:"Times New Roman";color:#339966'>&#8216;This
is the device we will use. It can be hardware or software.</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> Running </span><span style='font-family:
"Times New Roman";color:blue'>As</span><span style='font-family:"Times New Roman"'>
</span><span style='font-family:"Times New Roman";color:blue'>Boolean </span><span
style='font-family:"Times New Roman";color:#339966'>&#8216;This stores whether
DirectX is running or not. You will see why later</span><span style='font-family:
"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Private</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Declare</span><span style='font-family:"Times New Roman"'> </span><span
style='font-family:"Times New Roman";color:blue'>Function</span><span
style='font-family:"Times New Roman"'> GetTickCount </span><span
style='font-family:"Times New Roman";color:blue'>Lib</span><span
style='font-family:"Times New Roman"'> &quot;kernel32&quot; () </span><span
style='font-family:"Times New Roman";color:blue'>As</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Long</span><span style='font-family:"Times New Roman";color:#339966'>
&#8216;If you know windows API then you will know what this line means. It gets our
frame. </span><span style='font-family:"Times New Roman";color:green'>This</span><span
style='font-family:"Times New Roman";color:#339966'> isn&#8217;t required; it just
adds a nice little touch.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:green'>&#8216;Just
some variables to hold the frame rates. If you don&#8217;t want to include a frame
rate then leave these out too</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> LastTimeCheckFPS </span><span
style='font-family:"Times New Roman";color:blue'>As</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Long</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> FramesDrawn </span><span
style='font-family:"Times New Roman";color:blue'>As</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Long</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><span style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> FrameRate </span><span style='font-family:
"Times New Roman";color:blue'>As</span><span style='font-family:"Times New Roman"'>
</span><span style='font-family:"Times New Roman";color:blue'>Long</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoNormal><u><span style='font-family:"Times New Roman";color:red'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></u></p>
<p class=MsoNormal><span style='font-family:"Times New Roman"'>Well that is DirectX
all declared now let&#8217;s go on&#8230;<o:p></o:p></span></p>
<p class=MsoHeading7><a name="_Initialisation"></a><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
<p class=MsoHeading7><a name="_Initialisation_1"></a>Initialisation</p>
<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'>The next
step is to Initiate DirectX. All this means is that you will set what
Hardware/Software you want to use and set all the objects. Again copy and paste
the following.<o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Public</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Function</span><span style='font-family:"Times New Roman"'>
InitDX() </span><span style='font-family:"Times New Roman";color:blue'>As</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Boolean </span><span style='font-family:"Times New Roman";
color:green'>&#8216;The initialisation function will return true if successful or
false if an error occurred<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>On</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Error</span><span style='font-family:"Times New Roman"'> </span><span
style='font-family:"Times New Roman";color:blue'>GoTo</span><span
style='font-family:"Times New Roman"'> ErrHandler </span><span
style='font-family:"Times New Roman";color:green'>&#8216;If an error did occur go to
the error handler</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> DispMode </span><span style='font-family:
"Times New Roman";color:blue'>As</span><span style='font-family:"Times New Roman"'>
D3DDISPLAYMODE<span style="mso-spacerun: yes">  </span></span><span
style='font-family:"Times New Roman";color:green'>&#8216;The display mode we will use</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Dim</span><span
style='font-family:"Times New Roman"'> D3DWindow </span><span style='font-family:
"Times New Roman";color:blue'>As</span><span style='font-family:"Times New Roman"'>
D3DPRESENT_PARAMETERS </span><span style='font-family:"Times New Roman";
color:green'>&#8216;The window we will use</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Set</span><span
style='font-family:"Times New Roman"'> DX = </span><span style='font-family:
"Times New Roman";color:blue'>New</span><span style='font-family:"Times New Roman"'>
DirectX8 </span><span style='font-family:"Times New Roman";color:green'>&#8216;Set
the DirectX object</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Set</span><span
style='font-family:"Times New Roman"'> D3D = DX.Direct3Dcreate </span><span
style='font-family:"Times New Roman";color:green'>&#8216;Set the direct3D object</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='margin-left:36.0pt;text-align:
left;text-indent:0cm'><span style='font-family:"Times New Roman"'>D3D.GetAdapterDisplayMode
D3DADAPTER_DEFAULT, DispMode </span><span style='font-family:"Times New Roman";
color:green'>&#8216;Set the display mode to the default </span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'>D3DWindow.Windowed = 1 </span><span
style='font-family:"Times New Roman";color:green'>&#8216;We want it in a window, not
full screen</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='margin-left:36.0pt;text-align:
left;text-indent:0cm'><span style='font-family:"Times New Roman"'>D3DWindow.SwapEffect
= D3DSWAPEFFECT_COPY_VSYNC </span><span style='font-family:"Times New Roman";
color:green'>&#8216;We draw all our graphics into a piece of memory, then when
finished, swap the memory location pointers of the memory of what will go to
the screen and where we drew our graphics. This makes sure that our graphics
are all drawn before they go to the screen. Fast and flicker free. This just
sets the swap mode.</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='margin-left:36.0pt;text-align:
left;text-indent:0cm'><span style='font-family:"Times New Roman"'>D3DWindow.BackBufferFormat
= DispMode.Format </span><span style='font-family:"Times New Roman";color:green'>&#8216;The
backbuffer is this area of memory where we draw our graphics. Just set it to
the same format as the display mode</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:blue'>Set</span><span
style='font-family:"Times New Roman"'> D3Ddevice =
D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,FrmMain.hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow) </span><span style='font-family:
"Times New Roman";color:green'>&#8216;This line is a bit complicated and will be
explained below<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'>InitDX = </span><span style='font-family:
"Times New Roman";color:blue'>True </span><span style='font-family:"Times New Roman";
color:green'>&#8216;If we get here we have succeeded so set the function to true<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Exit</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Function</span><span style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman"'>ErrHandler:<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'>InitDX = </span><span style='font-family:
"Times New Roman";color:blue'>False </span><span style='font-family:"Times New Roman";
color:green'>&#8216;If we end up here, something has gone wrong, set the function to
false<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman";color:blue'>End</span><span style='font-family:"Times New Roman"'>
</span><span style='font-family:"Times New Roman";color:blue'>Function<o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman";color:blue'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman"'>The line &#8220;</span><span style='font-family:
"Times New Roman";color:blue'>Set</span><span style='font-family:"Times New Roman"'>
D3Ddevice = D3D.CreateDevice (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, FrmMain.hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING, D3DWindow)&#8221; is a bit complex, so I will
explain it in more detail. The backbone of it is:</span><i><span
style='font-size:10.0pt;font-family:"Times New Roman"'> <o:p></o:p></span></i></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><i><span
style='font-size:10.0pt;font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></i></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><i><span
style='mso-bidi-font-size:10.0pt;font-family:"Times New Roman"'>&#8220;object.CreateDevice(Adapter
As Long, DeviceType As CONST_D3DDEVTYPE, hFocusWindow As Long, BehaviorFlags As
Long, PresentationParameters As D3DPRESENT_PARAMETERS) As Direct3DDevice8&#8221;<o:p></o:p></span></i></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><i><span
style='font-size:10.0pt;font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></i></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><b><span
style='mso-bidi-font-size:10.0pt;font-family:"Times New Roman"'>Adapter</span></b><span
style='mso-bidi-font-size:10.0pt;font-family:"Times New Roman"'> : This is
either primary or secondary. D3DADAPTER_DEFAULT always represents the primary
adapter; we'll cover the usage of secondary adapters in a later lesson.
Basically all they do is switch between a primary video card (a standard 2D/3D
card) or a secondary card (such as the 3D-only voodoo 1's and 2's)<br>
<b>DeviceType </b>: This basically allows you to choose between the HAL
(Hardware Accelerator) and the reference rasterizer (A debugging tool). Specify
either D3DDEVTYPE_HAL or D3DDEVTYPE_REF. Bare in mind that if there is no
support for the HAL available this call will fail and you won&#8217;t create a
device.<br>
<b>hFocusWindow </b>: This is just a value that DirectX can use to track your
applications status. This value comes from the Form.hWnd value; the value
specified must be a valid, created form with nothing fancy about it.<br>
<b>BehaviorFlags</b>: This just sets how the Direct3D engine processes
textures, vertices, lighting and so on. The best option to use here would be
D3DCREATE_PUREDEVICE - but very few graphics cards will support this (even the
relatively ones), using this option will mean that the 3D card does almost
everything - transformation, shading, lighting, texturing and rasterization. If
you can't use this on you're hardware the next best thing will be
D3DCREATE_HARDWARE_VERTEXPROCESSING - this uses hardware acceleration as much
as possible. Most recent 3D cards will support this. Failing this you could
try: D3DCREATE_MIXED_VERTEXPROCESSING which will use hardware when possible,
but if the hardware can't handle it then the software components will kick in.
Last of all is the plain software rasterizer; should there be no 3D hardware
available this is likely to be the only option. It's almost always very slow:
D3DCREATE_SOFTWARE_VERTEXPROCESSING.<br>
<b>PresentationParameters </b>: This depicts what display mode you want to use.</span><span
style='font-size:22.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=center style='text-align:center;text-indent:
0cm'><span style='font-size:22.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=center style='text-align:center;text-indent:
0cm'><u><span style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:
"Times New Roman";color:purple'>Rendering<o:p></o:p></span></u></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman"'><span style='mso-tab-count:1'>            </span>You
will call this sub to draw your graphics. This can be 1000s of lines long in
applications with plentiful and complex graphics.<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman";color:blue'>Public</span><span style='font-family:"Times New Roman"'>
</span><span style='font-family:"Times New Roman";color:blue'>Sub</span><span
style='font-family:"Times New Roman"'> Render() <o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman";color:blue'>On</span><span style='font-family:"Times New Roman"'>
</span><span style='font-family:"Times New Roman";color:blue'>Error</span><span
style='font-family:"Times New Roman"'> GoTo ErrHandler </span><span
style='font-family:"Times New Roman";color:green'>&#8216;In the event of an error</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'>D3DDevice.Clear
0, </span><span style='font-family:"Times New Roman";color:blue'>ByVal</span><span
style='font-family:"Times New Roman"'> 0, D3DCLEAR_TARGET, VbBlue, 1#, </span><span
style='font-family:"Times New Roman";color:blue'>ByVal</span><span
style='font-family:"Times New Roman"'> 0 </span><span style='font-family:"Times New Roman";
color:green'>&#8216;We must clear away the current scene before we can draw the next.
You can try other colours instead of VbBlue</span><span style='font-family:
"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'>D3DDevice.BeginScene
<o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman"'><span style='mso-tab-count:2'>                        </span></span><span
style='font-family:"Times New Roman";color:green'>&#8216;All Graphics drawing will go
in here<o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'>D3DDevice.EndScene<o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'>D3DDevice.Present
ByVal 0, ByVal 0, 0, ByVal 0 </span><span style='font-family:"Times New Roman";
color:green'>&#8216;And draw the scene and flip it.<o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman";
color:green'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman";color:blue'>Exit</span><span style='font-family:"Times New Roman"'>
</span><span style='font-family:"Times New Roman";color:blue'>Sub</span><span
style='font-family:"Times New Roman"'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent style='text-indent:0cm'><span style='font-family:
"Times New Roman"'>ErrHandler:<o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'>Running
= </span><span style='font-family:"Times New Roman";color:blue'>False </span><span
style='font-family:"Times New Roman";color:green'>&#8216; Uh oh error, break the loop
and get out<o:p></o:p></span></p>
<p class=MsoBodyTextIndent><span style='font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>End</span><span
style='font-family:"Times New Roman"'> </span><span style='font-family:"Times New Roman";
color:blue'>Sub<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=center style='text-align:center;text-indent:
0cm'><span style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";
color:blue'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=center style='text-align:center;text-indent:
0cm'><u><span style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:
"Times New Roman";color:purple'>Main Loop<o:p></o:p></span></u></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:windowtext'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:windowtext'><span style='mso-tab-count:
1'>            </span>The main loop goes in the form load section <o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:windowtext'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Private</span><span
style='font-family:"Times New Roman";color:windowtext'> </span><span
style='font-family:"Times New Roman";color:blue'>Sub</span><span
style='font-family:"Times New Roman";color:windowtext'> Form_Load()<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'>Me.Show </span><span
style='font-family:"Times New Roman";color:green'>&#8216;You must show the form first</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'>Running = InitDX </span><span
style='font-family:"Times New Roman";color:green'>&#8216;Initialise DirectX<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:blue'>While</span><span
style='font-family:"Times New Roman";color:windowtext'> Running </span><span
style='font-family:"Times New Roman";color:green'>&#8216;Set up a tight loop</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span>Render </span><span style='font-family:
"Times New Roman";color:green'>&#8216;Render scene<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span>DoEvents </span><span style='font-family:
"Times New Roman";color:green'>&#8216;Let windows do its stuff</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:green'>&#8216;All for frame rate<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span></span><span style='font-family:"Times New Roman";
color:blue'>If</span><span style='font-family:"Times New Roman";color:windowtext'>
GetTickCount - LastTimeCheckFPS &gt;= 1000 </span><span style='font-family:
"Times New Roman";color:blue'>Then</span><span style='font-family:"Times New Roman";
color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">        </span>LastTimeCheckFPS = GetTickCount<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">        </span>FrameRate = FramesDrawn<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">        </span>FramesDrawn = 0<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">        </span>Me.Caption = &quot;DirectX-Graphics:
Lesson 01<span style="mso-spacerun: yes">   </span>{&quot; &amp; FrameRate
&amp; &quot;fps}&quot;<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span></span><span style='font-family:"Times New Roman";
color:blue'>End</span><span style='font-family:"Times New Roman";color:windowtext'>
</span><span style='font-family:"Times New Roman";color:blue'>If</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span>FramesDrawn = FramesDrawn + 1<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:blue'>Wend</span><span
style='font-family:"Times New Roman";color:green'> &#8216;End loop</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:green'>&#8216; Release variables<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:blue'>Set</span><span
style='font-family:"Times New Roman";color:windowtext'> DX = </span><span
style='font-family:"Times New Roman";color:blue'>Nothing</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:blue'>Set</span><span
style='font-family:"Times New Roman";color:windowtext'> D3D = </span><span
style='font-family:"Times New Roman";color:blue'>Nothing</span><span
style='font-family:"Times New Roman";color:green'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:blue'>Set</span><span
style='font-family:"Times New Roman";color:windowtext'> D3DDevice = </span><span
style='font-family:"Times New Roman";color:blue'>Nothing</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'>Unload Me<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:blue'>End</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>End</span><span
style='font-family:"Times New Roman";color:windowtext'> </span><span
style='font-family:"Times New Roman";color:blue'>sub</span><span
style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";
color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:green'>&#8216;To exit<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>Private</span><span
style='font-family:"Times New Roman";color:windowtext'> </span><span
style='font-family:"Times New Roman";color:blue'>Sub</span><span
style='font-family:"Times New Roman";color:windowtext'> Form_KeyPress (KeyAscii
</span><span style='font-family:"Times New Roman";color:blue'>As</span><span
style='font-family:"Times New Roman";color:windowtext'> </span><span
style='font-family:"Times New Roman";color:blue'>Integer</span><span
style='font-family:"Times New Roman";color:windowtext'>)<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left'><span
style='font-family:"Times New Roman";color:windowtext'><span
style="mso-spacerun: yes">    </span>Running = </span><span style='font-family:
"Times New Roman";color:blue'>False</span><span style='font-family:"Times New Roman";
color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:blue'>End</span><span
style='font-family:"Times New Roman";color:windowtext'> </span><span
style='font-family:"Times New Roman";color:blue'>Sub</span><span
style='font-family:"Times New Roman";color:windowtext'><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:windowtext'><span style='mso-tab-count:
1'>            </span><o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><span
style='font-family:"Times New Roman";color:windowtext'>And that&#8217;s it. I know
the graphics are really not anything at all to be honest. I will hopefully be
including a future tutorial on how to set up simple graphics. This is just
designed to show you how to set up DirectX. You will always use this type of set-up
no matter how complex an application you make. Leave feedback so that I know
what to change and what to keep.<o:p></o:p></span></p>
<p class=MsoBodyTextIndent align=left style='text-align:left;text-indent:0cm'><u><span
style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman";
color:navy'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></u></p>
<p class=MsoBodyTextIndent align=center style='text-align:center;text-indent:
0cm'><u><span style='font-size:22.0pt;mso-bidi-font-size:12.0pt;font-family:
"Times New Roman";color:blue'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></u></p>
</div>
</body>
</html>
Comentarios originales (3)
Recuperado de Wayback Machine