BeginningDirect3D®GameProgramming2nd Edition BeginningDirect3D®GameProgramming2nd Edition Wolfgang F. Engel© 2003 by Premier Press, a division of Course Technology. All rights reserved. No part of this bookmay be reproduced or transmitted in any form or by any means, electronic or mechanical, includingphotocopying, recording, or by any information storage or retrieval system without written permissionfrom Premier Press, except for the inclusion of brief quotations in a review.The Premier Press logo and related trade dress are trademarks of Premier Press and may not be used without written permission.Publisher: Stacy L. HiquetSenior Marketing Manager: Martine EdwardsMarketing Manager: Heather HurleyAssociate Marketing Manager: Kristin EisenzopfManager of Editorial Services: Heather TalbotAcquisitions Editor: Mitzi Foster-KoontzProject Editor/Copy Editor: Cathleen D. SnyderTechnical Reviewer: André LaMotheRetail Market Coordinator: Sarah DuboisInterior Layout: Shawn MorningstarCover Designer: Mike TanamachiCD-ROM Producer: Brandon PenticuffIndexer: Katherine StimsonProofreader: Lorraine GunterDirectDraw, DirectMusic, DirectPlay, DirectSound, DirectX, Microsoft, Visual Basic, Visual C++,Windows, Windows NT, Xbox, and/or other Microsoft products are registered trademarks or trade-marks of Microsoft Corporation in the U.S. and/or other countries. All other trademarks are theproperty of their respective owners.Important: Premier Press cannot provide software support. Please contact the appropriate softwaremanufacturer’s technical support line or Web site for assistance.Premier Press and the author have attempted throughout this book to distinguish proprietary trade-marks from descriptive terms by following the capitalization style used by the manufacturer.Information contained in this book has been obtained by Premier Press from sources believed to bereliable. However, because of the possibility of human or mechanical error by our sources, PremierPress, or others, the Publisher does not guarantee the accuracy, adequacy, or completeness of anyinformation and is not responsible for any errors or omissions or the results obtained from use ofsuch information. Readers should be particularly aware of the fact that the Internet is an ever-chang-ing entity. Some facts may have changed since this book went to press.ISBN: 1-931841-39-x Library of Congress Catalog Card Number: 2003101212Printed in the United States of America03 04 05 06 07 BH 10 9 8 7 6 5 4 3 2 1Premier Press, a division of Course Technology25 Thomson PlaceBoston, MA 02210Für meine Frau Katja und unsere Tochter AnjaAcknowledgmentsThis book couldn’t have been completed without the help of many people. In particular, I want to thank my parents, who gave me a wonderful and warm child-hood; my wife, Katja, for being patient with a spare-time author; and our nearly two-year-olddaughter, Anna, for showing me the important things in ...