Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
108 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Introduction
 The Basics
 The Mouse
 Using DirectInput
 Drawing the Mouse
 Stay Tuned...

 Printable version

 


  The Series

 Part I
 Part II
 Part III
 Part IV

 

Start With The Basics - The Rendering Loop

I'm going to start at the top, by defining a function that will calculate and draw one frame of our GUI system. Let's call this function RenderGUI(). In PDL, RenderGUI does something like this:

void CApplication::RenderGUI(void) { // get position and button status of mouse cursor // calculate mouse cursor's effects on windows / send messages // render all windows // render mouse // flip to screen }

Pretty straightforward for now. Basically, we grab the new position and status of the mouse cursor, calculate any changes that are caused by the new data, render all our windows, render the mouse cursor, then push the whole thing to the screen.


Next : The Mouse