Sams - Tricks of the Windows Game ...

Sams - Tricks of the Windows Game Programming Gurus (1999), matma

[ Pobierz całość w formacie PDF ]
Windows
Game Programming Gurus
fundamentals of 2D and 3D Game Programming
André Lamothe
201 West 103rd Street,
Indianapolis, Indiana 46290
Tricks of the
Tricks of the Windows Game
Programming Gurus
Fundamentals of 2D and 3D Game Programming
Copyright
Executive Editor
Don Roche
Acquisitions Editor
Angela Kozlowski
1999 by Sams
All rights reserved. No part of this book shall be reproduced, stored in a
retrieval system, or transmitted by any means, electronic, mechanical, photo-
copying, recording, or otherwise, without written permission from the pub-
lisher. No patent liability is assumed with respect to the use of the information
contained herein. Although every precaution has been taken in the preparation
of this book, the publisher and author assume no responsibility for errors or
omissions. Neither is any liability assumed for damages resulting from the use
of the information contained herein.
Development Editors
Erik Dafforn
Kezia Endsley
Managing Editor
Charlotte Clapp
Project Editor
Carol Bowers
Copy Editors
Sean Medlock
Aaron Black
Howard Jones
International Standard Book Number: 0-672-31361-8
Library of Congress Catalog Card Number: 98-85491
Printed in the United States of America
Indexer
Erika Millen
First Printing: October 1999
Proofreader
Betsy Smith
01 00 99 4 3 2
Trademarks
All terms mentioned in this book that are known to be trademarks or service
marks have been appropriately capitalized. Sams cannot attest to the accuracy
of this information. Use of a term in this book should not be regarded as
affecting the validity of any trademark or service mark.
Technical Editor
Steve Haines
Software Development
Specialists
John Warriner
Dan Scherf
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as
possible, but no warranty or fitness is implied. The information provided is on
an “as is” basis. The author and the publisher shall have neither liability nor
responsibility to any person or entity with respect to any loss or damages aris-
ing from the information contained in this book or from the use of the CD or
programs accompanying it.
Interior Design
Gary Adair
Cover Design
Alan Clements
Layout Technicians
Brandon Allen
Tim Osborn
Staci Somers
Contents at a Glance
Introduction 1
Part I Windows Programming Foundations 7
1 Journey into the Abyss 9
2 The Windows Programming Model 47
3 Advanced Windows Programming 95
4 Windows GDI, Controls, and Last-Minute Gift Ideas 165
Part II DirectX and 2D Fundamentals 211
5 DirectX Fundamentals and the Dreaded COM 213
6 First Contact: DirectDraw 241
7 Advanced DirectDraw and Bitmapped Graphics 287
8 Vector Rasterization and 2D Transformations 401
9 Uplinking with DirectInput and Force Feedback 537
10 Sounding Off with DirectSound and DirectMusic 589
Part III Hardcore Game Programming 645
11 Algorithms, Data Structures, Memory Management, and Multithreading 647
12 Making Silicon Think with Artificial Intelligence 713
13 Playing God: Basic Physics Modeling 797
14 Putting It All Together: You Got Game! 875
Part IV Appendixes 901
A What’s on the CD 903
B Installing DirectX and Using the C/C++ Compiler 907
C Math and Trigonometry Review 911
D C++ Primer 925
E Game Programming Resources 949
F ASCII Tables 955
Index 961
Table of Contents
Introduction 1
P
ART
I Windows Programming Foundations 7
1 Journey into the Abyss 9
A Little History........................................................................................9
Designing Games ..................................................................................13
Types of Games ....................................................................................13
Brainstorming ........................................................................................14
The Design Document and Storyboards................................................15
Making the Game Fun ..........................................................................16
The Components of a Game ..................................................................16
Section 1: Initialization ....................................................................17
Section 2: Enter Game Loop ............................................................17
Section 3: Retrieve Player Input ......................................................17
Section 4: Perform AI and Game Logic ..........................................17
Section 5: Render Next Frame ........................................................18
Section 6: Synchronize Display ......................................................18
Section 7: Loop ................................................................................18
Section 8: Shutdown ........................................................................18
General Game Programming Guidelines ..............................................21
Using Tools ............................................................................................26
C/C++ Compilers ............................................................................26
2D Art Software................................................................................26
Sound Processing Software ..............................................................26
3D Modelers ....................................................................................26
Music and MIDI Sequencing Programs ..........................................27
Setting Up to Get Down—Using the Compiler ....................................27
An Example: FreakOut ..........................................................................29
Summary ................................................................................................46
2 The Windows Programming Model 47
The Genesis of Windows ......................................................................48
Early Windows Versions ..................................................................48
Windows 3.x ....................................................................................48
Windows 95 ......................................................................................49
Windows 98 ......................................................................................50
Windows NT ....................................................................................50
Basic Windows Architecture: Win9X/NT ........................................50
Multitasking and Multithreading ..........................................................51
Getting Info on the Threads ............................................................52
The Event Model ..............................................................................53
[ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • jutuu.keep.pl