<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3811056640522029104</id><updated>2011-12-21T16:04:49.163+05:30</updated><category term='Misc'/><category term='Tutorial'/><category term='Travel'/><category term='Pong'/><title type='text'>Speedrun's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-6531429967532037579</id><published>2011-12-20T16:00:00.001+05:30</published><updated>2011-12-20T16:06:54.373+05:30</updated><title type='text'>Free Stuff</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This title should get a lot of attention.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;A list of free game libraries  : &lt;a href="http://www.ebonyfortress.com/blog/free-game-development-libraries/" target="_blank"&gt;Free Game Libraries&amp;nbsp;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You are still here instead of going to the link.&lt;br /&gt;Even though the list hasnt been updated in a long time, its still  the most complete list I have found.  There are a ton of entries, and I would say it is pretty comprehensive. It would be nice, if it mentioned if the link/library was still active but you cant win them all.This site breaks entries down into their general category ( 3D Graphics, 2D Graphics, Sound/Music, Networking, Video, Compression, Artificial Intelligence, Math/Physics, Scripting, etc. ), each entry contains a link to the library as well as the license it was released under&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-6531429967532037579?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/6531429967532037579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=6531429967532037579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6531429967532037579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6531429967532037579'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/12/this-title-should-get-lot-of-attention.html' title='Free Stuff'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-1733869982260445371</id><published>2011-12-17T17:31:00.000+05:30</published><updated>2011-12-17T17:31:17.996+05:30</updated><title type='text'>Coding Snippets moved</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Since blogger is cumbersome to post coding snippets, I have decided to create a blog on gamedev.net and will be posting the new tutorials there.&lt;br /&gt;&lt;br /&gt;I will post the link on this blog as well, so that the followers of this blog are aware of the new tutorial&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-1733869982260445371?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/1733869982260445371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=1733869982260445371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1733869982260445371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1733869982260445371'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/12/coding-snippets-moved.html' title='Coding Snippets moved'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-2825267203709615239</id><published>2011-12-16T15:48:00.001+05:30</published><updated>2011-12-17T17:32:49.056+05:30</updated><title type='text'>Memory Link Woes</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;I have posted a new tutorial on memory leak detection on my gamedev blog..&lt;br /&gt;You can read the tutorial&amp;nbsp;&lt;a href="http://www.gamedev.net/blog/1369/entry-2253912-memory-leak-woes/" target="_blank"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-2825267203709615239?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/2825267203709615239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=2825267203709615239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2825267203709615239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2825267203709615239'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/12/memory-link-woes.html' title='Memory Link Woes'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-2812241568827546967</id><published>2011-12-12T13:21:00.001+05:30</published><updated>2011-12-12T13:30:24.294+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Control Control Control</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I recently started coding a generic UI library which could be easily added to Mpong or to any other Game that I decided to make in the future.&lt;br /&gt;So far, I have added the following controls&lt;br /&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;A base control from which all the controls will inherit. This will obviously contain all the common code&lt;/li&gt;&lt;li&gt;Window Control : A basic container for all the other controls&lt;/li&gt;&lt;li&gt;Label Control - For all those static pieces of text that just need to be displayed&lt;/li&gt;&lt;li&gt;Button Control - Press Me, Press Me&lt;/li&gt;&lt;li&gt;TextBox Control - User can finally enter text. Yay&lt;/li&gt;&lt;li&gt;CheckBox Control - Am I true or not?&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;These seemed to be the basic controls that I needed. &amp;nbsp;Currently, they are working fine in my test project. Hopefully, they will continue to work as planned once I have integrated them into the main project&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am still deciding, whether I want to spend time adding more controls like ListBoxes etc or not at this time.&lt;/div&gt;&lt;div&gt;I will be detailing out the workings of the controls over the next few updates.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-2812241568827546967?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/2812241568827546967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=2812241568827546967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2812241568827546967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2812241568827546967'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/12/control-control-control.html' title='Control Control Control'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-3443510742330287205</id><published>2011-11-15T00:00:00.000+05:30</published><updated>2011-11-15T00:00:01.618+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>VS 2008 SP1 standalone iso</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I deployed my project on a new development system and realised that it doesnt work anymore. Quite a bit of functionality was missing. After spending a fair amount of time, I figured that the reason it had stopped working was because I was referring to code added in SP1.&lt;br /&gt;&lt;br /&gt;In any case, I downloaded the installer for VS 2008 SP1 but surprise, surprise - everytime I would need to install SP1, I would have to download the file. Since, this seemed like a less than optimal solution, after a little bit of googling, I found a stand alone iso for the SP.&lt;br /&gt;&lt;br /&gt;For all of you who need it, you can get it from the following link&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=13276"&gt;http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=13276&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-3443510742330287205?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/3443510742330287205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=3443510742330287205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/3443510742330287205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/3443510742330287205'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/11/vs-2008-sp1-standalone-iso.html' title='VS 2008 SP1 standalone iso'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-5039700133144951115</id><published>2011-11-14T13:06:00.001+05:30</published><updated>2011-11-14T15:05:04.775+05:30</updated><title type='text'>Ten things to achieve when starting 3D programming</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I came across this interesting article which gives a nice guideline to learn the basics of 3D programming. This list got me thinking about how I would go about understanding 3D programming. Even though, for the most part my list is the same &amp;nbsp;as the original list, there are a few minor differences.&lt;br /&gt;&lt;br /&gt;So without further ado, here's my list to achieve basic proficiency in 3D programming&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;&lt;b&gt;Build your own custom graphic initialization function.&lt;/b&gt;&lt;br /&gt;This is useful to understand how things are managed internally and will give you more comprehension of what you are doing.&lt;br /&gt;&lt;a href="http://speedrunsdev.blogspot.com/2008/04/tutorial-1-creating-window.html"&gt;Tutorial 1 - Creating window.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://speedrunsdev.blogspot.com/2008/04/tutorial-2-initializing-directx.html"&gt;Tutorial 2 - Initializing Directx.html&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Code a 2D custom Graphic User Interface (GUI)&lt;/b&gt;&lt;br /&gt;This is useful since you can make your custom GUI controls and understand concepts like event handling and event capturing.&lt;br /&gt;&lt;a href="http://speedrunsdev.blogspot.com/2008/10/tutorial-4-displaying-sprites.html"&gt;Tutorial 4 - Displaying Sprites.html&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Implement your own camera.&lt;/b&gt;&lt;br /&gt;This is useful to understand concepts like vector handling, translation matrices, angle conversion, etc&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Understand primary 3D concepts&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Successfully make your own collision algorithm&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Code a 3D model loader&lt;/b&gt;&lt;br /&gt;This is useful to understand how 3D models are saved and how everything it’s drawn in a graphics engine&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Make your custom lighting&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Implement a small particle engine.&lt;/b&gt;&lt;br /&gt;This is useful to understand concepts like particle emitters, particle behavior and bill boarding techniques&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Learn the basics in a 3D modeling software.&lt;/b&gt;&lt;br /&gt;Without this knowledge, you will have to depend on other people to do your first game&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Load and play an animation&lt;/b&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Hopefully, it will help people getting started with 3D programming&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="post-body entry-content" id="post-body-6787767913150641674" style="position: relative; text-align: -webkit-auto; width: 586px;"&gt;You can read the original article here&lt;/div&gt;&lt;div class="post-body entry-content" id="post-body-6787767913150641674" style="line-height: 18px; position: relative; text-align: -webkit-auto; width: 586px;"&gt;&lt;div style="line-height: normal; text-align: left;"&gt;&lt;a href="http://vasilydev.blogspot.com/2011/08/ten-things-to-achieve-when-starting-3d.html"&gt;http://vasilydev.blogspot.com/2011/08/ten-things-to-achieve-when-starting-3d.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-5039700133144951115?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/5039700133144951115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=5039700133144951115' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5039700133144951115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5039700133144951115'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/11/ten-things-to-achieve-when-starting-3d.html' title='Ten things to achieve when starting 3D programming'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-1163754457917041897</id><published>2011-10-20T00:00:00.000+05:30</published><updated>2011-10-22T13:16:11.532+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Tutorial 6: Using Mouse and DirectInput</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;The 2nd part of the user input tutorial deals with using the mouse. &lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 300px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; LPDIRECTINPUTDEVICE8    m_pdInputMouse;&lt;/pre&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt;                    m_bPressedButtons[4];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt; DIMOUSESTATE            m_MouseState;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt; &lt;span style="color: blue;"&gt;long&lt;/span&gt;                    m_lPosX;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt; &lt;span style="color: blue;"&gt;long&lt;/span&gt;                    m_lPosY;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Most of the variables are self explanatory.&lt;br /&gt;&lt;br /&gt;Like in the last tutorial, we will have to make sure the DirectInput Interface is created before we can bind the mouse.&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::CreateMouse()&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color: green;"&gt;// create the mouse device&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     m_pdInput-&amp;gt;CreateDevice(GUID_SysMouse,&amp;amp;m_pdInputMouse, NULL);&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;     &lt;span style="color: green;"&gt;// set the data format to mouse format&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;     m_pdInputMouse-&amp;gt;SetDataFormat(&amp;amp;c_dfDIMouse);&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt;     &lt;span style="color: green;"&gt;// set the control over the mouse&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt;     m_pdInputMouse-&amp;gt;SetCooperativeLevel(m_hWnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND);&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum12" style="color: #606060;"&gt;  12:&lt;/span&gt;     &lt;span style="color: green;"&gt;// get the current position of the cursor&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum13" style="color: #606060;"&gt;  13:&lt;/span&gt;     POINT pt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum14" style="color: #606060;"&gt;  14:&lt;/span&gt;     GetCursorPos( &amp;amp;pt );&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum15" style="color: #606060;"&gt;  15:&lt;/span&gt;     ScreenToClient( m_hWnd, &amp;amp;pt );&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum16" style="color: #606060;"&gt;  16:&lt;/span&gt;     m_lPosX = pt.x;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum17" style="color: #606060;"&gt;  17:&lt;/span&gt;     m_lPosY = pt.y;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum18" style="color: #606060;"&gt;  18:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum19" style="color: #606060;"&gt;  19:&lt;/span&gt;     DetectMouseMovement();&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum20" style="color: #606060;"&gt;  20:&lt;/span&gt; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The CreateMouse is used to get control over the mouse. We first create the mouse device by calling CreateDevice. We set the data format to mouse format. To get control over the mouse we now make a call to SetCooperativeLevel and set the flags DISCL_EXCLUSIVE and DISCL_FOREGROUND. This basically sets the access level to exclusive (i.e other applications can not access the mouse) and foreground access. By foreground access we mean that the device is automatically un-acquired when the game loses focus. We then get the current position of the cursor and use the &lt;b&gt;ScreenToClient&lt;/b&gt; function to convert the screen coordinates to client-area coordinates.&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', courier, monospace; font-size: 11px; line-height: 16px; white-space: pre;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::DetectMouseMovement()&lt;/span&gt;&lt;br /&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     m_pdInputMouse-&amp;gt;Acquire();&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;     m_pdInputMouse-&amp;gt;GetDeviceState(&lt;span style="color: blue;"&gt;sizeof&lt;/span&gt;(DIMOUSESTATE), LPVOID(&amp;amp;m_MouseState));&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;     m_lPosX += GetMouseXDelta();&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt;     m_lPosY += GetMouseYDelta(); &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt;     ConstrainMouseCursor();&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum12" style="color: #606060;"&gt;  12:&lt;/span&gt;     &lt;span style="color: green;"&gt;// Get pressed keys&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum13" style="color: #606060;"&gt;  13:&lt;/span&gt;     &lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 4; i++ )&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum14" style="color: #606060;"&gt;  14:&lt;/span&gt;     {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum15" style="color: #606060;"&gt;  15:&lt;/span&gt;         &lt;span style="color: blue;"&gt;if&lt;/span&gt; ( m_MouseState.rgbButtons[i] &amp;amp;0x80 )&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum16" style="color: #606060;"&gt;  16:&lt;/span&gt;         {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum17" style="color: #606060;"&gt;  17:&lt;/span&gt;             m_bPressedButtons[i] = &lt;span style="color: blue;"&gt;TRUE&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum18" style="color: #606060;"&gt;  18:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum19" style="color: #606060;"&gt;  19:&lt;/span&gt;         }&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum20" style="color: #606060;"&gt;  20:&lt;/span&gt;         &lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum21" style="color: #606060;"&gt;  21:&lt;/span&gt;         {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum22" style="color: #606060;"&gt;  22:&lt;/span&gt;             m_bPressedButtons[i] = &lt;span style="color: blue;"&gt;FALSE&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum23" style="color: #606060;"&gt;  23:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum24" style="color: #606060;"&gt;  24:&lt;/span&gt;         }&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum25" style="color: #606060;"&gt;  25:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum26" style="color: #606060;"&gt;  26:&lt;/span&gt;     } &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum27" style="color: #606060;"&gt;  27:&lt;/span&gt; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The DetectMouseMovement function detects the mouse movement and which buttons have been pressed on the mouse. For this we first acquire the mouse and get the device state. We update the current position of the cursor using the deltas of the mousestate. We constrain the mouseposition to the client area.&amp;nbsp; Finally, we run through all the buttons and check which ones have been pressed.&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: 'Courier New', courier, monospace; font-size: 11px; line-height: 16px; white-space: pre;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::Cleanup()&lt;/span&gt;&lt;br /&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     m_pdInputMouse-&amp;gt;Unacquire();&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     m_pdInputMouse-&amp;gt;Release();&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Lastly, we have a Cleanup function, which releases the input devicesThat's all that we need to use the mouse in our game. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-1163754457917041897?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/1163754457917041897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=1163754457917041897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1163754457917041897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1163754457917041897'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/11/tutorial-5-using-keyboards-and.html' title='Tutorial 6: Using Mouse and DirectInput'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8427501042173879683</id><published>2011-10-14T15:35:00.000+05:30</published><updated>2011-10-14T15:48:08.714+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Tutorial 5: Using Keyboard and DirectInput</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;User Input is one of the most important aspects of a game. In this tutorial we will look at using the keyboard through DirectInput&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; LPDIRECTINPUT8          m_pdInput;&lt;/pre&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; LPDIRECTINPUTDEVICE8    m_pdInputKeyboard;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt; BYTE                    m_cKeyState[256];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt;                    m_bPressedKeys[256];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt;                    m_bLockedKeys[256];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt; HWND                    m_hWnd;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt; UINT                    m_iHeight;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt; UINT                    m_iWidth;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;m_pdInput is the input object &lt;br /&gt;m_pdInputKeyboard is the keyboard device &lt;br /&gt;m_cKeyState[] stores the pressed keys on the keyboard &lt;br /&gt;m_bPressedKeys[] is the array of pressed keys on the keyboard &lt;br /&gt;m_bLockedKeys[256] is the array of locked keys on the keyboard &lt;br /&gt;m_hWnd is the handle to the window&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::Init( &lt;span style="color: blue;"&gt;const&lt;/span&gt; HINSTANCE hInst,&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt;                   &lt;span style="color: blue;"&gt;const&lt;/span&gt; HWND hWnd,&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;                   &lt;span style="color: blue;"&gt;const&lt;/span&gt; UINT iTableWidth &lt;span style="color: green;"&gt;/*= 0 */&lt;/span&gt;,&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;                   &lt;span style="color: blue;"&gt;const&lt;/span&gt; UINT iTableHeight&lt;span style="color: green;"&gt;/*= 0*/&lt;/span&gt; )&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;     m_hWnd = hWnd;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt;     &lt;span style="color: green;"&gt;// create the DirectInput Interface&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="background-color: white; white-space: pre;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt;     DirectInput8Create(hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (&lt;span style="color: blue;"&gt;void&lt;/span&gt;**)&amp;amp;m_pdInput, NULL);&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt;     CreateKeyboard();&lt;/pre&gt;&lt;div style="color: black;"&gt;&lt;/div&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum12" style="color: #606060;"&gt;  12:&lt;/span&gt;     ...&lt;/pre&gt;&lt;div style="color: black;"&gt;&lt;/div&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum13" style="color: #606060;"&gt;  13:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;We first need to create the input object by calling DirectInput8Create()&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::CreateKeyboard()&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color: green;"&gt;// create the keyboard device&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     m_pdInput-&amp;gt;CreateDevice(GUID_SysKeyboard,&amp;amp;m_pdInputKeyboard, NULL);&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;     &lt;span style="color: green;"&gt;// set the data format to keyboard format&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;     m_pdInputKeyboard-&amp;gt;SetDataFormat(&amp;amp;c_dfDIKeyboard);&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt;     &lt;span style="color: green;"&gt;// set the control over the keyboard&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt;     m_pdInputKeyboard-&amp;gt;SetCooperativeLevel(m_hWnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND);&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt;     DetectKeys();&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum12" style="color: #606060;"&gt;  12:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The CreateKeyboard is used to get control over the keyboad. We first create the keyboard device by calling CreateDevice. We set the data format to keyboard format. To get control over the keyboard we now make a call to SetCooperativeLevel and set the flags DISCL_NONEXCLUSIVE and DISCL_FOREGROUND. This basically sets the access level to non-exclusive (i.e other applications can also access the keyboard) and foreground access. By foreground access we mean that the device is automatically un-acquired when the game loses focus.&lt;/div&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-style: none; color: black; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::LockKey( &lt;span style="color: blue;"&gt;const&lt;/span&gt; DWORD dwKey )&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     m_bLockedKeys[dwKey] = true;&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;The LockKey function is used to lock a key on the keyboard so that it is read only once per key press&lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::DetectKeys()&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     m_pdInputKeyboard-&amp;gt;Acquire();&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;     m_pdInputKeyboard-&amp;gt;GetDeviceState(256, (LPVOID)m_cKeyState);&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt;     &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;unsigned&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; iKey=0;iKey&amp;lt;256;iKey++)&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum8" style="color: #606060;"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum9" style="color: #606060;"&gt;   9:&lt;/span&gt;         &lt;span style="color: blue;"&gt;if&lt;/span&gt; (m_cKeyState[iKey] &amp;amp; 0x80)&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum10" style="color: #606060;"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum11" style="color: #606060;"&gt;  11:&lt;/span&gt;             &lt;span style="color: green;"&gt;// key is pressed if it isnt locked&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum12" style="color: #606060;"&gt;  12:&lt;/span&gt;             m_bPressedKeys[iKey] = !(m_bLockedKeys[iKey]);&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum13" style="color: #606060;"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum14" style="color: #606060;"&gt;  14:&lt;/span&gt;         &lt;span style="color: blue;"&gt;else&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum15" style="color: #606060;"&gt;  15:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum16" style="color: #606060;"&gt;  16:&lt;/span&gt;             m_bPressedKeys[iKey] = false;&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum17" style="color: #606060;"&gt;  17:&lt;/span&gt;             m_bLockedKeys[iKey] = false;&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum18" style="color: #606060;"&gt;  18:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum19" style="color: #606060;"&gt;  19:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum20" style="color: #606060;"&gt;  20:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;The Detectkeys function detects which keys have been pressed. For this we first acquire the keyboard and get the device state. We check which keys have been pressed. A key is considered as pressed only if it is not locked &lt;br /&gt;&lt;div id="codeSnippetWrapper" style="background-color: #f4f4f4; border: 1px solid silver; cursor: text; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding: 4px; text-align: left; width: 97.5%;"&gt;&lt;div id="codeSnippet" style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum1" style="color: #606060;"&gt;   1:&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; cInput::Cleanup()&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum2" style="color: #606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum3" style="color: #606060;"&gt;   3:&lt;/span&gt;     m_pdInputKeyboard-&amp;gt;Unacquire();&lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum4" style="color: #606060;"&gt;   4:&lt;/span&gt;     m_pdInputKeyboard-&amp;gt;Release();&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum5" style="color: #606060;"&gt;   5:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;pre style="background-color: #f4f4f4; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum6" style="color: #606060;"&gt;   6:&lt;/span&gt;     m_pdInput-&amp;gt;Release();&lt;/pre&gt;&lt;pre style="background-color: white; border-style: none; color: black; direction: ltr; font-family: 'Courier New',courier,monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;"&gt;&lt;span id="lnum7" style="color: #606060;"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Lastly, we have a Cleanup function, which unacquires and releases the input devices &lt;br /&gt;&lt;br /&gt;That's all that we need to use the keyboard in our game.The next tutorial will deal with getting mouse input.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8427501042173879683?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8427501042173879683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8427501042173879683' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8427501042173879683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8427501042173879683'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/10/tutorial-5-using-keyboard-and.html' title='Tutorial 5: Using Keyboard and DirectInput'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8054875577319665391</id><published>2011-04-12T12:12:00.000+05:30</published><updated>2011-04-12T12:32:20.346+05:30</updated><title type='text'>Quick Update</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span style="font-family: 'times new roman'; font-size: 100%;"&gt;The last few weeks have been really busy with a release in professional life. Glad to say it went well and I finally have my name on a published title. &lt;/span&gt;However I did manage to get time to add more features to the engine&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Restructured Directories      &lt;ul&gt;&lt;li&gt;Restructured directories so that engine code is easy to distribute without releasing the actual implementation &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Sound      &lt;ul&gt;&lt;li&gt;Added a sound lib and sound fx for collision and background music &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'times new roman'; font-size: 100%;"&gt;Logging&lt;/span&gt;&amp;nbsp; &lt;ul&gt;&lt;li&gt;&lt;span style="font-family: 'times new roman';"&gt;&lt;span class="Apple-style-span" style="font-size: 100%;"&gt;The log file now uses &lt;/span&gt;tinyxml&lt;span class="Apple-style-span" style="font-size: 100%;"&gt;, &lt;/span&gt;xsl tyle&lt;span class="Apple-style-span" style="font-size: 100%;"&gt; sheets and javascript. This has the added&amp;nbsp;&lt;/span&gt;benefit&lt;span class="Apple-style-span" style="font-size: 100%;"&gt;&amp;nbsp;of allowing me to filter the logged events &lt;/span&gt;&lt;/span&gt;according to filenames and/or type. &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Times New Roman';"&gt;Disk Checks&lt;/span&gt;&amp;nbsp; &lt;ul&gt;&lt;li&gt;&lt;span style="font-family: 'times new roman'; font-size: 100%;"&gt;We&lt;/span&gt; now check for hard disk space, memory and CPU speed before the application runs &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Added Custom String Class &lt;/li&gt;&lt;li&gt;Added Basic Class for File i/p &lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'times new roman';"&gt;&lt;span class="Apple-style-span" style="font-size: 100%;"&gt;Using a&amp;nbsp;&lt;/span&gt;resource&lt;span class="Apple-style-span" style="font-size: 100%;"&gt;&amp;nbsp;cache and zip files for sprites to decrease the memory footprint&lt;/span&gt;&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'times new roman'; font-size: 100%;"&gt;Added optional template which removes the need for returning –1 for invalid values&lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'times new roman'; font-size: 100%;"&gt;&lt;/span&gt;&lt;span style="font-family: 'times new roman'; font-size: 100%;"&gt;Minor Tweaks and&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman';"&gt;bug-fixes&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'times new roman';"&gt;I have also made a new setup with the above features&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: 'times new roman'; font-size: 100%;"&gt;    &lt;/span&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8054875577319665391?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8054875577319665391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8054875577319665391' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8054875577319665391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8054875577319665391'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/04/quick-update.html' title='Quick Update'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-282647046254969696</id><published>2011-01-06T10:09:00.001+05:30</published><updated>2011-01-06T10:14:18.438+05:30</updated><title type='text'>And We are back–This time to stay</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;Almost a year later, I have decided to revive the project. In the last few days I have added the following features&lt;/span&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Changed the directory structures&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Restructured Directories for external libraries and resources&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;Interfaces and Private Implementation of classes&lt;/span&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;This has the added advantage of separating the actual logic from the functions that need to be exposed well as reducing the compile times. If someday, this actually becomes an engine, it will make it much easier to redistribute.&lt;/span&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;Added NSIS and &lt;/span&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;NSISScriptGenerator&lt;/span&gt;&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;This is a nifty tool for creating an installer to redistribute the project&lt;/span&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;span style="font-family:Times New Roman;font-size:100%;"&gt;Adding a disk checks utility class which will get the CPU speed, hard disk space etc and make sure there is enough. &lt;span style="font-style: italic;"&gt;(This is still not getting used&lt;/span&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt;The code can be downloaded from&lt;br /&gt;&lt;tt id="checkoutcmd"&gt;svn checkout &lt;strong&gt;&lt;em&gt;http&lt;/em&gt;&lt;/strong&gt;://sppong.googlecode.com/svn/trunk/ sppong-read-only&lt;br /&gt;&lt;br /&gt;Note : You will need subversion&lt;br /&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-282647046254969696?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/282647046254969696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=282647046254969696' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/282647046254969696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/282647046254969696'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2011/01/and-we-are-backthis-time-to-stay.html' title='And We are back–This time to stay'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8726590081619809082</id><published>2010-04-03T06:03:00.001+05:30</published><updated>2010-04-03T06:03:58.127+05:30</updated><title type='text'>Updated Neural Net Code</title><content type='html'>&lt;p&gt;After a really long hiatus, I finally decided to add an updated snippet of code that I have been working on.&lt;/p&gt;  &lt;p&gt;The NeuralNet project can now do the following&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create a xml for training data&lt;/li&gt;    &lt;li&gt;Create a xml containing the trained NN framework based on the training data&lt;/li&gt;    &lt;li&gt;Read a NN framework file and give the output&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The code can be downloaded from the sidebar.&lt;/p&gt;  &lt;p&gt;The link is also provided here.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www-scf.usc.edu/~asheel/Ankur/NeuralNet.zip"&gt;Neural Net&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A update on the many projects I have been working on/completed soon&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8726590081619809082?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8726590081619809082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8726590081619809082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8726590081619809082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8726590081619809082'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2010/04/updated-neural-net-code.html' title='Updated Neural Net Code'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-3015943475474455664</id><published>2009-04-02T12:02:00.001+05:30</published><updated>2009-04-02T12:06:01.463+05:30</updated><title type='text'>Is this blog dead?</title><content type='html'>&lt;p&gt;The blog isnt dead. It's just in a state of hibernation&lt;img alt="Winking" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" /&gt;. I have been so busy with school, that even though I have been working on some cool stuff I haven't got a chance to update the blog.&lt;/p&gt;  &lt;p&gt;So what is this cool stuff, you ask eh?&lt;/p&gt;  &lt;p&gt;Well for one, I have been modifying &lt;strong&gt;QUAKE&lt;/strong&gt; to use affective computing techniques to adjust the difficulty of the game by using feedbacks such as the number of mouse clicks, sound and facial expressions.&lt;/p&gt;  &lt;p&gt;I have also been working on making a Reliable UDP protocol as outlined by Glenn Fiedler on his &lt;a href="http://gafferongames.com/"&gt;site&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;On the game front, it now contains basic AI and a main menu. I had started working on sound but I think I will first add networking code as soon as I am done with the protocol that I am working on. If you guys, would like to see a tutorial of something specific, feel free to post a comment and I will see if I can either write one or point you in the write direction.&lt;/p&gt;  &lt;p&gt;I am also looking for an internship, so if you have any idea of which co.s might be looking, make sure you drop me a line.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-3015943475474455664?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/3015943475474455664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=3015943475474455664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/3015943475474455664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/3015943475474455664'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2009/04/is-this-blog-dead.html' title='Is this blog dead?'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-1798734149727092437</id><published>2008-12-12T01:48:00.000+05:30</published><updated>2011-11-19T01:50:22.392+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Life is Backwards</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;I just love this quote by George Constanza... For those of you who have no idea of whom I am talking about, I recommend watching a couple of episodes of Seinfeld.&lt;br /&gt;&lt;br /&gt;"The most unfair thing about life is the way it ends. I mean, life is tough. It takes up a lot of your time. What do you get at the end of it? A death. What's that, a bonus?!?&lt;br /&gt;I think the life cycle is all backwards. You should die first, get it out of the way. Then you go live in an old age home. You get kicked out when you're too young, go collect all your super, then, when you start work, you get a gold watch on your first day. You work forty years until you're young enough to enjoy your retirement. You drink alcohol, you party, and you get ready for High School. You go to primary school, you become a kid, you play, you have no responsibilities, you become a little baby, you go back into the womb, you spend your last 9 months floating with luxuries like central heating, spa, room service on tap, then you finish off as an orgasm! Amen."&lt;br /&gt;Perspective on life according to George Costanza&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 29px;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: silver; font-family: script;"&gt;Ankur Sheel&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 29px;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: #b30000; font-family: script;"&gt;And the search for the ideal hairstyle continues......&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-1798734149727092437?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/1798734149727092437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=1798734149727092437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1798734149727092437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1798734149727092437'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/12/life-is-backwards.html' title='Life is Backwards'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-6279339196814826455</id><published>2008-12-07T01:46:00.000+05:30</published><updated>2011-11-19T01:50:22.429+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Only Child Appreciation</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;strong&gt;Disclaimer : This post may not be use to generalize all only children. I might just be messing with you.&lt;/strong&gt;&lt;br /&gt;Due to my parents current continued steadfast refusal to give me a sibling, I have been an only child for almost 25 years. During these years I have been asked a few questions. The questions aren't there but some of the answers and my thoughts(which I could have made up&amp;nbsp;&lt;img alt="Winking" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" /&gt;) should be enough to make you fall asleep.&lt;br /&gt;So what does one mean when they say an "Only Child". Well, an only child is a child with no siblings, either biological or adopted. Although first-born children may be considered temporary only children, and have a similar early family environment, the term only child is generally applied only to those individuals who never have siblings.&lt;br /&gt;1. We do not have any siblings i.e. brother or sister.&lt;br /&gt;P.S.-cousins are not siblings&lt;br /&gt;2. Our kids will never have first cousins from our side of the family.&lt;br /&gt;3. We are the only offspring our parents have.&lt;br /&gt;That's enough of the wikipedia definition..&lt;br /&gt;Others who might think we are spoilt and pampered,I don't see what's wrong with getting 100% of your parents love and resources. To them I say - Stop being so jealous just because we are the favorite child of our parents . I guess the pro or con, depending on your point of view is that we don't have to share our stuff and as my cousin says that includes the bathroom!!! Even though I have no need, I love to put stickers on things proclaiming that they are....&amp;nbsp;&lt;strong&gt;&lt;em&gt;MINE&lt;/em&gt;&lt;/strong&gt;. . But do my parents over indulge me? I guess that depends. To some people, I have more than enough, to others, I suppose I am derived.&lt;br /&gt;We get what we want (and usually) in our own way. Is there any other way to get what you want?&amp;nbsp;&lt;img alt="Confused" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/7.gif" /&gt;&amp;nbsp;This I believe is a good thing. We tend to be more focused on our goals and like to get tasks done at hand before jumping into bigger projects. As a consequence of this, we like things straight forward. As a result of a only child status comes the ability to be being completely in our own heads. Sometimes we will be so up in our own head that we don't even hear other people. However, I have noticed that an "only child" is a better listener than most other people.&lt;br /&gt;At some point of time, all of us have probably thought that having a sibling would be nice. Its tough having&lt;br /&gt;&lt;ul&gt;&lt;li&gt;no one to fight with ,&lt;/li&gt;&lt;li&gt;no one to share our secrets with (only to get blackmailed later on!).&lt;/li&gt;&lt;li&gt;no one who can go anywhere with us if our friends are not available&lt;/li&gt;&lt;li&gt;no one to blame if things go wrong.&lt;/li&gt;&lt;li&gt;no one who you know would be there for you no matter what(and no parents don't count)&lt;/li&gt;&lt;/ul&gt;I have lots of friends, but most have siblings, and I always felt that they had a special bond and loyalty that a friendship cant have. (Now that I have made all my friends happy by stating some of the benefits they have, I guess I can continue.)&lt;br /&gt;But , not having siblings has not disrupted my psyche in any way. It was disrupted by a lot of other things.&lt;br /&gt;Personally, Loneliness has never been a pervasive feeling. First and foremost, I had books. The way I read books is to disappear entirely into them (which explains my obsession with fantasy novels), almost becoming one of the characters. I devoured books, going to the public library and checking out big stacks. I read everything we had in the house; I probably read things that many would probably consider completely inappropriate for someone my age. I read it even if I didn't understand it. Later on, their place was taken by video games especially RPG's . But they still haven't been able to take the place of books.&lt;br /&gt;Plus I had my imaginary friends--legions of them--and we did so many amazing things. Huge, crazy, all day adventures sometimes. I remember having those friends well into middle school. However, when I started high school, the imaginary friends just disappeared from my life. I can't even remember their names now, which makes me kind of sad.&lt;br /&gt;And the fact that I managed to make a lot of friends/acquaintances extremely fast will always be a plus. I guess it because of this fact, I can go and talk to anybody if I need to. Contrastingly, its because of this, that I don't feel the constant urge to have someone to talk to at all times.&lt;br /&gt;I guess one of the cons of not having a sibling is that you are more reliant on friends so you might not want to upset them and risk losing them and therefore be lonely and hence might become placating. But I guess that depends. Not having a sibling taught me how to spend time so that I am happy alone. I guess that is one of the reasons I can easily walk away from people that don't meet my expectations. But I consider that a good thing mainly because I end up with long and fulfilling friendships some of which go 20 yrs back. The only problem was that earlier my initial expectations were very high. But I like to believe as I have grown, my expectations from others have become more realistic. How much of it is actually true, is for others who know me to judge&lt;br /&gt;I will concede that one bad habit that plagues most of us is that most of us don't learn how to share. In other words, the word SHARING doesn't exist in our dictionary. But, as time goes on, one atleast learns how to share the materialistic things. I say atleast because most of the people I know still cant deal with sharing their friends or family with others. I guess since we have always been the priority for our parents, we expect the same from everybody. This in turn can be disastrous as we start expecting things that are probably possible but not something that everybody would realize and from there on things just go south. Unfortunately, to an extent even I have this characteristic.&lt;br /&gt;Anyway, some of the more famous only child(ren)&lt;br /&gt;( P.S. the name at the last is soon going to become famous, but, I just added it right now)&lt;br /&gt;Steve Allen&lt;br /&gt;Lance Armstrong&lt;br /&gt;Leonardo da Vinci&lt;br /&gt;Albert Einstein&lt;br /&gt;Indira Gandhi&lt;br /&gt;Isaac Newton&lt;br /&gt;Franklin D. Roosevelt&lt;br /&gt;Brooke Shields&lt;br /&gt;Robin Williams&lt;span style="font-size: 29px;"&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: silver; font-family: script;"&gt;Ankur Sheel&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 29px;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: #b30000; font-family: script;"&gt;Time to take the GR off my gratitude and show some Attitude&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 29px;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: #b30000; font-family: script;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;(edit 08/12/08 : changed the flow and language )&lt;/em&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-6279339196814826455?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/6279339196814826455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=6279339196814826455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6279339196814826455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6279339196814826455'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/12/only-child-appreciation.html' title='Only Child Appreciation'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-7682778138037632309</id><published>2008-10-26T01:46:00.000+05:30</published><updated>2011-11-19T01:50:22.461+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>The grand finale - Is this what you have been waiting for?</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;I think this post has been the most awaited one. No, not because it feels like an eternity and this is the last one of the chain. Though I can imagine its the same feeling which most of you will get when of ekta kapoors saas bahu sagas are taken off the air. But, I digress. The reason I feel its the most awaited post until now, is because a lot of people are expecting to get a mention here. Apart from the fact that getting a mention is prestigious, I guess they are more concerned of the fact what exactly do I think about them. Oh and btw if you didn't get a mention, its up to you to decide, whether that's good or bad.&lt;br /&gt;I was thinking of adding a recap but I figured I am too young to die, and I don't want my friends to go to jail in a foreign land. Now, if we were in India, now that would be different. And to make this a little bit of fun, I have decided to forego the use of names and ,if required, refer to the people by pseudonyms such as A,B,C etc. Just to make it clear they are not initials. And whichever of them reads this blog can themselves mention I am A or B or whatever... After that I will edit the post to replace it with their name. If they don't, well they shall remain nameless and I get to refer to them as an alphabet&amp;nbsp;&lt;img alt="Winking" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/3.gif" /&gt;&amp;nbsp;Btw, if you find this post extremely long and boring, the people to be blamed are the ones I mention below. Some of them wanted a long post of my 1st expression of them. Why would anybody want to be ridiculed in this manner, is beyond me. I wonder if they will take the last line seriously&lt;img alt="Confused" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/7.gif" /&gt;&lt;br /&gt;Anyway, back to the story.&lt;br /&gt;Day 4 :&lt;br /&gt;It was a day like any other, running from one building to the next, getting the formalities finished, or Was It? Now that I have got your attention, I don't know what to do with it. Fast forwarding to the fun part and here I am walking toward the bus to go to Santa Monica, when I here my name being called out. Well, I look around, don't see any girl that I recognize and decide that its a figment of my imagination and continue walking :) Eventually, it turned out that it wasn't a voice in my head but somebody had actually called me(I think it was D). An uneventful bus ride and we were at the beach. Met quite a few people that hadn't come to the LA tour(the previous day).&lt;br /&gt;So, we started going towards the water, when we were faced with our first obstacle. Actually, there were just 3 of us(we shall call them A and B), the rest of the group had already overcome it. I know you are wondering, What obstacle is Ankur talking about at the beach. Don't worry yourself too much, it was the sand, and we were wondering how to avoid getting it in our footwear. I might like the beach, but not so much, that I take most of it home with me. Anyway, the geniuses that we were, we decided to stuff the shoes in our bags. I knew carrying around an empty backpack would help someday. So, with the first hurdle behind us, we reached the water. Actually, it was much before the water. B didn't want to go near the water. I guess B didn't know the meaning of the word beach which was why B had turned up in jeans and shoes.Apparently, B just had 1 pair of jeans because he hadn't got all his luggage. But, I think it was an excuse to hide the fact that B was afraid of water, because even after explaining the concept of washer and dryers and the natural effect of sunlight drying clothes, B wouldn't come anywhere near the water. As far as I am concerned I guess I had just forgotten what a beach is supposed to be like. Well, initially I decided to give B co. and we did hit it off quite well as B seemed a little sensible. Well, either I cant stand sensible for too long or B didn't turn out to be sensible, because I finally decided to enter the clear blue salty liquid aka The Sea. If any of the Manipal group is reading this, you will be happy to know it wasn't a repeat of the tragedy at Kaup.&lt;br /&gt;Well, after some time A saw a little girl(about 4 -5 yrs old) trying to surf. Well, A was is the same mental age so A decided to borrow the surfboard form the girl for a photograph. The girl probably thinking that she would get the surfboard back after a picture, readily gave it. If only she had known, that she would have to wait close to 30 min's. No, we didn't take 30 min's to click that 1 picture. Well, after A got a picture clicked, how could B, D and E be far behind. So, after a lot of different pictures and with B trying to surf(unsuccessfully I might add), the surfboard was given back. If you have seen the pics, you would know what I am talking about. After that, they wanted a photo-session while relaxing on a deck chair. I guess Baywatch has influenced a whole generation of 4-10 yrs old. So, then ,I think, C approached a group of foreigners to ask if they could get a snap clicked. Btw, can I call them foreigners considering that this is their country and technically I am the foreigner. Regardless, they thought C wanted a snap with them and considering that most of them were girls, you can imagine the expression. Well, after some clarification, they did get their snap, albeit without the foreigners.&lt;img alt="Sigh" src="http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/46.gif" /&gt;&lt;br /&gt;After having enough of the sand and sea-water, we went for a walk on the pier, when a rollercoaster caught the fancy of the toddlers :) C was left to click snaps while the rest us of went on the ride. C was anyway scared so we thought it might be better to hand C the camera. Unfortunately, it was as scary as the one in Appu Ghar. A couple of more photos, with people pushing me to take photos with them. which was understandable as the photo turns out extremely well if I am in it. But I am not so sure, because they wanted photos with the police also. Maybe they thought they could tell everybody back home, in the US we got arrested in the 1st week for posing as terrorists.In my defense, they are a terror. I was looking through the pics when I realized that B had a weird thing for feet and birds. And by birds I don't mean girls but the ones that go flap-flap and fly away. Grabbing a bite later, at the nearby foodcourt, made everybody else painfully aware, that they have a non-vegetarian among them. Well, since they didn't mind me eating and nobody tried taking my sandwich, there were no major hassles. Like Joey Says "Joey doesn't share food" . And just like that, we had come to an end of an wonderful day.&lt;br /&gt;There were a lot more people that day, but I dont remember the other stuff that happened. So if they refresh my memory, I will add the situations then...&lt;br /&gt;Day 5:&lt;br /&gt;Well, by this time, since I had yet to buy a mattress, I had got a major crick in the neck, which had the amazing effect of not allowing me to turn my head. I really don't remember much of this day, but, I guess I will write about the mixer or welcome dinner or something like that which took place in the evening. Last event with free food during the orientation week and where I actually interacted with the first non Indian apart from the pleasantries. Only thing she was from Taiwan and communication was a problem, me and my friend (lets call him F) eventually started writing stuff down on napkins so that all of us could understand each other. Else each would just keep repeating the same thing over and over again without any real progress. I guess having that funky hairstyle at that time helped as it became an easy ice-breaker. Too bad my memory is a blank. I guess I should post much sooner after the actual event. Well, anyway that's all I remember of Day 5&lt;br /&gt;Aah the end of the long week that was the orientation. After this, we started with classes and the fun events became increasingly rare. But, whatever few there were, will soon be posted.&lt;br /&gt;I think I forgot to mention and I am not sure if you guys noticed, but I decided to change my style of writing. It wasn't the removal of sarcasm(as if that's possible)&amp;nbsp;&lt;img alt="Tongue out" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/tongue_smile.gif" /&gt;...Anyway since, I might have forgotten a few parts here and there, feel free to refresh my memory and I shall add it into the post.&lt;br /&gt;&lt;strong&gt;If I meet with an accident after posting this, the culprit is one of the people mentioned above. Make sure to mention to the authorities.&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size: 29px;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: silver; font-family: Script;"&gt;Ankur Sheel&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 29px;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color: #b30000; font-family: Script;"&gt;Sarcasm is highly ineffective against stupid people&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-7682778138037632309?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/7682778138037632309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=7682778138037632309' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7682778138037632309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7682778138037632309'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/10/grand-finale-is-this-what-you-have-been.html' title='The grand finale - Is this what you have been waiting for?'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-5943957661844240435</id><published>2008-10-16T01:45:00.000+05:30</published><updated>2011-11-19T01:50:22.420+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>The Honeymoon period : Orientation and the 1st week</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;Since nobody has posted any comments, I will assume that nobody has any criticism to share. I am to conceited to think that nobody actually read the post. :)&lt;br /&gt;To continue with the short story, the days before orientation were spent getting adjusted to the time difference,getting to know my roommates and meeting new people. I was averaging just 4 hrs of sleep initially. Normally people suffer from jetlag, I was suffering from reverse jetlag. Isn't too surprising as I used to be awake on American time while I was in India. Glad to say that's been sorted out and I am officially now on Indian Time in America. The days went of smoothly with a couple of fiascos in the kitchen. Mostly when I tried to cook though.&lt;br /&gt;The first day of orientation started off at 8 in the morning with a free breakfast. That's the best way college could start - with free food. Most of the day passed away trying to stay awake, listening to the various speakers about the college and how lucky we were to be a part of it. You know - the usual. A small tour of the campus and we were free to do whatever we want. The keyword here and probably what makes America special is "&lt;strong&gt;choice&lt;/strong&gt;". There is nothing that is planned for you, atleast in the conventional sense. Its more like a conference, I guess. A handout will be provided listing the all the planned events and its up to you to decide which one you want to attend.&lt;br /&gt;Skipping over the boring part such as applying for my student ID, listening to some more boring lectures about studies in USC, life in US etc etc etc&lt;br /&gt;.....&lt;br /&gt;.....&lt;br /&gt;.....&lt;br /&gt;Americans are paranoid about plagiarism and forgeries.&lt;br /&gt;Chatting with friends over beer and food at home and it was time to call it a day.&lt;br /&gt;Day2 : No free breakfast. Looked as if it was just a one time affair. This was the day I had to give the 1st part of my English exam. This involved mainly writing an essay on a boring topic. I was so scared. None of the Indians I knew had cleared the exam and the popular view was that's it better to give TOEFL rather than appearing for the exam administered by USC. And everybody knows I can't write for nuts :) And the icing on the cake was that I couldn't register for classes till I got my results.&lt;br /&gt;Which school is complete without student associations? If you said none, you are correct. To ensure that school seemed fun to the new students, a fair was organized where it was possible to meet representatives of the various student association. Needless to say there was a huge crowd. Not because of the clubs. 2 trips had been planned for the next 2 days and we were supposed to get tickets for them in the fair. Add limited seating and the result is really huge lines. To cut a long story short sometimes good things happen to bad people. After standing in 2 lines and $5 later, I had tickets to both the trips :)&lt;br /&gt;Lots of Missions Accomplished for 2nd day. If you had been there, you would have agreed that getting tickets to both the trips was a achievement in itself. Went to my 1st baseball game in the evening. My uncle had box tickets and invited me to watch the game. The energy in the stadium is is equivalent to one in a cricket match in India. It was fun, with people explaining me the subtle nuances of the game. I couldn't buy a beer because I didn't look 21 and the Indian driving licence just doesn't cut it as a id. That didn't mean I couldn't have any. But buying drinks is so much simpler in India. I don't think I have ever been asked for an ID(to buy drinks) in the last 7-8 yrs. Was a good day.&lt;br /&gt;Day3: Was more of the same. Had to give my English speaking exam. I thought of speaking in the typical Indian stereotype to freak them out but good sense prevailed. The highlight of the day was the LA tour. Made a couple of friends at the beginning of the trip so didn't really get bored. Any of you needing a good tan, try sitting in an open bus on a hot day. Good advice aside, the trip consisted of dropping as at Hollywood for 10-15 minutes and that's about it. If you got a chance to look at the pics that I posted, you will see my new found friends posing with the various look-alike's. One of them was really still so a friend of mine thought it was a robot and went really close. When he/it moved, the expression on my friends face was priceless and we all got to have a good laugh at his expense.To some people, I seemed too passive and shy, so I was pushed to getting a snap with a Sylvester Stallone look-alike. I was about to pay him the standard dollar when I was pulled away. Apparently, if we had already paid and my friends saw no reason to pay him an extra dollar. Well, a dollar saved is Rs40+ saved. They do say, a picture speaks a thousand words so check out the pics and that will become an extra 173,000 words. Saw lots of high end cars and bikes such as Ferraris, Ducats, limousines and the like. The only solace is that soon I will be able to buy many of my own. Actually, I will settle for one for the time being. So if any of you have a large allowance, my birthday is coming up and I do accept gifts. I guarantee that the buyer will be given the first ride. Oh and I am not too choosy about the color though red or black would be nice. Need I say more :) Came back home for a beer and food session. Made a lot of new friends so I would call it a good day.&lt;br /&gt;Day4:&lt;br /&gt;Oops, I am out of time. So I shall take leave for now and continue writing the details of the other days on a new day. I can see all of you going - Ankur has gone crazy. A daily calendar of his life. Who's got time to read that? Does he think that we have nothing better to do. Though I can say with almost 100% confidence that you don't, but I do have other things to take care of and just cant write about every single day. Sorry to disappoint you guys but after the orientation, it will become more of an event related post rather than day by&amp;nbsp; day. I can almost hear the sighs of relief.&lt;br /&gt;Anyway the next post will be mostly about the Santa Monica trip and the last day of orientation.&lt;br /&gt;Till Next time, Fight ON&lt;br /&gt;&lt;em&gt;&lt;span style="color: grey; font-family: Script; font-size: 24px;"&gt;&lt;strong&gt;Ankur Sheel&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="color: #a80000; font-family: Script; font-size: 24px;"&gt;&lt;em&gt;&lt;strong&gt;If I applied myself as much as I procrastinated ... Wow! That would be powerful! I need a nap just thinking about it.&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-5943957661844240435?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/5943957661844240435/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=5943957661844240435' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5943957661844240435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5943957661844240435'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/10/honeymoon-period-orientation-and-1st.html' title='The Honeymoon period : Orientation and the 1st week'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-7631541578023328596</id><published>2008-10-15T11:24:00.001+05:30</published><updated>2008-10-15T11:32:23.238+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Tutorial 4 : Displaying Sprites</title><content type='html'>&lt;p&gt;Its been ages since the game dev related post  so I thought writing a tutorial for displaying the sprites should remedy that.&lt;/p&gt;  &lt;p&gt;The Sprite class is a wrapper around the D3dXSprite class and will contain all the code necessary to display a sprite on screen.&lt;/p&gt;  &lt;p&gt;The member variables required for implementing the sprite class are shown below. &lt;/p&gt;  &lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;   &lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;     &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; LPD3DXSPRITE        m_pSprite;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt; LPDIRECT3DTEXTURE9  m_pTexture;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt; UINT                m_uiHeight;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt; UINT                m_uiWidth;   &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt; D3DXVECTOR3         m_vScale;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt; D3DXVECTOR3         m_vPosition;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   7:&lt;/span&gt; D3DXMATRIX          m_mScaleMatrix;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Most of the variables are self-explanatory.  m_pSprite contains the DirectX sprite object that will be created and m_pTexture, the texture to be loaded/mapped to this sprite.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now, the first step is to initialize the sprite. This can be done in the following manner.&lt;/p&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt; &lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;   &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cSprite::Init( LPDIRECT3DDEVICE9 &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; pDevice, LPCTSTR strFilename )    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt; {    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (m_pSprite)    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt;     {    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt;         Cleanup();    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt;     }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;   &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   7:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// Create the Sprite&lt;/span&gt;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   8:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (FAILED(    D3DXCreateSprite(pDevice, &amp;amp;m_pSprite)))     &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   9:&lt;/span&gt;     {    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  10:&lt;/span&gt;         &lt;span style="color: rgb(0, 128, 0);"&gt;//error&lt;/span&gt;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  11:&lt;/span&gt;     }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;   &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  13:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// Create the texture associated with this sprite&lt;/span&gt;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  14:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(FAILED(D3DXCreateTextureFromFile(pDevice, strFilename, &amp;amp;m_pTexture)))    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  15:&lt;/span&gt;     {    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  16:&lt;/span&gt;          MessageBox(NULL, strFilename, _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Texture creation failed"&lt;/span&gt;), MB_OK ) ;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  17:&lt;/span&gt;          PostQuitMessage(0);    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  18:&lt;/span&gt;     }&lt;br /&gt;   &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  20:&lt;/span&gt;     D3DXIMAGE_INFO imageInfo;    &lt;span style="color: rgb(0, 128, 0);"&gt;// contents of the image file    &lt;/span&gt;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  21:&lt;/span&gt;      &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  22:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// get the contents of the image file&lt;/span&gt;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  23:&lt;/span&gt;     D3DXGetImageInfoFromFile(strFilename, &amp;amp;imageInfo);   &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  24:&lt;/span&gt;     &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  25:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;//get the image height and width&lt;/span&gt;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  26:&lt;/span&gt;     m_uiHeight = imageInfo.Height;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  27:&lt;/span&gt;     m_uiWidth = imageInfo.Width;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  28:&lt;/span&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Once we are done with the initialization, we need to render the sprite on screen, otherwise what is the use.&lt;br /&gt;&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt; &lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;   &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cSprite::DrawSprite( LPDIRECT3DDEVICE9 &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; pDevice, &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; D3DXVECTOR3&amp;amp; vPosition, &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; DWORD dwFlags &lt;span style="color: rgb(0, 128, 0);"&gt;/*= NULL*/&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; D3DCOLOR&amp;amp; tint &lt;span style="color: rgb(0, 128, 0);"&gt;/*= WHITE*/&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; RECT* pSrcRect &lt;span style="color: rgb(0, 128, 0);"&gt;/*= NULL*/&lt;/span&gt; )    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt; {    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt;     &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// get the new position and create the transform matrix&lt;/span&gt;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt;     &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (m_vPosition != vPosition)    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt;     {    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   7:&lt;/span&gt;         D3DXMATRIX transMatrix;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   8:&lt;/span&gt;         D3DXMatrixTranslation(&amp;amp;transMatrix, vPosition.x, vPosition.y, vPosition.z);    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   9:&lt;/span&gt;         D3DXMatrixMultiply(&amp;amp;transMatrix, &amp;amp;m_mScaleMatrix, &amp;amp;transMatrix);    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  10:&lt;/span&gt;         m_vPosition = vPosition ;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  11:&lt;/span&gt;         m_pSprite-&amp;gt;SetTransform(&amp;amp;transMatrix);   &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  12:&lt;/span&gt;     }    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  13:&lt;/span&gt;      &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  14:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// draw the sprite&lt;/span&gt;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  15:&lt;/span&gt;     m_pSprite-&amp;gt;Begin(dwFlags);    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  16:&lt;/span&gt;     m_pSprite-&amp;gt;Draw(m_pTexture, pSrcRect, NULL, NULL, tint);     &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  17:&lt;/span&gt;     m_pSprite-&amp;gt;End();    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;  18:&lt;/span&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;The DrawSprite function is the most important function. It will contain all the code necessary  to display our sprite.  The arguments passed to it should be self- explanatory. Incase they are not, drop me a line and I will elaborate.&lt;br /&gt;Using the translation matrix, we can set the position of the sprite and the scaling matrix as the name implies is used for scaling our image. Care needs to be taken to first translate the image and then scale it, else you might get some weird behavior.&lt;br /&gt;Next a call to Begin, Draw and End and we are done drawing the sprite to the screen.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The last part remaining is to release the resources when we are done using them. This is as follows&lt;br /&gt; &lt;/p&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;div   style="border-style: none; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;   &lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   1:&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cSprite::Cleanup()    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   2:&lt;/span&gt; {    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   3:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// release the texture&lt;/span&gt;    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   4:&lt;/span&gt;     SAFE_RELEASE(m_pTexture);    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   5:&lt;/span&gt;      &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   6:&lt;/span&gt;     &lt;span style="color: rgb(0, 128, 0);"&gt;// release the sprite&lt;/span&gt;    &lt;/pre&gt;&lt;pre    style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt;font-family:consolas,'Courier New',courier,monospace;font-size:8pt;color:white;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   7:&lt;/span&gt;     SAFE_RELEASE(m_pSprite);    &lt;/pre&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(96, 96, 96);"&gt;   8:&lt;/span&gt; }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;Care needs to be taken to release the texture first and then the sprite.&lt;br /&gt;The other functions can be added as per requirements. These may be for scaling the image, getting the position etc and should be trivial to implement.&lt;br /&gt;&lt;br /&gt;After this, you should be able to display sprites(moving or static) on your screen.Till the next tutorial, fight on&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-7631541578023328596?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/7631541578023328596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=7631541578023328596' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7631541578023328596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7631541578023328596'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/10/tutorial-4-displaying-sprites.html' title='Tutorial 4 : Displaying Sprites'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-5882839943127095790</id><published>2008-09-30T01:44:00.000+05:30</published><updated>2011-11-19T01:50:22.411+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>Lost in La... still.... naah</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;Cant believe that this has taken me more than an month to post. Maybe, I was suffering from writers block or just am too lazy to take out the time or I was actually really busy or.... think of a good excuse I can use. The person with the best excuse gets a mention and a chance to treat me to home cooked food. More on my eating habits later or not. I really don't need/want everybody on my case. And there will be hell to pay regarding that , especially, if my mom ever gets to reading this.&lt;br /&gt;&lt;br /&gt;Well, to begin, I almost get didn't get to clear the UK immigration. I was on time so that wasn't it. I have been roaming around with a fake passport. No big deal. Instead of filling out my name as FirstName/LastName I apparently have just a first name, thanks to the dimwitted officials in India. So, after convincing the lady at the counter, I was finally allowed to check in my baggage and spend the next few hours roaming around the duty free shops. Unfortunately, I didn't know the custom limits of the States, so I had to contend with just looking and not shopping. Having a "sharif bacha vaala" look actually helps. I would recommend it when traveling international. I was one of the few people who didn't have to repack his bag for the amusement of the officials. I guess they just couldn't see me as a smuggler or a terrorist. Now, I know why hijacking is so easy. The flight was uneventful. Got a aisle seat in the middle. Nice air hostesses though. American Airlines is nice but they don?t give free alcohol so I had to make do with juice :(&lt;br /&gt;&lt;br /&gt;American customs and Indian customs - no difference. Long Lines and an inordinate amount of waiting before they let you in. Oh a little more organized. Well some time and few chocolates later, I had cleared customs and had finally been granted entry in the promised land. And no, the chocolates weren't given to make the wait more enjoyable. I bought them to satiate my hunger. A word of advice, there's not much use getting a hutch sorry vodaphone connection on international roaming. The dog disappeared again. I was able to receive calls but on no network was I able to make calls. And that posed me in a nice dilemma, how do I get the address of the place I am supposed to get to. The genius that I am, I didn't write it down anywhere. The tubelight flickered and I decided to use the payphone. After getting a change of 100 dollars, not all of it in quarters, I decided to try my luck. The payphones were nothing compared to slot machines. the first few times it ate my quarters without connecting me. Once it connected and my prospective roommate didn't pick and it still ate my quarters. Finally, I asked the operator for help and managed to get thru to my roommate. Atleast, I didn't have to behave like a hobo the first day. The disaster of the day continues. On popular advice, I decided to take a shared cab. If at that time, I knew how much time I would have to wait, I would have paid the extra few dollars and taken a private cab. Well, after over an hour of watching people leave(who btw came after me), I finally got a cab which was going my way. Before I got in another cab going the same way came. I guess the saying in Hindi " bhagwan jab deta hai chappad faad ke deta hai" holds true :D&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Aah, the advantages of having a small build. The moment I got out of the cab, my not so light bags were lifted by my roommates. The nice people that they are, they were waiting for me outside the house. Maybe they were aware of my bad road sense from before. Since, I had just met one of them in India, I had a few reservations about the other. But after the initial few minute, they evaporated in thin error. Almost, immediately a bombshell was dropped on me. The apartment we were supposed to live in was still under renovation, so we had to live in a temporary accommodation. Same compound, different apartment. Atleast, I didn't have to unpack for a few days and I got my own room. Well, evening involved buying the groceries and the inevitable beer session. Move in Day was fun for all of us. Move in Day cos I was the first one to move in after which we got my roommates luggage from their respective apartment. Ooh the beer was necessary for a multitude of reasons. Apart from the fact that I hadn't had a drink since London, we didn't have any furnishings and had to sleep on the floor. Nothing beats roughing it out when all the luxuries are available right next door ;-) My thought that night " I think I will get along with my roommates. They can cook and I can eat. An unbeatable combination." I wonder if they disagree now that a month has passed by.&lt;br /&gt;&lt;br /&gt;Next few days consisted of finishing the formalities, giving english exams and getting checked for TB. Apparently, to these people, I am a carrier of exotic diseaeses and cant communicate in english. A surprize prize to the person who is still awake. Though to be eligble you need to post a comment here. So what are you waiting for. Try your luck. Winners to be announced in the next post along with the orientation(the fun part) and my last few days before the grind started.&lt;br /&gt;And this time it wont be a month&lt;br /&gt;&lt;span style="color: silver; font-family: Script; font-size: 35px;"&gt;&lt;strong&gt;Ankur Sheel&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 35px;"&gt;&lt;strong&gt;&lt;span style="color: red; font-family: Script;"&gt;The dumber they are, the smarter I feel&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-5882839943127095790?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/5882839943127095790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=5882839943127095790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5882839943127095790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5882839943127095790'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/lost-in-la-still-naah.html' title='Lost in La... still.... naah'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8487133709102122904</id><published>2008-09-26T04:30:00.000+05:30</published><updated>2008-09-29T12:56:11.589+05:30</updated><title type='text'>Hmm... Where did all the travel posts go?</title><content type='html'>Good news for the people who just visit my blog for the game development stuff. All the random musings have been moved to a different blog. Also, I have finally got everything back in place so I will start posting again :)&lt;br /&gt;&lt;br /&gt;For the people, who were interested in reading the musings,you view them at&lt;br /&gt;http://speedrunsrants.blogspot.com/&lt;br /&gt;Not so fast though, the blog can be viewed through invitation only so you will have to drop me a line and I will invite you to read the blog..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8487133709102122904?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8487133709102122904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8487133709102122904' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8487133709102122904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8487133709102122904'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/cleanup.html' title='Hmm... Where did all the travel posts go?'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-2989896155617109929</id><published>2008-09-25T01:44:00.000+05:30</published><updated>2011-11-19T01:50:22.400+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>First Walking around in London, now Lost In LA...wat next - IV</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div&gt;aaah.... the torture continues....atleast for the people who visit the blog expecting great insights on the really important things in life...What they maybe is still a mystery to me. If you ever figure it out, enlighten me please and if I am in the mood I might just entertain you. Enough of ranting, now on with the story and too see how much of it I actually remember..&lt;br /&gt;&lt;br /&gt;edit: this post has taken so long to finish... thanks to all the assignments that I have had to do&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So where was I, Oh yeah, I had spent 2 days walking in London and was heading on to Bradford to meet my cousin.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;After weighing all my options the previous night, I f inally got myself booked on a bus. Actually, my cousin did but whatever...The system here was so convenient. you don't need to even have a ticket, atleast not a paper one. They just send you a message on your phone and ,voila, thats your ticket. I had thought reaching the station 10 minutes before the departure time would be enough to find the bus etc and still have time to spare. Boy, was I wrong. I did catch the bus but if I was back in India, I would have been getting on a moving bus. Probably not, since they never leave on time anyway. 5 hrs later most of which was spent sleeping I was in Bradford.&lt;br /&gt;As soon as I got off the bus and into the car, I solved the mystery of why it is known as Bradistan... Apparently, it houses an extremely large Muslim population cos of which it is known as Mini Pakistan and hence Bradistan... Nothing much happened in the 2 days I was there.. Mostly family related stuff, and soon it was time to go to Edinburg to meet a old friend...&lt;br /&gt;&lt;br /&gt;Though we had intended to move out early in the morning, it was afternoon before we actually got on our way. A minor setback and a waste of an hr and bout 4-5 hrs later we were in Edinburg. I can see you go "Hmmm, setback I wonder what it was?" So I shall put you of your misery and answer your doubt. Bhabi thought that she had forgotten to turn off the iron after about an hour on the road., so we had to turn back :) Fortunately or unfortunately she hadnt forgotten. But the drive from Bradford to Edinburg was quite scenic. In places, you could see the sea to your side. Also, we faced quite a challenge finding a place to stay for the night. Luckily we did find one. A bed and break fast where Bhaiya, Bhabhi and my cousin put up. Dont worry about me I got to sleep on the couch in my friends house. To continue, as soon as we reached, everybody was ravenous so we decided to grab a bite. In the meantime, my friend came to pick me up. Now she's like me when it comes to road sense, so she had to get another friend of hers long so that she wouldnt get lost. Anyway, we spent most of the night catching up on old times, till we realised that it was 5 A.M.. I crashed on the couch and a little later was up again.&lt;br /&gt;&lt;br /&gt;There was a Edinburgh fest part of which was free on Sunday. So walked to the B&amp;amp;B, lost my way and had to ask Bhaiya to come pick me up. The fest was fun. Lots of different acts ranging from stand up comedy to dance to theatre to.... You get the picture. Was a good morning. Whats a visit to Scotland without going to a distellery and having some scotch :). Though I couldnt go to an actual distellery, because of lack of time, I did go for a decent alternative. There was this place which basically had models to explain the process of making whisky and I got to taste some scotch as well. Probably not as exhilirating as the actual experience but not bad either.&lt;br /&gt;&lt;br /&gt;Again a 5 hr drive and was back in Bradford. Bright and early next morning caught a train to London. I had to meet one more relative for dinner before catching my flight to the USA.. Aah the bane of having so many relatives everywhere. Anyway, took the tube and met Chacha at the station. Decided to have a couple of beers and an early dinner with Chacha and Chachi, after which I was heading back to Masis place, to finish packing for the next leg of the journey.&lt;br /&gt;&lt;br /&gt;But the day was not over and I felt like downing a couple of more beers on my last day in london, so joined masi and her friends for doing just exactly that :)&lt;br /&gt;&lt;br /&gt;Got home... finished packing.. took a cab in the morning to the airport... nothing eventful either on the way or to the airport..&lt;br /&gt;At the airport, now thats a different story..&lt;br /&gt;&lt;br /&gt;Apologies for the inspid writing but its been over a mth and its tough recounting my experience...&lt;br /&gt;I did choose an appropriate nickname for myself on the Rishikesh trip.&lt;br /&gt;I intend to come up to speed so that I can pen down my thoughts before I forget them . Lets c how that works out.&lt;br /&gt;&lt;br /&gt;Next post will probably deal with my first few days in the land of dreams - America&lt;br /&gt;&lt;span style="color: #002060;"&gt;&lt;span style="font-size: 16px;"&gt;&lt;span style="font-family: Calibri;"&gt;&lt;br /&gt;Ankur Sheel&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: 16px;"&gt;&lt;span style="font-family: Calibri;"&gt;Stopping Procastination.....&lt;br /&gt;Starting Tommorow&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-2989896155617109929?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/2989896155617109929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=2989896155617109929' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2989896155617109929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2989896155617109929'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/first-walking-around-in-london-now-lost.html' title='First Walking around in London, now Lost In LA...wat next - IV'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-9098924915701610122</id><published>2008-09-25T01:43:00.000+05:30</published><updated>2011-11-19T01:50:22.479+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>First Walking around in London, now Lost In LA...wat next - III</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div&gt;looks like most people are enjoying my mails so I guess I shall continue writing them... and for those who don't a GIANT " who cares"... maybe it will become like an ekta kapoor serial.... an update very day..... don't count on it though, I am not jobless, Actually I am(no job as yet), but I still have a life :P&lt;br /&gt;&lt;br /&gt;Till now... I had walked around most of&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;.... theres a reason I didn't say, I had seen most of&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;....&lt;br /&gt;Anyway to continue with my story&lt;br /&gt;&lt;br /&gt;After the non-existent hangover on getting up,((what a waste of beer :) ) I decided to go to Greenwich... had got bored of all the walking... Well, I had targeted being out of the house by the previous by nightt, so by about 1030 I got ready and started off... It seemed like a sunny day so I decided to lessen my load by leaving my jacket at home this time.... So much easier to walk now :)&lt;br /&gt;Apparently, the longer but scenic route was to take a ferry and as I had ample time(not), I took it... I was told it would take 45 mins but looks the Britishers not only took the kohinoor but also the concept of IST with them before leaving India... 1 and a half hours of listening to the tour guide on the ferry and plenty of pics(of the water mostly), I finally made it to land.&lt;br /&gt;&lt;br /&gt;With the lonely planet as my guide, I walked(I seem to be doing a lot of dis, soon I will be able to give gunjan some competition), to the Greenwich park. Really large and well maintained... groups of people just chilling out or playing football, sorry soccer or cycling, u get the picture, hopefully. Anyway, I reached the national maritime museum, which basically had info about the maritime history and other related stuff... How surprising, given the name of the museum and what can I say except that it was very informative :) Oh did I mention that the building was 3 floors... unfortunately no pics allowed&lt;br /&gt;&lt;br /&gt;At the other end on the top of a hill was the Royal Observatory, which was a must visit, so back to the walking. En route was the queens house which I decided to skip. Mainly because, she was in&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;. Well the Observatory contains the GMT line so I can now finally say that I have been to the end of the world and back. Here, I learned a lot more about watches and astronomy than I cared for. Luckily, my English is decent otherwise I would have said that I almost became a watchman rather than a watchmaker. So after a deluge of info, I decided to rest, at the riverfront, rt next to the water... Was very relaxing and I looked like a complete tourist at that pt of time, I guess..&lt;br /&gt;&lt;br /&gt;So with Greenwich out of the way, I headed back to&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;. Nope not by the ferry but by the tube time. i wasn't too sure if i had enough money loaded on my travel card but luckily I found a recharge station. Alls well that ends well.&lt;br /&gt;&lt;br /&gt;I was in&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;by early evening and I really didn't want to spend it home and&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;Eye was waiting. Got a jumbo hot dog because I finally started to feel hungry and ended up dropping half the onions and sauces. I need more practice to eat this damn thing. A long line and 16 pounds later, I was on the Ferris wheel. It was worth it and I have the pictures to prove it as well. A couple of hrs later, I was free.&lt;br /&gt;&lt;br /&gt;Had Nothing better to do, so decided to meet my masi and a couple of her friends for drinks again :). The highlight of this evening was that I got to experience racism first hand. Funnily enough, it wasn't against Indians but Americans. Basically we got in verbal fight with a couple of Britishers at the next table. I say we, cause barring me everybody there was an American. Not only did I get to see the American patriotism first hand,but also their impudence. Before things got out of hand and it turned physical, the British couple walked of. I guess the guy didn't want a fight and it was his other half that had started it all so.... rest of the evening was uneventful&lt;br /&gt;&lt;br /&gt;That's all for this edition... Next I go to Bradford or bradistan as its locally known. Why??? You will just have to wait to find out&lt;br /&gt;&lt;br /&gt;Note the removal of the disclaimer. That because I am not happy with the writing this time. I think too much time has elapsed in penning this down. Actually writing but penning sounds so much better. And not many photographs to refresh memory, so this time I will accept criticism as well&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Till Next Time..... Fight On&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #002060;"&gt;&lt;span style="font-size: 16px;"&gt;&lt;span style="font-family: Calibri;"&gt;Ankur Sheel&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: 16px;"&gt;&lt;span style="font-family: Calibri;"&gt;Open 24 hrs...&lt;br /&gt;Even longer on Sundays&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-9098924915701610122?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/9098924915701610122/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=9098924915701610122' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/9098924915701610122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/9098924915701610122'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/first-walking-around-in-london-now-lost_9203.html' title='First Walking around in London, now Lost In LA...wat next - III'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-74532698457605950</id><published>2008-09-25T01:42:00.001+05:30</published><updated>2011-11-19T01:50:22.450+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>First Walking around in London, now Lost In LA...wat next - II</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div&gt;time check.... ruby whats the time dere.... acccording to that acchi vaali subah ya shaam to everyone&lt;br /&gt;&lt;br /&gt;after the overwhelming response to the last part.... more than 60 mails... did i mention that instead of telling me how the mail was, dey were mostly discussing phoonk.... meri mail ko hava mein hi uda diya.... neway to the 2nd part of the series of mails... kisne socha tha ki main itni aasani se peecha chod doonga... tough luk ppl...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Flashback&lt;/b&gt;&amp;nbsp;: ab tak aapna dekha... ooops padha - I still need to upload the pics before u cn c :D&lt;br /&gt;I had reached tower of&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;with minor setbacks.... ab aage&lt;br /&gt;&lt;br /&gt;After a bit of walking from the tube station to the tower of&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;, I reached a long line of other tourists... Don't people have anything better to do, than make me stand in long lines... Well after standing for an hr in the line in which by the way, I heard a lot of gibberish because nobody was speaking in Hindi or English ( at least nothing I could understand) and paying 16-17 pounds for all that fun, I finally got my ticket....&lt;applause,&gt;&amp;nbsp;After another long line I entered the tower of&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;&lt;sigh&gt;&lt;applause&gt;&lt;applause&gt;&lt;br /&gt;&lt;br /&gt;As soon as I entered, this huge guy in a redcoat and booming voice beckoned us for an overview of the place... He had a really moustache... I think I will go for that look the next time.... Anyway he led us to the chapel, and here I am wondering when did I sign up for church :) Half an hr later after hearing the name s of probably all the famous and infamous people that were imprisoned/buried in TOL, we were finally left to wander on our own...&lt;br /&gt;&lt;br /&gt;My memory is a little rusty... looks like I am getting old and more like my Rishikesh adjective... Anyway, it was fun walking in the tower... seeing the inscriptions made by the prisoners, the weapons of yore, their defenses etc...&lt;br /&gt;&lt;br /&gt;In some of the outside crevasses there were some wax statues of guards...At least that's what I thought initially, till one of them needed a break and moved his gun to a more comfortable position...Probably his shift was getting over cos I managed to c a smaller version of changing of the guard.. I say a smaller version because only 1 guard got replaced... .&lt;br /&gt;&lt;br /&gt;The highlight - i got some really good shots of ravens... A couple of them even posed for the camera... how sporting..... Wrong highlight&lt;br /&gt;&lt;br /&gt;The actual highlight - the crown jewels and the kohinoor diamond... The British have plundered so much gold and jewelry from other nations its not even funny... Of course, they don't c it that way :) I thought of mentioning it but then decided that I am to young to die ;)&lt;br /&gt;Lot of security, armed gates and (un)surprisingly walking, I got to see the famous crown jewels... What a dazzling sight....&lt;br /&gt;The biggest bummer was that they don't let you take pics in most of the places so u guys will have to go for yourself to c if I am telling the truth or just yanking your chain... lol&lt;br /&gt;Somehow, the time piece on my hand caught my eye ...After shaking it a lot, I finally came to the conclusion that I had spent more than half a day and if I wanted to to visit any other place I would have to postpone my plan to steal the jewels... Maybe next time... Only if I felt hungry like normal people, I would have noticed that it was way past lunch time....&lt;br /&gt;&lt;br /&gt;Next on my list was the St pauls Cathedral... I can just c the shocked faces "Ankur going to a cathedral...Where did the sun rise from? " To clarify,I would like to say I met a very beautiful girl and went with her but in reality I went because its supposed to have a very beautiful architecture... Aaah, the nods of understanding... Its also supposed to have a great service for the religious among you...&lt;br /&gt;It didn't look too far on the map, so I decided to take the gyarah no ki bus.....A mile or so in, I noticed that the street names were on the opposite side of the map, so I retraced my steps....I think I should have taken advice from Joey and stood on the map to c if I needed to go left or right... Unfortunately, they haven't started making maps which display the actual distance(graphically), so after a really long walk I reached the cathedral.... yay u say... not so fast... It was closed... Ironically, I was trying to find my way out of the tower ...... Though I did c a throng of people coming out after the service....&lt;br /&gt;&lt;br /&gt;Yaaawn.... Cover your mouth..... I can c you people yawning so ham haazir hote hain break ke baad.... don't delete this mail.... I have to still make you fall asleep&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;We are back&lt;br /&gt;&lt;br /&gt;I wasn't going to go back and being laughed at for just seeing 1 place in the whole day, so with map in hand I started towards Trafalgar Square.... A nice walk along Thames and I was at my destination... Very beautiful and lots of people... A nice place to come with friends or that special someone .. Since, I was alone I didn't spend too much time there, just clicked a couple of snaps and was off to meet the queen for tea... After all that's why I had skipped lunch...&lt;br /&gt;&lt;br /&gt;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;seems to be a walkers paradise... Reached Buckingham place... Unfortunately, the queen was also running late and I didn't feel like waiting,,, It was already 7, so I decided to walk to the&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;Eye.... Over there, I finally grabbed a a hot dog and took the tube back home,.... nope, didn't go on the&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;Eye....&lt;br /&gt;&lt;br /&gt;Reached home.... After some time my masi also came and we decided to go for a drink.... Even though their beer is much better, they close pubs by 11 so.... But excellent ambiance.... On the way back got some kababs etc for dinner...Ate my first proper meal for the day and slept.... 1st day finally over...&lt;br /&gt;&lt;br /&gt;&lt;ding&gt;&lt;br /&gt;&lt;br /&gt;ohhhhh..... hamara samah aaj yahin khatam hua.... Till next time... fight on&lt;br /&gt;&lt;br /&gt;For those of u who are wondering y i said fight on, thats the USC motto,&lt;/ding&gt;&lt;/applause&gt;&lt;/applause&gt;&lt;/sigh&gt;&lt;/applause,&gt;&lt;/div&gt;agli baar.... I go to the end of the world and come back in one piece.....&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If you are still awake, i envy you... I almost feel asleep while writing this...&lt;br /&gt;Also, stop reading this drivel and get back to work/studies&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size: 21px;"&gt;Disclaimer : Only appreciation accepted, criticism may not be taken favorably&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: #002060;"&gt;&lt;span style="font-size: 16px;"&gt;&lt;span style="font-family: Calibri;"&gt;Ankur Sheel&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: red;"&gt;&lt;span style="font-size: 16px;"&gt;&lt;span style="font-family: Calibri;"&gt;I thrive on change.....&lt;br /&gt;In fact, I thrive on making other people change&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-74532698457605950?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/74532698457605950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=74532698457605950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/74532698457605950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/74532698457605950'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/first-walking-around-in-london-now-lost_3021.html' title='First Walking around in London, now Lost In LA...wat next - II'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-7148656595368885422</id><published>2008-09-25T01:42:00.000+05:30</published><updated>2011-11-19T01:50:22.441+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>First Walking around in London, now Lost In LA...wat next</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;&lt;div&gt;gud morning or evening RR's .. depending on watever time it is dere.... maybe ruby can help me out here... vahan kya baja hai? and looks like you guys are having lot of fun since I have gone&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;its been an awesome 2 weeks since I started travelling...oh before I forget, i have been sufferring from reverse jet lag... ppl wen dey cm spend most of dere time slepping, i spend it awake.... go figure&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Am sure you guys are wondering wat I have been upto... and if u aren't, well too bad, I am still going to give u a worthless option to waste ur time instead of working.studying and the other similar interesting stuff ;)&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Well, anyway I shall start from the begining...&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;After wasting my time at the Del airport just watching ppl, I boarded the plan and reached&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;.... yawwwwwwwwwwwn... The only good thing was that I got a free upgrade to premium economy... Mabe the guy at the counter liked my face... I really need to figure this thing out... first dicounts at TGIF now a free upgrade....&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Well, my international roaming didnt work and I couldnt find my taxi so I just kept walking up and down trying to find a placard with my name on it...wherever you go our network follows, looks like the dog lost its way trying to follow me... Anyway, after finishing my morning walk in the terminal I finally saw a person holding a placard with my name....&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Anyway, I was on a mission to see as much of&amp;nbsp;&lt;span class="nfakPe"&gt;London&lt;/span&gt;&amp;nbsp;as possible in the 2 days I had dere, so early in the morning( normal ppl early nt mine), I left the house with a map and a copy of Lonely Planet . Dont be surprised, I was already awake, the flight attendant woke me up at 6 a.m. local time as we had to unboard...&lt;/div&gt;&lt;div&gt;Now u may know that I cant navigate for nuts, so it made for some really interesting situations. I an sure the shopkeepers would have started getting suspicious of my back and forth, just trying to reach the nearest tube station... Enroute, I armed myself with a cell phone connection as well.. Well after spending a little extra time(double) than I was supposed to, I finally reached the tube station... got myself a prepaid pass, got on the tube and reached my first destination - The tower of&amp;nbsp;&lt;span class="nfakPe"&gt;london&lt;/span&gt;...&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Rukavat ke liye khed hai... my roommate wants his laptop back... guess I have hogged it for quite a bit... Well will have to wait till he doesnt require it or I can slip some sleeping pills in his cofeee..&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;wat happens next.... will I able to reach home or more importantly will I meet a cute chick?&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Stay tuned for the next mail or not,,, watever...&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;before you ask yeah I have nothing better to do, except write long mails about my trip...&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Nd kudos to anyone who managed to read the whole mail, without cursing me :)&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;em&gt;Disclaimer: Only appreciation accepted, critiscm may not be taken favorably&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: #002060;"&gt;&lt;span style="font-size: 16px;"&gt;&lt;span style="font-family: Calibri;"&gt;Ankur Sheel&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: red; font-family: Calibri; font-size: 16px;"&gt;Getting shot at has no rewards, unless you are in the army,&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 10pt; margin-left: 0in; margin-right: 0in; margin-top: 0in;"&gt;&lt;span style="color: red; font-family: Calibri; font-size: 16px;"&gt;So "Gimme all your money, this is a stick up"&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-7148656595368885422?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/7148656595368885422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=7148656595368885422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7148656595368885422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7148656595368885422'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/first-walking-around-in-london-now-lost_25.html' title='First Walking around in London, now Lost In LA...wat next'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8527164069743721090</id><published>2008-09-25T01:40:00.000+05:30</published><updated>2011-11-19T01:50:22.470+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>So many posts on 1 day</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;The first few entries are just some mailers I had sent to my friends detailing my trip.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8527164069743721090?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8527164069743721090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8527164069743721090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8527164069743721090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8527164069743721090'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/so-many-posts-on-1-day.html' title='So many posts on 1 day'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-5489216576671897232</id><published>2008-09-05T04:57:00.008+05:30</published><updated>2008-09-09T00:25:19.437+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Universal drink for Programmers</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://imgs.xkcd.com/comics/ballmer_peak.png"&gt;&lt;img style="WIDTH: 357px; CURSOR: pointer; HEIGHT: 321px" alt="" src="http://imgs.xkcd.com/comics/ballmer_peak.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Taken from http://imgs.xkcd.com/comics/&lt;span style="COLOR: rgb(255,0,0)"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Calibri;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-5489216576671897232?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/5489216576671897232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=5489216576671897232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5489216576671897232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5489216576671897232'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/09/optimum-blood-alchol-level-for.html' title='Universal drink for Programmers'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-5580684243867408159</id><published>2008-08-16T02:08:00.002+05:30</published><updated>2008-09-05T04:14:25.096+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Travel'/><title type='text'>Some Background</title><content type='html'>I had sent out a couple of mails with my trip details... I have been travelling around UK before I join school... Since, I missed out quite a few people, I have deicided to post the first few mails over here, so that anybody's whos interested can have a look..&lt;br /&gt;&lt;br /&gt;Hence, this and the next few posts are backdated and copies of the exact mail that I had sent out&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-5580684243867408159?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/5580684243867408159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=5580684243867408159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5580684243867408159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5580684243867408159'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/08/some-background.html' title='Some Background'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8171232847158178716</id><published>2008-07-15T03:48:00.001+05:30</published><updated>2008-09-05T04:25:01.246+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Increasing the scope</title><content type='html'>I have not been doing a lot of game development recently, mainly because I don't have access to my laptop and I need to wait till I get a new one. Another reason is that I just got admitted for masters in CS  and have been running around for all the formalities such as Visa etc.&lt;br /&gt;&lt;br /&gt;Anyway, I have also decided to increase the scope of the blog from just my game development related tutorials to other thoughts and musing which my friends and other people who visit the blog might be interested in.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8171232847158178716?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8171232847158178716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8171232847158178716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8171232847158178716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8171232847158178716'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/07/increasing-scope.html' title='Increasing the scope'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-7738741835802085856</id><published>2008-06-30T17:34:00.001+05:30</published><updated>2008-09-05T04:25:36.780+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Sample Code and Binaries</title><content type='html'>&lt;p&gt;As promised, I have added all the sample code&amp;#160; for all the personal projects that I have done. You can download them from the download link on the side.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Any comments/inputs to make it better will be appreciated.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-7738741835802085856?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/7738741835802085856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=7738741835802085856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7738741835802085856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7738741835802085856'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/06/sample-code-and-binaries.html' title='Sample Code and Binaries'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-2844515705643423141</id><published>2008-06-25T18:23:00.001+05:30</published><updated>2008-09-05T04:25:12.465+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Single Player Mode</title><content type='html'>&lt;p&gt;I added a single Player mode to the Pong clone. The AI is at best simple. The computer paddle does seem a little spastic and keeps on getting stuck at the top corner...&lt;/p&gt;  &lt;p&gt;Well, will need to fix this soon.&lt;/p&gt;    &lt;p&gt; Anyway, the code and binary.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.4shared.com/file/53299462/aa7f740a/MPong_code_v05.html"&gt;&lt;u&gt;Code&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.4shared.com/file/53299490/c3e909e9/MPong_binary_v05.html"&gt;&lt;u&gt;Binary&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-2844515705643423141?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/2844515705643423141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=2844515705643423141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2844515705643423141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/2844515705643423141'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/06/single-player-mode.html' title='Single Player Mode'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-6301319808083020645</id><published>2008-06-16T18:12:00.001+05:30</published><updated>2008-06-16T18:14:36.076+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Menu Screen</title><content type='html'>&lt;p&gt;Well, I have added a menu screen to the game. In order to handle the mouse clicks in certain area , I have also implemented MouseZones. Currently, Single Player mode doesnt work so guess I have to add that next.&lt;/p&gt;  &lt;p&gt;But before that, I will probably clean up the code a bit.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Behold, the screenshot :&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/Ankur.Sheel/SFZfxgyq5TI/AAAAAAAAAXI/IsHbz3nlDJE/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="263" alt="image" src="http://lh5.ggpht.com/Ankur.Sheel/SFZf0dIFD5I/AAAAAAAAAXM/pZs2mo61yd0/image_thumb%5B1%5D.png?imgmax=800" width="411" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-6301319808083020645?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/6301319808083020645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=6301319808083020645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6301319808083020645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6301319808083020645'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/06/menu-screen.html' title='Menu Screen'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/Ankur.Sheel/SFZf0dIFD5I/AAAAAAAAAXM/pZs2mo61yd0/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-213303572902848219</id><published>2008-06-12T23:52:00.001+05:30</published><updated>2008-06-16T18:14:36.076+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Title Screen</title><content type='html'>&lt;p&gt;I have added a title screen which is displayed for either 5 secs or till the player presses ESC. Here is the screenshot&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/Ankur.Sheel/SFFpQH9rR1I/AAAAAAAAAXA/1sAbTLI9Sqo/s1600-h/screenshot%5B8%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="233" alt="screenshot" src="http://lh3.ggpht.com/Ankur.Sheel/SFFpUxUaZPI/AAAAAAAAAXE/zhwmInlbOW0/screenshot_thumb%5B4%5D.jpg?imgmax=800" width="362" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Also, I added a cursor sprite for the mouse and added the code to constrain it to the window. &lt;/p&gt;  &lt;p&gt;Now, I need to add the code to display and handle a Options Screen.&lt;/p&gt;  &lt;p&gt;I shall upload the updated code when I have added the Options Menu&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-213303572902848219?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/213303572902848219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=213303572902848219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/213303572902848219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/213303572902848219'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/06/title-screen.html' title='Title Screen'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/Ankur.Sheel/SFFpUxUaZPI/AAAAAAAAAXE/zhwmInlbOW0/s72-c/screenshot_thumb%5B4%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8434053391779697808</id><published>2008-06-11T20:37:00.001+05:30</published><updated>2008-09-05T04:25:36.781+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Code Cleanup</title><content type='html'>&lt;p&gt;I have cleaned up a bit of the existing code and added comments.&lt;/p&gt;  &lt;p&gt;Here are the links&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.4shared.com/file/50913229/59ae55cf/Mpong_v04.html"&gt;&lt;u&gt;MPong&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.4shared.com/file/50913228/2ea96559/MPong_code_V04.html"&gt;&lt;u&gt;MPong Code&lt;/u&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8434053391779697808?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8434053391779697808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8434053391779697808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8434053391779697808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8434053391779697808'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/06/code-cleanup.html' title='Code Cleanup'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-686901500258566861</id><published>2008-06-10T19:58:00.001+05:30</published><updated>2008-09-05T04:26:22.696+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Why I haven't updated for so long</title><content type='html'>&lt;p&gt;Its been a long time since I last posted. The main reason being that my monitor got spoilt :-(&lt;/p&gt;  &lt;p&gt;Anyway, I got a new one now and am back in business.&lt;/p&gt;  &lt;p&gt;Just to update, I have added a state machine manager.&lt;/p&gt;  &lt;p&gt;I have also decided that I will be uploading just the latest code and binary &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-686901500258566861?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/686901500258566861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=686901500258566861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/686901500258566861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/686901500258566861'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/06/why-i-haven-updated-for-so-long.html' title='Why I haven&amp;#39;t updated for so long'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-6817693132082388480</id><published>2008-05-23T13:19:00.001+05:30</published><updated>2008-09-05T04:25:59.208+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Which Breed of Freelancer are you?</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;I came across this article characterizing 13 type of freelancers. As a freelancer, you will probably be able to recognize yourself.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://freelanceswitch.com/clients/the-13-breeds-of-freelancer-and-how-to-up-your-game/" target="_blank"&gt;Breeds of Freelancers&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-6817693132082388480?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/6817693132082388480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=6817693132082388480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6817693132082388480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/6817693132082388480'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/which-breed-of-freelancer-are-you.html' title='Which Breed of Freelancer are you?'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8959790779429109408</id><published>2008-05-12T16:44:00.000+05:30</published><updated>2008-06-11T16:38:05.587+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Fonts</title><content type='html'>&lt;p&gt;I ran into some problems while creating the font from custom sprites. Mostly concerning displaying the digits properly. So I shifted to ID3DXFont and got a working scoreboard.&lt;/p&gt;  &lt;p&gt;As always, I have&amp;#160; written a wrapper for ID3DXFont :)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The screenshot&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/Ankur.Sheel/SC1tpSo-UqI/AAAAAAAAADw/R1Va3WA36nA/s1600-h/Untitled%5B6%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="290" alt="Untitled" src="http://lh4.ggpht.com/Ankur.Sheel/SC1trCo-UrI/AAAAAAAAAD4/8iqB22juQ8Y/Untitled_thumb%5B4%5D.jpg?imgmax=800" width="374" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8959790779429109408?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8959790779429109408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8959790779429109408' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8959790779429109408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8959790779429109408'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/fonts.html' title='Fonts'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/Ankur.Sheel/SC1trCo-UrI/AAAAAAAAAD4/8iqB22juQ8Y/s72-c/Untitled_thumb%5B4%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-4184113919056879336</id><published>2008-05-10T20:09:00.000+05:30</published><updated>2008-05-15T15:11:57.490+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Bitmap Fonts</title><content type='html'>&lt;p&gt;I created a bitmap font using the XNA font maker utility and tweaked it. I have got the font sprite displaying on screen. Now just to add it to the score board and display 1 digit at a time.&lt;/p&gt;  &lt;p&gt;The screenshot:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/Ankur.Sheel/SCwE_io-UoI/AAAAAAAAADg/jd82Z5s0ubw/s1600-h/Untitled%5B3%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="306" alt="Untitled" src="http://lh6.ggpht.com/Ankur.Sheel/SCwFAyo-UpI/AAAAAAAAADo/elVCzSl-0mQ/Untitled_thumb%5B1%5D.jpg?imgmax=800" width="402" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-4184113919056879336?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/4184113919056879336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=4184113919056879336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/4184113919056879336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/4184113919056879336'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/bitmap-fonts.html' title='Bitmap Fonts'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/Ankur.Sheel/SCwFAyo-UpI/AAAAAAAAADo/elVCzSl-0mQ/s72-c/Untitled_thumb%5B1%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-1005810597607902581</id><published>2008-05-10T15:04:00.000+05:30</published><updated>2008-05-15T15:11:57.490+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Table Border</title><content type='html'>&lt;p&gt;I added borders to the table and implemented so that the ball bounces back on hitting the borders. The game also restart when the ball crosses either paddle.&lt;/p&gt;  &lt;p&gt;The screenshot&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/Ankur.Sheel/SCwD5yo-UmI/AAAAAAAAADQ/gccskxrY2dE/s1600-h/Untitled6.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="297" alt="Untitled" src="http://lh3.ggpht.com/Ankur.Sheel/SCwD7Co-UnI/AAAAAAAAADY/mO2iMguTjlE/Untitled_thumb4.jpg?imgmax=800" width="386" align="left" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Next I will be implementing a scoreboard&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-1005810597607902581?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/1005810597607902581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=1005810597607902581' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1005810597607902581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1005810597607902581'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/table-border.html' title='Table Border'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/Ankur.Sheel/SCwD7Co-UnI/AAAAAAAAADY/mO2iMguTjlE/s72-c/Untitled_thumb4.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-82569891136173783</id><published>2008-05-09T19:44:00.000+05:30</published><updated>2008-05-14T19:48:59.743+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Moving the ball and Collision Detection - II</title><content type='html'>&lt;p&gt;I added a new function to check for collision between objects. Its got basic functionality but it seems to do the job (somewhat). &lt;/p&gt;  &lt;p&gt;The ball does reverse on hitting the paddles but sometimes seems to get stuck.&amp;#160;&amp;#160; I need to figure out why this is happening and how to solve it&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-82569891136173783?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/82569891136173783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=82569891136173783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/82569891136173783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/82569891136173783'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/moving-ball-and-collision-detection-ii.html' title='Moving the ball and Collision Detection - II'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8860975834672684818</id><published>2008-05-08T19:37:00.000+05:30</published><updated>2008-05-14T19:48:59.744+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Moving the ball and Collision Detection - I</title><content type='html'>&lt;p&gt;I have got the ball somewhat bouncing around the screen. Right now it just goes through the paddles :-)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The code didn't take too much time but creating the ball with a transparent background sure did... So its official I suck at creating art assets &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8860975834672684818?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8860975834672684818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8860975834672684818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8860975834672684818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8860975834672684818'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/moving-ball-and-collision-detection-i.html' title='Moving the ball and Collision Detection - I'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-261062502760855239</id><published>2008-05-06T19:34:00.000+05:30</published><updated>2008-05-14T19:48:59.744+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>The Paddles Move... Yay</title><content type='html'>&lt;p&gt;I encapsulated the keyboard in a direct input wrapper. Looks like this time I may actually finish a game. &lt;/p&gt;  &lt;p&gt;But I still need to add the collision detection. Right now, the paddles just disappear from the screen &lt;img alt="Disappointed" src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/what_smile.gif" /&gt;.&lt;/p&gt;  &lt;p&gt;So what's the main element that's still missing from my game?? And the element is &amp;lt; DrumRoll&amp;gt; &amp;quot;&lt;strong&gt;the Ball&amp;quot;&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;So, now to start making the game somewhat playable &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-261062502760855239?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/261062502760855239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=261062502760855239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/261062502760855239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/261062502760855239'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/paddles-move-yay.html' title='The Paddles Move... Yay'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-393868549857547067</id><published>2008-05-05T13:32:00.000+05:30</published><updated>2011-01-11T13:12:49.209+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Can you make Pong</title><content type='html'>So I was looking for some game ideas for Pong and came across this article.&lt;br /&gt;&lt;a href="http://tinodidriksen.com/2003/05/06/but-can-you-make-pong/" target="_blank"&gt;&lt;u&gt;Can you make pong&lt;/u&gt;&lt;/a&gt;&lt;br /&gt;Its an interesting read and probably a reality check for people getting into games.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-393868549857547067?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/393868549857547067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=393868549857547067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/393868549857547067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/393868549857547067'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/can-you-make-pong.html' title='Can you make Pong'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-5301578978571765007</id><published>2008-05-04T19:39:00.000+05:30</published><updated>2008-05-12T19:41:59.793+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>Pong - Displaying Graphics on screen</title><content type='html'>&lt;p&gt;I decided to start by displaying graphics on the screen. To continue with the OOP methodology, I wrote a wrapper&amp;#160; for ID3DXSPRITE which deals with the creation, display and other aspects.&lt;/p&gt;  &lt;p&gt;The screenshot :&lt;a href="http://lh4.ggpht.com/Ankur.Sheel/SCf88io-UkI/AAAAAAAAADI/6_njI5dziFU/s1600-h/Untitled%5B10%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 0px; border-left: 0px; border-bottom: 0px" height="302" alt="Pong1" src="http://lh4.ggpht.com/Ankur.Sheel/SCf89io-UlI/AAAAAAAAADM/IafVVyE63GA/Untitled_thumb%5B8%5D.jpg?imgmax=800" width="391" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Next step... Add wrappers for DIRECTINPUT to handle user input.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-5301578978571765007?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/5301578978571765007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=5301578978571765007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5301578978571765007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5301578978571765007'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/pong-displaying-graphics-on-screen.html' title='Pong - Displaying Graphics on screen'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/Ankur.Sheel/SCf89io-UlI/AAAAAAAAADM/IafVVyE63GA/s72-c/Untitled_thumb%5B8%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-1442561344502391393</id><published>2008-05-02T13:12:00.001+05:30</published><updated>2008-05-12T19:41:59.794+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Pong'/><title type='text'>My first Game - Pong</title><content type='html'>&lt;p&gt;Well, after a lot of thinking (and procrastination), I have decided to start creating my first game. It should come as no surprise that I have decided to make Pong. &lt;/p&gt;  &lt;p&gt;I figure that as I create Pong, I shall have a framework as well for all my future games.&lt;/p&gt;    &lt;p&gt;So lets begin....&lt;img alt="Thumbsup" src="http://www.cybergifs.com/faces/thumbsup2.gif" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-1442561344502391393?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/1442561344502391393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=1442561344502391393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1442561344502391393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1442561344502391393'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/my-first-game-pong.html' title='My first Game - Pong'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-5529848695068824405</id><published>2008-05-01T12:16:00.001+05:30</published><updated>2008-05-12T19:42:20.544+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Tutorial 3 : Timing and FPS</title><content type='html'>&lt;p&gt;A timing class would help in creating a constant experience over multiple systems. We can also use our timing class to calculate the framerate of our demos.&lt;/p&gt;  &lt;p&gt;The timer class will keep track of the total running time, time elapsed between &lt;em&gt;Update&lt;/em&gt; calls and the application's framerate.&lt;/p&gt;  &lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;   &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  Timer.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cTimer::cTimer()&lt;br /&gt;: m_iCurrentTime(0)&lt;br /&gt;, m_iLastTime(0)&lt;br /&gt;, m_iLastFPSUpdate(0)&lt;br /&gt;, m_iNumFrames(0)&lt;br /&gt;, m_fFPS(0.0f)&lt;br /&gt;, m_fRunningTime(0.0f)&lt;br /&gt;, m_fTimeElapsed(0.0f)&lt;br /&gt;, m_bTimerStopped(&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;   QueryPerformanceFrequency( (LARGE_INTEGER *)&amp;amp;m_iTicksPerSecond );&lt;br /&gt;&lt;br /&gt;   m_iFPSUpdateInterval = m_iTicksPerSecond &amp;gt;&amp;gt; 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cTimer::Start()&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; ( !m_bTimerStopped )&lt;br /&gt;   {&lt;br /&gt;       &lt;span style="color: rgb(0, 128, 0);"&gt;// Already started&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;   QueryPerformanceCounter( (LARGE_INTEGER *)&amp;amp;m_iLastTime );&lt;br /&gt;   m_bTimerStopped = &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cTimer::Stop()&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; ( m_bTimerStopped )&lt;br /&gt;   {&lt;br /&gt;       &lt;span style="color: rgb(0, 128, 0);"&gt;// Already stopped&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;   INT64 iStopTime = 0;&lt;br /&gt;   QueryPerformanceCounter( (LARGE_INTEGER *)&amp;amp;iStopTime );&lt;br /&gt;   m_fRunningTime += (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)(iStopTime - m_iLastTime) / (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)m_iTicksPerSecond;&lt;br /&gt;   m_bTimerStopped = &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cTimer::Update()&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; ( m_bTimerStopped )&lt;br /&gt;   {&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;// Get the current time&lt;/span&gt;&lt;br /&gt;   QueryPerformanceCounter( (LARGE_INTEGER *)&amp;amp;m_iCurrentTime );&lt;br /&gt;&lt;br /&gt;   m_fTimeElapsed = (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)(m_iCurrentTime - m_iLastTime) / (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)m_iTicksPerSecond;&lt;br /&gt;   m_fRunningTime += m_fTimeElapsed;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;// Update FPS&lt;/span&gt;&lt;br /&gt;   m_iNumFrames++;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; ( m_iCurrentTime - m_iLastFPSUpdate &amp;gt;= m_iFPSUpdateInterval )&lt;br /&gt;   {&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; fCurrentTime = (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)m_iCurrentTime / (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)m_iTicksPerSecond;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; fLastTime = (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)m_iLastFPSUpdate / (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)m_iTicksPerSecond;&lt;br /&gt;       m_fFPS = (&lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt;)m_iNumFrames / (fCurrentTime - fLastTime);&lt;br /&gt;&lt;br /&gt;       m_iLastFPSUpdate = m_iCurrentTime;&lt;br /&gt;       m_iNumFrames = 0;&lt;br /&gt;   }&lt;br /&gt;   m_iLastTime = m_iCurrentTime;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;To create the timer we use the functions &lt;strong&gt;&lt;em&gt;QueryPerformanceFrequency and QueryPerformanceCounter.&lt;/em&gt;&lt;/strong&gt; The first function determines how many times per second the system counter fires. The second counter determines what the counter value is currently set to.&lt;br /&gt;Most of the code is self-explanatory.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To calculate the elapsed time since the last update, we need to get the difference between the current counter value and the counter value from the last update.To convert the result into seconds, we divide it by the number of ticks the counter fires per second. The total running time is simply updated each frame with the current elapsed time value.&lt;/p&gt;Calculating the frames per second involves a few steps. First, to prevent the FPS from updating every frame, we need to store an FPS update interval. If we updated the FPS every frame, it would change too fast for us to see any single value. The update interval is set to half the counter frequency. This means the timer will perform the FPS calculation every half second. Second, we need a variable that counts the number of times the Update method is called. If we call Update every frame, it will represent the number of frames rendered. To calculate the FPS, we divide this frame counter by the time passed since the last time the FPS was calculated. Once the FPS is calculated, we reset the frame counter to 0 and repeat.&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt; &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;// MainWindow.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::OnRender()&lt;br /&gt;{&lt;br /&gt;   HRESULT hr;&lt;br /&gt;  &lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;// update the game timer&lt;/span&gt;&lt;br /&gt;   m_pGameTimer-&amp;gt;Update();&lt;br /&gt;&lt;br /&gt;   hr = cDXBase::GetInstance().BeginRender();&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (SUCCEEDED(hr))&lt;br /&gt;   {&lt;br /&gt;       m_pGameApp-&amp;gt;Render(m_pGameTimer-&amp;gt;GetElapsedTime());&lt;br /&gt;       cDXBase::GetInstance().EndRender(hr);&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;With cTimer implemented, we can update our CMainWindow class to integrate our new timer class. We’ll need to access the timer when we render frames. As a result, we need to update the &lt;strong&gt;&lt;em&gt;Render&lt;/em&gt;&lt;/strong&gt; method definition in the CBaseApp class to include a float that will hold the elapsed time from the timer.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.4shared.com/file/46589827/9948ad4/Game_v03_code.html" target="_blank"&gt;Code&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.4shared.com/file/46589820/97f01f77/Game_v03_binaries.html" target="_blank"&gt;Binaries&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-5529848695068824405?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/5529848695068824405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=5529848695068824405' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5529848695068824405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/5529848695068824405'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/05/tutorial-3-timing-and-fps.html' title='Tutorial 3 : Timing and FPS'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-9158591199102341910</id><published>2008-04-30T13:29:00.001+05:30</published><updated>2008-09-05T04:26:41.794+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Misc'/><title type='text'>Timing FPS.......aarh</title><content type='html'>Since FPS is the most common way of measuring the performance, I thought I would implement it before starting with my game (Did I mention I procrastinate sometimes )&lt;br /&gt;&lt;br /&gt;Measuring time on the PC can be done in quite a few ways. I prefer to use &lt;span style="font-style: italic;"&gt;QueryPerformanceCounter()&lt;/span&gt; which is a highly accurate timer function. It is dependent on the availability of a high resolution counter in h/w.&lt;br /&gt;To use the counter we need to know the resolution and that is retrieved by a call to &lt;span style="font-style: italic;"&gt;QueryPerformanceFrequency()&lt;/span&gt;, which returns the no. of ticks per second.&lt;br /&gt;&lt;br /&gt;All I need now is to display the FPS on the screen :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-9158591199102341910?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/9158591199102341910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=9158591199102341910' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/9158591199102341910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/9158591199102341910'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/04/timing-fpsaarh.html' title='Timing FPS.......aarh'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-7198830093446883031</id><published>2008-04-30T11:20:00.002+05:30</published><updated>2008-05-05T12:12:03.093+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Tutorial 2 : Initializing DirectX</title><content type='html'>&lt;p&gt;After creating the window, we need to give it DirectX capabilities. To get access to DirectX graphics, we need to include the header file &lt;em&gt;d3d9.h. &lt;/em&gt;We also need to add the header file &lt;em&gt;d3dx9.h, &lt;/em&gt;as it contains a lot of useful functions and macros.&lt;/p&gt;  &lt;p&gt;Following the OOP methodology, I created a class which deals with the creation and release of the devices, handling lost devices and the rendering.&lt;/p&gt;  &lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;   &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  DxBase.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cDXBase::Init( &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; HWND hWnd )&lt;br /&gt;{&lt;br /&gt;  m_Hwnd = hWnd;&lt;br /&gt;&lt;br /&gt;  DirectxInit() ;&lt;br /&gt;#ifdef WINDOWED&lt;br /&gt;  SetParameters(&lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;) ;  &lt;br /&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#else&lt;/span&gt;&lt;br /&gt;  SetParameters(&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;) ;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#endif&lt;/span&gt;&lt;br /&gt;  CreateDirectxDevice() ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cDXBase::DirectxInit()&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;//create the Direct3d Object&lt;/span&gt;&lt;br /&gt;  m_pD3D = Direct3DCreate9(D3D_SDK_VERSION) ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(m_pD3D == NULL)&lt;br /&gt;  {&lt;br /&gt;      MessageBox(NULL, _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Direct3d object creation failed!"&lt;/span&gt;), _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Error!"&lt;/span&gt;), MB_ICONEXCLAMATION | MB_OK) ;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// get the display mode&lt;/span&gt;&lt;br /&gt;  m_pD3D-&amp;gt;GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &amp;amp;m_displayMode );&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// get the device caps&lt;/span&gt;&lt;br /&gt;  m_pD3D-&amp;gt;GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &amp;amp;m_Caps) ;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;To initialize DirectX graphics we first create the &lt;em&gt;DirectX object&lt;/em&gt;  with a call to &lt;strong&gt;&lt;em&gt;Direct3DCreate9. &lt;/em&gt;&lt;/strong&gt;The object lets configure the application based on the video card capabilities. This is achieved with a call to &lt;strong&gt;&lt;em&gt;GetDeviceCaps&lt;/em&gt;&lt;/strong&gt;. We also get the current display mode with a call to &lt;strong&gt;&lt;em&gt;GetAdapterDisplay&lt;/em&gt;&lt;/strong&gt; mode.&lt;br /&gt;&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  DxBase.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cDXBase::SetParameters(&lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; BOOL bFullScreen)&lt;br /&gt;{&lt;br /&gt;  ZeroMemory(&amp;amp;m_d3dpp, &lt;span style="color: rgb(0, 0, 255);"&gt;sizeof&lt;/span&gt;(m_d3dpp)) ;&lt;br /&gt;&lt;br /&gt;  m_d3dpp.BackBufferCount = 1 ;&lt;br /&gt;  m_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE ;&lt;br /&gt;  m_d3dpp.MultiSampleQuality = 0 ;&lt;br /&gt;  m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD ;&lt;br /&gt;  m_d3dpp.hDeviceWindow = m_Hwnd ;&lt;br /&gt;  m_d3dpp.Flags = 0 ;&lt;br /&gt;  m_d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT ;&lt;br /&gt;  m_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE ;&lt;br /&gt;  m_d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8 ; &lt;span style="color: rgb(0, 128, 0);"&gt;//pixel format&lt;/span&gt;&lt;br /&gt;  m_d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8 ; &lt;span style="color: rgb(0, 128, 0);"&gt;// depth format&lt;/span&gt;&lt;br /&gt;  m_d3dpp.EnableAutoDepthStencil = &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt; ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(bFullScreen)&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(0, 128, 0);"&gt;// if its a full screen app&lt;/span&gt;&lt;br /&gt;      m_d3dpp.BackBufferWidth = m_displayMode.Width ;&lt;br /&gt;      m_d3dpp.BackBufferHeight = m_displayMode.Height ;&lt;br /&gt;      m_d3dpp.Windowed = &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;; &lt;span style="color: rgb(0, 128, 0);"&gt;// fullscreen&lt;/span&gt;&lt;br /&gt;      m_d3dpp.FullScreen_RefreshRateInHz = m_displayMode.RefreshRate;&lt;br /&gt;  }&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(0, 128, 0);"&gt;// if its a windowed app&lt;/span&gt;&lt;br /&gt;      m_d3dpp.Windowed = &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt; ;&lt;br /&gt;      m_d3dpp.EnableAutoDepthStencil = TRUE ;&lt;br /&gt;      m_d3dpp.AutoDepthStencilFormat = D3DFMT_D16 ;&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;Next, we need to fill up a &lt;em&gt;D3DPRESENT_PARAMETERS &lt;/em&gt;structure. This structure is used to specify how DirectX is going to behave. If the application is full screen, then the &lt;em&gt;BackBufferWidth, BackBufferHeight &lt;/em&gt;and&lt;em&gt;  FullScreen_RefreshRateInHZ &lt;/em&gt;members need to be set.&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//DxBase.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cDXBase::CreateDirectxDevice()&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt;        vp = 0 ; &lt;span style="color: rgb(0, 128, 0);"&gt;// the typeof vertex processing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(m_Caps.DevCaps &amp;amp; D3DDEVCAPS_HWTRANSFORMANDLIGHT )&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(0, 128, 0);"&gt;// hardware vertex processing is supported.&lt;/span&gt;&lt;br /&gt;      vp = D3DCREATE_HARDWARE_VERTEXPROCESSING ;&lt;br /&gt;  }&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(0, 128, 0);"&gt;// use software vertex processing.&lt;/span&gt;&lt;br /&gt;      vp = D3DCREATE_SOFTWARE_VERTEXPROCESSING ;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// Create the D3DDevice&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(FAILED(m_pD3D-&amp;gt;CreateDevice(D3DADAPTER_DEFAULT,&lt;br /&gt;      D3DDEVTYPE_HAL,&lt;br /&gt;      m_Hwnd,&lt;br /&gt;      vp,&lt;br /&gt;      &amp;amp;m_d3dpp,&lt;br /&gt;      &amp;amp;m_pd3dDevice)))&lt;br /&gt;  {&lt;br /&gt;      MessageBox(NULL, _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Direct3d m_pd3dDevice creation failed!"&lt;/span&gt;), _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Error!"&lt;/span&gt;),MB_ICONEXCLAMATION | MB_OK) ;&lt;br /&gt;      PostQuitMessage(0) ;&lt;br /&gt;      DestroyWindow(m_Hwnd) ;&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;Now, we create the device. First, we check if Hardware processing is supported or not. Then, we create the device with a call to &lt;strong&gt;&lt;em&gt;CreateDevice&lt;/em&gt;&lt;/strong&gt;. If device creation fails, we post an error and quit.&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;// Dxbase.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;HRESULT cDXBase::BeginRender()&lt;br /&gt;{&lt;br /&gt;  HRESULT hr;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// check if the device is available&lt;/span&gt;&lt;br /&gt;  hr = IsAvailable() ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(hr == D3DERR_DEVICELOST || hr == D3DERR_DEVICENOTRESET)&lt;br /&gt;  {&lt;br /&gt;      HandleLostDevice(hr) ;&lt;br /&gt;  }&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(FAILED(hr))&lt;br /&gt;      {&lt;br /&gt;          PostQuitMessage(0) ;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(SUCCEEDED(hr))&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(0, 128, 0);"&gt;// clear the frame&lt;/span&gt;&lt;br /&gt;      m_pd3dDevice-&amp;gt;Clear(0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,m_BkColor, 1.0f, 0) ;&lt;br /&gt;&lt;br /&gt;      hr = m_pd3dDevice-&amp;gt;BeginScene() ;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; hr;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//DxBase.inl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;inline HRESULT cDXBase::IsAvailable()&lt;br /&gt;{&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;(m_pd3dDevice-&amp;gt;TestCooperativeLevel()) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;inline &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cDXBase::EndRender( &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; HRESULT hr )&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(SUCCEEDED(hr))&lt;br /&gt;  {&lt;br /&gt;      m_pd3dDevice-&amp;gt;EndScene() ;&lt;br /&gt;  }&lt;br /&gt;  m_pd3dDevice-&amp;gt;Present(NULL, NULL, NULL, NULL) ;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;With the device initialized, we need to update the message loop to render geometry. First, we check if the device is available. This is done with a call to &lt;strong&gt;&lt;em&gt;TestCooperativeLevel. &lt;/em&gt;&lt;/strong&gt;Before we can render any geometry we need to call &lt;strong&gt;&lt;em&gt;BeginScene&lt;/em&gt;. &lt;/strong&gt;Then, we need to clear the surface we are drawing on with a call to &lt;strong&gt;&lt;em&gt;Clear&lt;/em&gt;&lt;/strong&gt;. This clears the back buffer with the specified color. When we are done rendering, we need to call &lt;strong&gt;&lt;em&gt;EndScene&lt;/em&gt;&lt;/strong&gt;. At this point, we still can't see the geometry as we cleared the back buffer. To switch between the front and back buffer we need to call &lt;strong&gt;&lt;em&gt;Present&lt;/em&gt;&lt;/strong&gt;, which displays the what we just rendered to the screen.&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;// DxBase.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cDXBase::Release()&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// release the Direct3d device&lt;/span&gt;&lt;br /&gt;  SAFE_RELEASE(m_pd3dDevice) ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// release the Direct3d object&lt;/span&gt;&lt;br /&gt;  SAFE_RELEASE(m_pD3D) ;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;When we quit the message loop, we need to give resources back to Windows by releasing the COM interfaces. The Direct3D object and the Direct3D Device are both COM objects. So, to destroy the COM instances, we’ll release them in the reverse order that they are created by calling Release.&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  DxBase.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cDXBase::HandleLostDevice(HRESULT hr)&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(hr == D3DERR_DEVICELOST)&lt;br /&gt;  {&lt;br /&gt;      Sleep(500) ;&lt;br /&gt;  }&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;br /&gt;  {&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(hr == D3DERR_DEVICENOTRESET)&lt;br /&gt;      {&lt;br /&gt;          &lt;span style="color: rgb(0, 128, 0);"&gt;//The m_pd3dDevice is ready to be Reset&lt;/span&gt;&lt;br /&gt;          hr = ResetDevice() ;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;HRESULT cDXBase::ResetDevice()&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (m_pd3dDevice)&lt;br /&gt;  {&lt;br /&gt;      HRESULT        hr ;&lt;br /&gt;&lt;br /&gt;      hr = m_pd3dDevice-&amp;gt;Reset(&amp;amp;m_d3dpp) ;&lt;br /&gt;&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; hr ;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;One more thing we need to handle is lost DirectX devices. The device can be lost when the window is minimized or when we switch among windows etc. This is done by a simple call to &lt;strong&gt;&lt;em&gt;Reset&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now we just need to make a few changes to our &lt;em&gt;MainWindow &lt;/em&gt;to integrate DirectX.&lt;/p&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  MainWindow.cpp&lt;/span&gt;&lt;br /&gt;GRAPHIC_API HWND cMainWindow::Init( &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; HINSTANCE &amp;amp;hInstance, &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; &amp;amp;nCmdShow, LPCTSTR lpWindowTitle,&lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; iFullScreenWidth, &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; iFullScreenHeight, cBaseApp* &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; pGameApp )&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;  m_iFullScreenWidth = iFullScreenWidth ;&lt;br /&gt;  m_iFullScreenHeight = iFullScreenHeight ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// initialize DirectX&lt;/span&gt;&lt;br /&gt;  cDXBase::GetInstance().Init(hWnd);&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; hWnd;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;HWND cMainWindow::CreateMyWindow( &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; &amp;amp;nCmdShow, LPCTSTR lpWindowTitle )&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#else&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// create the window in full screen mode&lt;/span&gt;&lt;br /&gt;  m_Hwnd = CreateWindowEx(&lt;br /&gt;      WS_EX_CLIENTEDGE,&lt;br /&gt;      _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Window"&lt;/span&gt;),&lt;br /&gt;      lpWindowTitle,&lt;br /&gt;      WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE,&lt;br /&gt;      0, 0,&lt;br /&gt;      m_iFullScreenWidth,m_iFullScreenHeight,&lt;br /&gt;      NULL,&lt;br /&gt;      NULL,&lt;br /&gt;      m_hInstance,&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;) ;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#endif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;LRESULT CALLBACK cMainWindow::WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_SIZE:&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_MOVE:&lt;br /&gt;      OnReset();&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_KEYDOWN:&lt;br /&gt;&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;switch&lt;/span&gt;(wParam)&lt;br /&gt;      {&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; VK_ESCAPE:&lt;br /&gt;          DestroyWindow(hwnd) ;&lt;br /&gt;          &lt;span style="color: rgb(0, 0, 255);"&gt;break&lt;/span&gt; ;&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_DESTROY:&lt;br /&gt;      OnDestroy();&lt;br /&gt;      &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::Run()&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// earlier stuff&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(0, 128, 0);"&gt;//No message to process?&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(0, 128, 0);"&gt;// Then do your game stuff here&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          OnRender();&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::OnRender()&lt;br /&gt;{&lt;br /&gt;  HRESULT hr;&lt;br /&gt;&lt;br /&gt;  hr = cDXBase::GetInstance().BeginRender();&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (SUCCEEDED(hr))&lt;br /&gt;  {&lt;br /&gt;      cDXBase::GetInstance().EndRender(hr);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::OnDestroy()&lt;br /&gt;{&lt;br /&gt;  &lt;span style="color: rgb(0, 128, 0);"&gt;// release the graphic object&lt;/span&gt;&lt;br /&gt;  cDXBase::GetInstance().Release();&lt;br /&gt;&lt;br /&gt;  ReleaseCapture() ;&lt;br /&gt;  PostQuitMessage(0) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::OnReset()&lt;br /&gt;{&lt;br /&gt;  GetWinRect() ;&lt;br /&gt;  cDXBase::GetInstance().ResetDevice();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;Now that we have added DirectX, on running the code we should see a blue screen&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.4shared.com/file/46408548/84395c91/Game_v02_code.html" target="_blank"&gt;Code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.4shared.com/file/46408547/14864100/Game_v02_binaries.html" target="_blank"&gt;Binaries&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-7198830093446883031?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/7198830093446883031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=7198830093446883031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7198830093446883031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/7198830093446883031'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/04/tutorial-2-initializing-directx.html' title='Tutorial 2 : Initializing DirectX'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-1323109346190183901</id><published>2008-04-30T09:55:00.001+05:30</published><updated>2008-09-05T04:27:01.360+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Integrating DirectX</title><content type='html'>The next logical step was to add DirectX to the application. To achieve this, I created a wrapper encapsulating the creation and release of the devices, handling lost devices and the rendering.&lt;br /&gt;&lt;br /&gt;The project properties need to  be modified to include the following&lt;br /&gt;&lt;ul&gt;&lt;li&gt;In the C++-&gt;General-&gt;Additional Include Directories add &lt;span style="font-style: italic;"&gt;$(DXSDK_DIR)\Include&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Also the header files &lt;span style="font-style: italic;"&gt;d3d9.h &lt;/span&gt;and &lt;span style="font-style: italic;"&gt;d3dx9.h&lt;/span&gt; need  to be included&lt;br /&gt;&lt;br /&gt;The presentation parameters vary depending on whether the app is in windowed or full screen mode.&lt;br /&gt;&lt;br /&gt;As always, the code should be self explanatory.&lt;br /&gt;&lt;br /&gt;The links :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.4shared.com/file/46408548/84395c91/Game_v02_code.html"&gt;Code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.4shared.com/file/46408547/14864100/Game_v02_binaries.html"&gt;Binary&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-1323109346190183901?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/1323109346190183901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=1323109346190183901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1323109346190183901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/1323109346190183901'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/04/integrating-directx.html' title='Integrating DirectX'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-4005034510121662548</id><published>2008-04-29T18:10:00.005+05:30</published><updated>2008-05-04T13:54:12.411+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><title type='text'>Tutorial 1 : Creating a Window</title><content type='html'>&lt;p&gt;Before we create our game ,we first need to know how to create a window. This involves the following basic steps&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Define and register a window class that describes the window that we need to make &lt;/li&gt;    &lt;li&gt;Create the window &lt;/li&gt;    &lt;li&gt;Create the message loop to update the window based on input or game logic &lt;/li&gt;    &lt;li&gt;Create an event handler to responds to the events sent by window &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Luckily, the code just needs to be written just once. I have also taken a slightly Object Oriented approach.&lt;/p&gt;  &lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;   &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  Main.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; WINAPI WinMain(&lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; nCmdShow)&lt;br /&gt;{&lt;br /&gt;   HWND    hwnd ;&lt;br /&gt;&lt;br /&gt;   CheckForMemoryLeaks() ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;//Initialize the window class&lt;/span&gt;&lt;br /&gt;   hwnd = cMainWindow::GetInstance().Init( hInstance, nCmdShow, _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Test Game"&lt;/span&gt;));&lt;br /&gt;  &lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(hwnd == NULL)&lt;br /&gt;   {&lt;br /&gt;       PostQuitMessage(0) ;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   cMainWindow::GetInstance().Run();&lt;br /&gt;&lt;br /&gt;   Cleanup() ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt; &lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  MainWindow.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;GRAPHIC_API HWND cMainWindow::Init( &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; HINSTANCE &amp;amp;hInstance, &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; &amp;amp;nCmdShow, LPCTSTR lpWindowTitle )&lt;br /&gt;{&lt;br /&gt;   m_hInstance = hInstance;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;//m_WndProc = WndProc;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;//Register the Window Class&lt;/span&gt;&lt;br /&gt;   RegisterWin();&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;//Create the Window&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;(CreateMyWindow(nCmdShow, lpWindowTitle)) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::RegisterWin()&lt;br /&gt;{&lt;br /&gt;   WNDCLASSEX        wc ;&lt;br /&gt;&lt;br /&gt;   wc.cbSize = &lt;span style="color: rgb(0, 0, 255);"&gt;sizeof&lt;/span&gt;(WNDCLASSEX) ;&lt;br /&gt;   wc.style = 0 ;&lt;br /&gt;   wc.lpfnWndProc = (WNDPROC)cMainWindow::StaticWndProc ;&lt;br /&gt;   wc.cbClsExtra = 0 ;&lt;br /&gt;   wc.cbWndExtra = 0 ;&lt;br /&gt;   wc.hInstance = m_hInstance ;&lt;br /&gt;   wc.hIcon = LoadIcon(NULL, IDI_APPLICATION) ;&lt;br /&gt;   wc.hCursor = LoadCursor(NULL, IDC_ARROW) ;&lt;br /&gt;   wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1) ;&lt;br /&gt;   wc.lpszMenuName = NULL ;&lt;br /&gt;   wc.lpszClassName = _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Window"&lt;/span&gt;) ;&lt;br /&gt;   wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION) ;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(!RegisterClassEx(&amp;amp;wc))&lt;br /&gt;   {&lt;br /&gt;       MessageBox(NULL, _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Window Registration Failed!"&lt;/span&gt;), _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Error!"&lt;/span&gt;),MB_ICONEXCLAMATION | MB_OK) ;&lt;br /&gt;       exit(0) ;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;HWND cMainWindow::CreateMyWindow( &lt;span style="color: rgb(0, 0, 255);"&gt;const&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; &amp;amp;nCmdShow, LPCTSTR lpWindowTitle )&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;#ifdef WINDOWED&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;// create the window in windowed mode&lt;/span&gt;&lt;br /&gt;   m_Hwnd = CreateWindowEx(&lt;br /&gt;       WS_EX_CLIENTEDGE,&lt;br /&gt;       _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Window"&lt;/span&gt;),&lt;br /&gt;       lpWindowTitle,&lt;br /&gt;       WS_OVERLAPPEDWINDOW ,&lt;br /&gt;       0, 0,&lt;br /&gt;       CW_USEDEFAULT, CW_USEDEFAULT,&lt;br /&gt;       NULL,&lt;br /&gt;       NULL,&lt;br /&gt;       m_hInstance,&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;) ;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#else&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;// create the window in full screen mode&lt;/span&gt;&lt;br /&gt;   m_Hwnd = CreateWindowEx(&lt;br /&gt;       WS_EX_CLIENTEDGE,&lt;br /&gt;       _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Window"&lt;/span&gt;),&lt;br /&gt;       lpWindowTitle,&lt;br /&gt;       WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE,&lt;br /&gt;       0, 0,&lt;br /&gt;       1280,764,&lt;br /&gt;       NULL,&lt;br /&gt;       NULL,&lt;br /&gt;       m_hInstance,&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;) ;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#endif&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;(m_Hwnd == NULL)&lt;br /&gt;   {&lt;br /&gt;       MessageBox(NULL, _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Window Creation Failed!"&lt;/span&gt;), _T(&lt;span style="color: rgb(0, 96, 128);"&gt;"Error!"&lt;/span&gt;),MB_ICONEXCLAMATION | MB_OK) ;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; NULL ;&lt;br /&gt;   }&lt;br /&gt;   GetWinRect() ;&lt;br /&gt;   ShowWindow(m_Hwnd, nCmdShow) ;&lt;br /&gt;   UpdateWindow(m_Hwnd) ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; m_Hwnd ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::MoveWin()&lt;br /&gt;{&lt;br /&gt;   MoveWindow(m_Hwnd,m_iLeftPos,m_iTopPos,m_iClientWidth,m_iClientHeight,&lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;) ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::GetWinRect()&lt;br /&gt;{&lt;br /&gt;   RECT    clientRect, windowRect ;&lt;br /&gt;&lt;br /&gt;   GetClientRect(m_Hwnd,&amp;amp;clientRect) ;&lt;br /&gt;   GetWindowRect(m_Hwnd,&amp;amp;windowRect) ;&lt;br /&gt;   m_iClientWidth = (clientRect.right - clientRect.left) ;&lt;br /&gt;   m_iClientHeight = (clientRect.bottom - clientRect.top) ;&lt;br /&gt;   m_iTopPos = (windowRect.top - clientRect.top) ;&lt;br /&gt;   m_iLeftPos = (windowRect.left - clientRect.left) ;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;The &lt;strong&gt;&lt;em&gt;WinMain&lt;/em&gt;&lt;/strong&gt; function is the entry point for all Windows programs. We initialize the window by calling &lt;strong&gt;&lt;em&gt;cMainWindow::Init&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;First, we define the window class by filling out a &lt;em&gt;WNDCLASSEX&lt;/em&gt; structure. This structure contains all the properties of the window that we want to create. The window is registered by calling the function &lt;strong&gt;&lt;em&gt;RegisterClassEx&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;&lt;p&gt;With the window class registered, we then create the window with a call to the function &lt;strong&gt;&lt;em&gt;CreateWindowEx&lt;/em&gt;&lt;/strong&gt;. This is where we specify the size and position of the window along with the &lt;em&gt;Window Styles&lt;/em&gt;. Note that we pass this as the last parameter to &lt;strong&gt;&lt;em&gt;CreateWindowEx&lt;/em&gt;&lt;/strong&gt;. The reason for this will be explained in just some time. The method to create Windowed and FullScreen application differs. The &lt;em&gt;#ifdef WINDOWED &lt;/em&gt;above is used&lt;em&gt; &lt;/em&gt;to do just that.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;With the window registered and created we can display the window with a call to &lt;strong&gt;&lt;em&gt;ShowWindow&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;UpdateWindow.&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt; &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//  MainWindow.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; cMainWindow::Run()&lt;br /&gt;{&lt;br /&gt;   MSG Msg ;&lt;br /&gt;&lt;br /&gt;   PeekMessage(&amp;amp;Msg, NULL, 0, 0, PM_NOREMOVE) ;&lt;br /&gt;   &lt;span style="color: rgb(0, 128, 0);"&gt;// run till completed&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;while&lt;/span&gt; (Msg.message!=WM_QUIT)&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;       &lt;span style="color: rgb(0, 128, 0);"&gt;// is there a message to process?&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (PeekMessage(&amp;amp;Msg, NULL, 0, 0, PM_REMOVE))&lt;br /&gt;       {&lt;br /&gt;           &lt;span style="color: rgb(0, 128, 0);"&gt;// dispatch the message&lt;/span&gt;&lt;br /&gt;           TranslateMessage(&amp;amp;Msg) ;&lt;br /&gt;           DispatchMessage(&amp;amp;Msg) ;&lt;br /&gt;       }&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;br /&gt;       {&lt;br /&gt;           &lt;span style="color: rgb(0, 128, 0);"&gt;//No message to process?&lt;/span&gt;&lt;br /&gt;           &lt;span style="color: rgb(0, 128, 0);"&gt;// Then do your game stuff here&lt;/span&gt;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;The &lt;em&gt;message loop&lt;/em&gt; or &lt;strong&gt;&lt;em&gt;cMainWindow::Run &lt;/em&gt;&lt;/strong&gt;is what continuously updates the application until the user wants to quit. To be more efficient, we will only update and render a frame when there are no messages in the message queue. First we need to check if there are any messages that the window needs to take care of such as resizing, closing, etc. We check if there are any messages on the queue with &lt;strong&gt;&lt;em&gt;PeekMessage&lt;/em&gt;&lt;/strong&gt;. If there is a message, we test if the message is a quit message. If it’s not a quit message, we send the message off to our event handler by calling &lt;strong&gt;&lt;em&gt;TranslateMessage&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;DispatchMessage&lt;/em&gt;&lt;/strong&gt;.&lt;br /&gt;&lt;div   style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; width: 97.5%; cursor: text; max-height: 400px; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;br /&gt; &lt;pre   style="border-style: none; margin: 0em; padding: 0px; overflow: visible; width: 100%; color: black; line-height: 12pt; background-color: rgb(244, 244, 244);font-family:consolas,'Courier New',courier,monospace;font-size:8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;// MainWindow.cpp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;LRESULT CALLBACK cMainWindow::WndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; BOOL        bLtButtonPressed = &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt; ;&lt;br /&gt;   PAINTSTRUCT        ps ;&lt;br /&gt;   HDC                hdc ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;switch&lt;/span&gt;(msg)&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_PAINT:&lt;br /&gt;       hdc = BeginPaint (hwnd, &amp;amp;ps) ;&lt;br /&gt;       EndPaint (hwnd, &amp;amp;ps) ;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_SIZE:&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_MOVE:&lt;br /&gt;       cMainWindow::GetInstance().GetWinRect() ;&lt;br /&gt;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_KEYDOWN:&lt;br /&gt;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;switch&lt;/span&gt;(wParam)&lt;br /&gt;       {&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; VK_ESCAPE:&lt;br /&gt;           DestroyWindow(hwnd) ;&lt;br /&gt;           &lt;span style="color: rgb(0, 0, 255);"&gt;break&lt;/span&gt; ;&lt;br /&gt;&lt;br /&gt;       }&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_CLOSE:&lt;br /&gt;       DestroyWindow(hwnd) ;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;case&lt;/span&gt; WM_DESTROY:&lt;br /&gt;       ReleaseCapture() ;&lt;br /&gt;       PostQuitMessage(0) ;&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; 0 ;&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;default&lt;/span&gt;:&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; DefWindowProc(hwnd, msg, wParam, lParam) ;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;LRESULT CALLBACK cMainWindow::StaticWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; ( msg == WM_CREATE )&lt;br /&gt;   {&lt;br /&gt;       SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG)((CREATESTRUCT *)lParam)-&amp;gt;lpCreateParams );&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   cMainWindow *targetApp = (cMainWindow*)GetWindowLongPtr( hwnd, GWLP_USERDATA );&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; ( targetApp )&lt;br /&gt;   {&lt;br /&gt;       &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; targetApp-&amp;gt;WndProc( hwnd, msg, wParam, lParam );&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; DefWindowProc( hwnd, msg, wParam, lParam );&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;The window procedure, &lt;strong&gt;&lt;em&gt;WndProc&lt;/em&gt;&lt;/strong&gt;, is where we process all our messages. You can name this function whatever you want as long as you pass the same name to the &lt;em&gt;WNDCLASSEX&lt;/em&gt; structure above. To process messages, just do a switch on the message to handle each case. There are a lot of possible messages, but usually you’ll just need a few.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;One feature to notice is that there are two window procedures: &lt;strong&gt;&lt;em&gt;WndProc&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;StaticWndProc&lt;/em&gt;&lt;/strong&gt;. When we fill out the WNDCLASSEX.lpfnWndProc member of the window class, we need to specify a pointer to a function that has a specific function declaration: &lt;/p&gt;LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )&lt;br /&gt;&lt;br /&gt;&lt;p&gt;When the program is compiled, another parameter is added to all non-static member functions, a &lt;em&gt;this&lt;/em&gt; pointer, which changes the function declaration so it is incompatible with what is required for the lpfnWndProc member. Static functions on the other hand, do not receive this extra parameter, which is why we set the lpfnWndProc member to StaticWndProc. However, static functions can only access static member variables. Since all the other variables are non-static, we need a way to access them. &lt;/p&gt;If you look at the &lt;strong&gt;&lt;em&gt;CreateWindowEx&lt;/em&gt;&lt;/strong&gt; function, the last parameter, &lt;em&gt;lpParam&lt;/em&gt;, is defined as a “Pointer to a value to be passed to the window through the CREATESTRUCT structure passed in the lpParam parameter of the WM_CREATE message.” So we can store any type of pointer we want here, such as a this pointer. This pointer, which will be accessible during a WM_CREATE message, could be used to send messages meant for our application to a non-static window procedure, which would allow us to access the non-static data of our class. But if this pointer is only accessible during a WM_CREATE message, we have to store it with the window when the WM_CREATE message arrives so that all future messages will find their way to our non-static window procedure. We can store our this pointer in the user-defined attribute using the &lt;strong&gt;&lt;em&gt;SetWindowLongPtr&lt;/em&gt;&lt;/strong&gt; function with the GWLP_USERDATA offset flag. With the this pointer now stored with our window, we can access it in all subsequent messages with the &lt;strong&gt;&lt;em&gt;GetWindowLongPtr&lt;/em&gt;&lt;/strong&gt; function. Once the pointer is retreived, we can cast the pointer to a &lt;em&gt;cMainWindow&lt;/em&gt; pointer and access all the non-static functions of the class, such as the non-static window procedure. Using this, we route all messages to their corresponding non-static window procedure.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;That's all there is to creating a window.&lt;/p&gt;&lt;a href="http://www.4shared.com/file/46356000/dd7f1bb7/Game_v01_code.html"&gt;Code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.4shared.com/file/46355999/68058c3b/Game_v01_binaries.html"&gt;Binary&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-4005034510121662548?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/4005034510121662548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=4005034510121662548' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/4005034510121662548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/4005034510121662548'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/04/tutorial-1-creating-window.html' title='Tutorial 1 : Creating a Window'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-4992525000985824058</id><published>2008-04-29T14:36:00.002+05:30</published><updated>2008-05-04T13:20:45.633+05:30</updated><title type='text'>Creating the Window</title><content type='html'>I have finally added the code which deals with creating a window.&lt;br /&gt;&lt;br /&gt;Just a small note of the difference while creating a windowed or a full screen app&lt;br /&gt;&lt;br /&gt;For the windowed mode, the window creation code would be as follows&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;    m_Hwnd = CreateWindowEx(&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                                WS_EX_CLIENTEDGE,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        _T("Window"),&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        lpWindowTitle,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        WS_OVERLAPPEDWINDOW ,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        0, 0,     &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        CW_USEDEFAULT, CW_USEDEFAULT,&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        NULL, &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        NULL, &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;                                                        m_hInstance, &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;this) ;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;For the full screen mode, a few parameters would change&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The 4th parameter would change to &lt;span style="font-style: italic;font-size:85%;" &gt;WS_EX_TOPMOST | WS_POPUP | WS_VISIBLE&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;The&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;7th and 8th  parameters would change to the actual  full screen width and height of the app. &lt;span style="font-style: italic;"&gt;e.g  1024*768&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The rest of the code should be self explanatory. It is documented wherever I felt it was required.&lt;br /&gt;&lt;br /&gt;Maybe one of the many readers can tell me if I need to document something else :-)&lt;br /&gt;&lt;br /&gt;The links :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.4shared.com/file/46356000/dd7f1bb7/Game_v01_code.html"&gt;Code&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.4shared.com/file/46355999/68058c3b/Game_v01_binaries.html"&gt;Binaries&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-4992525000985824058?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/4992525000985824058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=4992525000985824058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/4992525000985824058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/4992525000985824058'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/04/creating-window.html' title='Creating the Window'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8384582151667102223</id><published>2008-04-11T11:52:00.000+05:30</published><updated>2008-04-29T18:18:25.405+05:30</updated><title type='text'>Setting Up the Project</title><content type='html'>In this post I am going to cover how to set up the project&lt;br /&gt;The steps are based on Visual 2005 Professional.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create an Win 32 Project and delete all the files except for stdafx.h, stdafx.cpp and resource.h files&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt; &lt;span style="color: rgb(255, 153, 0);"&gt;(I named the project as &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(255, 153, 0);"&gt;Game&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;)&lt;/span&gt; &lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;I prefer all my source files in one main directory so I created a new folder called src and moved the above files in there&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In the property settings for the project perform the following steps&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;In the tab C/C++ -&gt; General -&gt; Additional Include Directories add "($SolutionDir)Game\src and $(SolutionDir)GraphicsEngine\src &lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For both release and debug modes)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In the tab Linker -&gt; General -&gt; Output File  add $(SolutionDir)\bin\Debug\$(ProjectName)_D.exe &lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For debug mode)&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;and $(SolutionDir)\bin\Release\$(ProjectName).exe &lt;span style="font-style: italic; color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For release mode)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In the tab Linker -&gt; General -&gt; Additional Library Directories add $(SolutionDir)\bin\Debug&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For debug mode)&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;and $(SolutionDir)\bin\Release&lt;span style="font-style: italic; color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(102, 51, 51);"&gt; (&lt;span style="color: rgb(255, 153, 0);"&gt; For release mode)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In the tab Linker -&gt; Input -&gt; Additional Dependencies  add GraphicsEngine_D.lib &lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For debug mode)&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;and GraphicsEngine.lib &lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For release mode)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;Add another Win 32 project to the solution but change the Application Type to DLL &lt;span style="font-style: italic; color: rgb(255, 153, 0);"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;(I named the project as  GraphicsEngine &lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(255, 153, 0);"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(255, 153, 0);"&gt;)&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Again create a new folder called src and move the stdafx files in there&lt;/li&gt;&lt;li&gt;In the property settings for the project perform the following steps&lt;/li&gt;&lt;ul&gt;&lt;li&gt;In the tab C/C++ -&gt; General -&gt; Additional Include Directories add $(SolutionDir)GraphicsEngine\src and $(DXSDK_DIR)\Include &lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For both release and debug modes)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;In the tab C/C++ -&gt; PreProcessor-&gt; PreProcessor Definitions add WINDOWED&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For debug mode)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In the tab Linker -&gt; General -&gt; Output File  add $(SolutionDir)bin\Debug\$(ProjectName)_D.dll &lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For debug mode) &lt;/span&gt;&lt;/span&gt;and $(SolutionDir)bin\Release\$(ProjectName).dll &lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For release mode)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;In the tab Linker -&gt; General -&gt; Additional Library Directories add $(DXSDK_DIR)\Lib\x86&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;( For both release and debug modes)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;/ol&gt;The next post will have the actual code to create our window&lt;br /&gt;&lt;a href="http://dc54.4shared.com/download/43731854/7248dafb/Gamev01.zip?tsid=20080411-013024-d58cda9c"&gt;&lt;br /&gt;&lt;/a&gt;&lt;a href="http://dc42.4shared.com/download/43733657/4bd66ec0/Gamev01_code.zip?tsid=20080411-014740-d642938"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8384582151667102223?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8384582151667102223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8384582151667102223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8384582151667102223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8384582151667102223'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/04/setting-up-project.html' title='Setting Up the Project'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3811056640522029104.post-8296891933605614436</id><published>2008-04-10T20:27:00.000+05:30</published><updated>2008-04-11T02:14:57.070+05:30</updated><title type='text'>My blog got Blocked...</title><content type='html'>The reason I have not been updating my blog is that for some reason my blog got blocked. Anyway, now that I can edit it again, time for a new post :)&lt;br /&gt;&lt;br /&gt;So what have I been upto the past few days???  Well, I have started by writing wrappers for creating the window and initializing the direct3d object/device. I have also written a basic implementation of the A* algorithm.&lt;br /&gt;&lt;br /&gt;Tomorrow I will upload some of the code and also explain how I implemented the wrappers&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3811056640522029104-8296891933605614436?l=speedrunsdev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://speedrunsdev.blogspot.com/feeds/8296891933605614436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3811056640522029104&amp;postID=8296891933605614436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8296891933605614436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3811056640522029104/posts/default/8296891933605614436'/><link rel='alternate' type='text/html' href='http://speedrunsdev.blogspot.com/2008/04/my-blog-got-blocked.html' title='My blog got Blocked...'/><author><name>SpeedRun</name><uri>http://www.blogger.com/profile/15457378163679027546</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
