Comprehensive Tutorial and Reference
Fourth Edition
Upper Saddle River, NJ • Boston • Indianapolis • San Francisco
New York • Toronto • Montreal • London • Munich • Paris • Madrid
Cape Town • Sydney • Tokyo • Singapore • Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.
The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
[email protected]
For sales outside the United States please contact:
International Sales
[email protected]
Visit us on the Web: www.informit.comaw
Library of Congress Cataloging-in-Publication Data:
Wright, Richard S., 1965-
OpenGL superbible : comprehensive tutorial and reference / Richard S. Wright, Jr.,
Benjamin Lipchak, Nicholas Haemel. — 4th ed.
p. cm.
Includes bibliographical references.
ISBN 0-321-49882-8 (pbk. : alk. paper) 1. Computer graphics. 2. OpenGL. I. Lipchak,
Benjamin. II. Haemel, Nicholas. III. Title.
T385.W728 2007
006.6'6—dc22
2007012602
Copyright © 2007 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc.
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax: (617) 671-3447
Portions of the reference pages in Appendix C are Copyright © 2003-2004 Silicon Graphics, Inc. and licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
Portions of the reference pages in Appendix C are Copyright © 2003-2005 3Dlabs Inc. Ltd. and may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. For details, see http://opencontent.org/openpub/.
Portions of the reference pages in Appendix C are Copyright © 2007 The Khronos Group Inc. and licensed under the Khronos Free Use License. For details, see http://www.khronos.org/help/legal/KFUL/.
Portions of the reference pages in Appendix C are Copyright © 2005 Addison-Wesley and may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. For details, see http://opencontent.org/openpub/.
ISBN-13: 978-0-321-49882-3
ISBN-10: 0-321-49882-8
Text printed in the United States on recycled paper at Edwards Brothers, Ann Arbor, Michigan
Second printing December 2007
Editor-in-Chief
Mark Taub
Acquisitions Editor
Debra Williams-Cauley
Development Editor
Songlin Qiu
Technical Reviewers
Paul Martz
Brian Collins
Managing Editor
Gina Kanouse
Senior Project Editor
Lori Lyons
Copy Editor
Cheri Clark
Indexer
Erika Millen
Proofreader
Williams Woods
Publishing
Publishing Coordinator
Kim Boedigheimer
Interior Designer
Gary Adair
Cover Designer
Alan Clements
Composition
Gloria Schurick
For my wife LeeAnne. A work at home mom, on whose mighty shoulders my career stands.
To the memory of Richard S. Wright, Sr. 1 Thessalonians 4:16 Thanks, Dad, for just letting me be a nerd.
—Richard S. Wright Jr.
To my daughter, Felicity. Finally, a labor of love that doesn’t involve pixels. I can’t wait to meet you!
— Benjamin Lipchak
To my wife, Anna, for her enduring patience and support. And to my parents for providing me with more LEGOs than I could get my arms around.
— Nicholas Haemel