SUPERBIBLE Fourth Edition
Comprehensive Tutorial and Reference
Richard S. Wright, Jr.
Benjamin Lipchak
Nicholas Haemel
Benjamin Lipchak
Nicholas Haemel
Richard S. Wright, Jr. has been using OpenGL for more than 12 years, since it first
became available on the Windows platform, and teaches OpenGL programming in the
game design degree program at Full Sail in Orlando, Florida. Currently, Richard is the president
of Starstone Software Systems, Inc., where he develops third-party multimedia simulation
software for the PC and Macintosh platforms using OpenGL.
Previously with Real 3D/Lockheed Martin, Richard was a regular OpenGL ARB attendee
and contributed to the OpenGL 1.2 specification and conformance tests. Since then,
Richard has worked in multidimensional database visualization, game development,
medical diagnostic visualization, and astronomical space simulation.
Richard first learned to program in the eighth grade in 1978 on a paper terminal. At age
16, his parents let him buy a computer with his grass-cutting money instead of a car, and
he sold his first computer program less than a year later (and it was a graphics program!).
When he graduated from high school, his first job was teaching programming and
computer literacy for a local consumer education company. He studied electrical engineering
and computer science at the University of Louisville’s Speed Scientific School and
made it half way through his senior year before his career got the best of him and took
him to Florida. A native of Louisville, Kentucky, he now lives with his wife and three children
in Lake Mary, Florida. When not programming or dodging hurricanes, Richard is an
avid amateur astronomer and an Adult Sunday School teacher.
Benjamin Lipchak graduated from Worcester Polytechnic Institute with a double major
in technical writing and computer science. “Why would anyone with a CS degree want to
become a writer?” That was the question asked of him one fateful morning when Benj was
interviewing for a tech writing job at Digital Equipment Corporation. Benj’s interview
took longer than scheduled, and he left that day with job offer in hand to work on the
software team responsible for DEC’s AlphaStation OpenGL drivers.
Benj’s participation in the OpenGL Architecture Review Board began when he chaired the
working group that generated the GL_ARB_fragment_program extension spec. While
chairing the Khronos OpenGL Ecosystem Technical SubGroup, he established the OpenGL
SDK and created the OpenGL Pipeline newsletter, of which he remains editor.
Benj will now participate in the Khronos OpenGL ES Working Group. After 12 years of
OpenGL driver development and driver team management at DEC, Compaq, and ATI, he
is headed for smaller pastures. Benj recently became manager of AMD’s handheld software
team. Although the API is familiar, the new challenges of size and power consumption
make for a great change of scenery. In his fleeting spare time, Benj tries to get outdoors for
some hiking or kayaking. He also operates an independent record label, Wachusett
Records, specializing in solo piano music.
Nicholas Haemel, developer at AMD in the Graphics Products Group, was technical
reviewer for OpenGL SuperBible, Third Edition, and contributed the chapters on GLX and
OpenGL ES.
Acknowledgments
First, I have to thank God for somehow turning an innumerable amount of seemingly bad
decisions into gold. Including against all “good advice” to get into computer graphics and
OpenGL in particular. Second, I have to thank my wife LeeAnne. There was no way I could
take on the fourth edition of this book, and I initially decided not to take this project on.
She pretty much made me do it—and without complaining or whimpering shouldered all
Boy Scout meetings, Girl Scout meetings, music lessons, school meetings, parent orientations,
bake sales, fund raisers, soccer practices (NO I did not miss any games!), trips to the
doctor, shopping trips, grocery runs, friends birthday parties, social engagements of every
size and shape, and pretty much all of Christmas. Many late nighters were also made
possible by a thermos of “Mamma’s Magic Mojo”; Starbuck’s, eat your heart out! All three
of my brilliant children, Sara, Stephen, and Alex, thanks so much for letting Daddy hide
out every night after dinner—and not giving me too much grief over missed movies and camping trips.
Thank you Benjamin Lipchak and Nick Haemel for being first-class coauthors. Your contributions
to the book have had a lot to do with its recent longevity. Special thanks because
you were both crazy enough to do this twice! Thanks to AMD/ATI for letting these guys
out of the box, and for the use of some really cool sample shaders. The editors and staff at
Addison Wesley have also been fantastic. Debra Williams-Cauley was especially patient
and somewhat creative when it came to getting this project off the ground. Working with
Songlin Qiu has been a great pleasure, and I especially appreciated her frequent encouragement
just when I felt like this project would never end. Cheri Clark, thanks for making me
look like I didn’t sleep through high school English! Thank you, Lori Lyons, for being
persistent about those pesky deadlines. I am also honored to have had Dave Shreiner, Paul
Martz, and Brian Collins involved in this edition. Paul and Brian’s review of the chapters
has without a doubt increased the caliber of this edition substantially over my past efforts.
Many thanks also go out to Apple—in particular Kent Miller for some help on the Mac
chapter—but also to everyone on the Apple OpenGL mailing list for many questions
answered, and tips just picked up by trolling! NVIDIA also chipped in, with thanks in
particular to Brian Harvey and Cass Everitt for being responsive to questions, and especially
thanks to Michael Gold and Barthold Lichtenbelt for a conference call getting me up
to speed on the OpenGL situation in Windows Vista. Thanks, too, to Robert Kennett at
AMD/ATI for updating some code for me in the Windows chapter.
Many thanks to Full Sail for their support over the past few years by allowing me the privilege
of teaching OpenGL on a part-time basis. I come in for a few hours, I get to talk about
what I really love to talk about, and the audience has to act as though they enjoy it and
pay attention. I even get paid. How on earth I keep getting away with this is beyond me!
Thank you, Rob Catto, for covering for me and looking the other way from time to time.
Ed Womack, you are a scholar and a gentleman, and your F-16 model rocks. I’m sorry I
defaced it with an OpenGL logo[el] but I couldn’t help myself. Thanks also to my lab
specialist Chris Baptiste, for a great attitude and for teaching my class from time to time
so that I could get some other work done. Finally, I’d like to thank Software Bisque for this
contractors dream “day job” of making great astronomy software, and getting paid to use
OpenGL on a daily basis. Steve, Tom, Daniel, and Matt, you are all a class act. Working
with you guys is an honor and privilege, not to mention a total blast!
I’d like to begin by acknowledging my colleagues at AMD who have unselfishly given
their valuable time and advice reviewing my chapters, and leaving me to take all the
credit. These folks are the masters of the OpenGL universe, and I am fortunate to work
side by side with (or sometimes hundreds of miles away from) this caliber of individual on
a daily basis. In particular, I’d like to thank Dan Ginsburg, Rick Hammerstone, Evan Hart
(now at NVIDIA), Bill Licea-Kane, Glenn Ortner, and Jeremy Sandmel (now at Apple).
Thanks to technical editors Paul Martz and Brian Collins for their depth and breadth of
knowledge and for unleashing it mercilessly. And most of all, thanks to Richard Wright for
the opportunity to work with you again on this project.
Thanks to the team of editors and other support staff at Addison-Wesley for transforming
my lowly text into something I’m proud of. Your eagle eyes spared me from sweating the
details, making writing hundreds of pages much less strenuous.
Thanks to WPI professors Mike Gennert, Karen Lemone, John Trimbur, Susan Vick, Matt
Ward, Norm Wittels, and others for the solid foundation I lean on every day. A shout out
to all my friends at GweepNet for distracting me with PC game LAN parties when I was
burnt out from too much writing. To my entire extended family, including Beth, Tim,
Alicia, Matt, Jen, and Corey, thanks for tolerating my surgically attached laptop during the
winter months. To Mom and Dad, for providing me with top-quality genetic material and
for letting me bang away on the TRS-80 when I should have been outside banging sticks
against trees, I am forever grateful. To brother Paul, your success in everything you do
provides me with nonstop healthy competition. To sister Maggie, you redefine success in
my eyes every time I see you. You both make me proud to have you as siblings. Last, but
not least, I’d like to thank my wife, Jessica, for the science project she’s been assembling
in her belly while I funnel all my attention into a laptop computer. It’s time for our project now.
First, I would like to thank Richard and Benj for allowing me the opportunity to collaborate
on this project. You guys have been great and very supportive for a new author.
Thanks for putting up with all my silly questions. Also, thanks to ATI. What a great stomping
ground for someone to get started in graphics! A special thanks to all of my friends
and mentors at ATI—you all have been a great help and resource, and the best in the field!
I would also like to acknowledge the editors and staff at Addison Wesley. You have been
incredibly helpful throughout the entire process. Thanks for all your hard work in polishing
our text and keeping us on track.
Last, and certainly not least, I would like to thank my wife Anna, and all of my family for
putting up with my distraction through this whole process. You graciously have been
patient, even through the holidays, as I struggled with my deadlines. Anna, your dedication
to medicine and your own publications has given me the strength to finish this
project. Thank you for all your support and encouraging words, despite being even busier than I.
Introduction
became available on the Windows platform, and teaches OpenGL programming in the
game design degree program at Full Sail in Orlando, Florida. Currently, Richard is the president
of Starstone Software Systems, Inc., where he develops third-party multimedia simulation
software for the PC and Macintosh platforms using OpenGL.
Previously with Real 3D/Lockheed Martin, Richard was a regular OpenGL ARB attendee
and contributed to the OpenGL 1.2 specification and conformance tests. Since then,
Richard has worked in multidimensional database visualization, game development,
medical diagnostic visualization, and astronomical space simulation.
Richard first learned to program in the eighth grade in 1978 on a paper terminal. At age
16, his parents let him buy a computer with his grass-cutting money instead of a car, and
he sold his first computer program less than a year later (and it was a graphics program!).
When he graduated from high school, his first job was teaching programming and
computer literacy for a local consumer education company. He studied electrical engineering
and computer science at the University of Louisville’s Speed Scientific School and
made it half way through his senior year before his career got the best of him and took
him to Florida. A native of Louisville, Kentucky, he now lives with his wife and three children
in Lake Mary, Florida. When not programming or dodging hurricanes, Richard is an
avid amateur astronomer and an Adult Sunday School teacher.
Benjamin Lipchak graduated from Worcester Polytechnic Institute with a double major
in technical writing and computer science. “Why would anyone with a CS degree want to
become a writer?” That was the question asked of him one fateful morning when Benj was
interviewing for a tech writing job at Digital Equipment Corporation. Benj’s interview
took longer than scheduled, and he left that day with job offer in hand to work on the
software team responsible for DEC’s AlphaStation OpenGL drivers.
Benj’s participation in the OpenGL Architecture Review Board began when he chaired the
working group that generated the GL_ARB_fragment_program extension spec. While
chairing the Khronos OpenGL Ecosystem Technical SubGroup, he established the OpenGL
SDK and created the OpenGL Pipeline newsletter, of which he remains editor.
Benj will now participate in the Khronos OpenGL ES Working Group. After 12 years of
OpenGL driver development and driver team management at DEC, Compaq, and ATI, he
is headed for smaller pastures. Benj recently became manager of AMD’s handheld software
team. Although the API is familiar, the new challenges of size and power consumption
make for a great change of scenery. In his fleeting spare time, Benj tries to get outdoors for
some hiking or kayaking. He also operates an independent record label, Wachusett
Records, specializing in solo piano music.
Nicholas Haemel, developer at AMD in the Graphics Products Group, was technical
reviewer for OpenGL SuperBible, Third Edition, and contributed the chapters on GLX and
OpenGL ES.
Acknowledgments
First, I have to thank God for somehow turning an innumerable amount of seemingly bad
decisions into gold. Including against all “good advice” to get into computer graphics and
OpenGL in particular. Second, I have to thank my wife LeeAnne. There was no way I could
take on the fourth edition of this book, and I initially decided not to take this project on.
She pretty much made me do it—and without complaining or whimpering shouldered all
Boy Scout meetings, Girl Scout meetings, music lessons, school meetings, parent orientations,
bake sales, fund raisers, soccer practices (NO I did not miss any games!), trips to the
doctor, shopping trips, grocery runs, friends birthday parties, social engagements of every
size and shape, and pretty much all of Christmas. Many late nighters were also made
possible by a thermos of “Mamma’s Magic Mojo”; Starbuck’s, eat your heart out! All three
of my brilliant children, Sara, Stephen, and Alex, thanks so much for letting Daddy hide
out every night after dinner—and not giving me too much grief over missed movies and camping trips.
Thank you Benjamin Lipchak and Nick Haemel for being first-class coauthors. Your contributions
to the book have had a lot to do with its recent longevity. Special thanks because
you were both crazy enough to do this twice! Thanks to AMD/ATI for letting these guys
out of the box, and for the use of some really cool sample shaders. The editors and staff at
Addison Wesley have also been fantastic. Debra Williams-Cauley was especially patient
and somewhat creative when it came to getting this project off the ground. Working with
Songlin Qiu has been a great pleasure, and I especially appreciated her frequent encouragement
just when I felt like this project would never end. Cheri Clark, thanks for making me
look like I didn’t sleep through high school English! Thank you, Lori Lyons, for being
persistent about those pesky deadlines. I am also honored to have had Dave Shreiner, Paul
Martz, and Brian Collins involved in this edition. Paul and Brian’s review of the chapters
has without a doubt increased the caliber of this edition substantially over my past efforts.
Many thanks also go out to Apple—in particular Kent Miller for some help on the Mac
chapter—but also to everyone on the Apple OpenGL mailing list for many questions
answered, and tips just picked up by trolling! NVIDIA also chipped in, with thanks in
particular to Brian Harvey and Cass Everitt for being responsive to questions, and especially
thanks to Michael Gold and Barthold Lichtenbelt for a conference call getting me up
to speed on the OpenGL situation in Windows Vista. Thanks, too, to Robert Kennett at
AMD/ATI for updating some code for me in the Windows chapter.
Many thanks to Full Sail for their support over the past few years by allowing me the privilege
of teaching OpenGL on a part-time basis. I come in for a few hours, I get to talk about
what I really love to talk about, and the audience has to act as though they enjoy it and
pay attention. I even get paid. How on earth I keep getting away with this is beyond me!
Thank you, Rob Catto, for covering for me and looking the other way from time to time.
Ed Womack, you are a scholar and a gentleman, and your F-16 model rocks. I’m sorry I
defaced it with an OpenGL logo[el] but I couldn’t help myself. Thanks also to my lab
specialist Chris Baptiste, for a great attitude and for teaching my class from time to time
so that I could get some other work done. Finally, I’d like to thank Software Bisque for this
contractors dream “day job” of making great astronomy software, and getting paid to use
OpenGL on a daily basis. Steve, Tom, Daniel, and Matt, you are all a class act. Working
with you guys is an honor and privilege, not to mention a total blast!
—Richard S. Wright Jr.
their valuable time and advice reviewing my chapters, and leaving me to take all the
credit. These folks are the masters of the OpenGL universe, and I am fortunate to work
side by side with (or sometimes hundreds of miles away from) this caliber of individual on
a daily basis. In particular, I’d like to thank Dan Ginsburg, Rick Hammerstone, Evan Hart
(now at NVIDIA), Bill Licea-Kane, Glenn Ortner, and Jeremy Sandmel (now at Apple).
Thanks to technical editors Paul Martz and Brian Collins for their depth and breadth of
knowledge and for unleashing it mercilessly. And most of all, thanks to Richard Wright for
the opportunity to work with you again on this project.
Thanks to the team of editors and other support staff at Addison-Wesley for transforming
my lowly text into something I’m proud of. Your eagle eyes spared me from sweating the
details, making writing hundreds of pages much less strenuous.
Thanks to WPI professors Mike Gennert, Karen Lemone, John Trimbur, Susan Vick, Matt
Ward, Norm Wittels, and others for the solid foundation I lean on every day. A shout out
to all my friends at GweepNet for distracting me with PC game LAN parties when I was
burnt out from too much writing. To my entire extended family, including Beth, Tim,
Alicia, Matt, Jen, and Corey, thanks for tolerating my surgically attached laptop during the
winter months. To Mom and Dad, for providing me with top-quality genetic material and
for letting me bang away on the TRS-80 when I should have been outside banging sticks
against trees, I am forever grateful. To brother Paul, your success in everything you do
provides me with nonstop healthy competition. To sister Maggie, you redefine success in
my eyes every time I see you. You both make me proud to have you as siblings. Last, but
not least, I’d like to thank my wife, Jessica, for the science project she’s been assembling
in her belly while I funnel all my attention into a laptop computer. It’s time for our project now.
—Benjamin Lipchak
First, I would like to thank Richard and Benj for allowing me the opportunity to collaborate
on this project. You guys have been great and very supportive for a new author.
Thanks for putting up with all my silly questions. Also, thanks to ATI. What a great stomping
ground for someone to get started in graphics! A special thanks to all of my friends
and mentors at ATI—you all have been a great help and resource, and the best in the field!
I would also like to acknowledge the editors and staff at Addison Wesley. You have been
incredibly helpful throughout the entire process. Thanks for all your hard work in polishing
our text and keeping us on track.
Last, and certainly not least, I would like to thank my wife Anna, and all of my family for
putting up with my distraction through this whole process. You graciously have been
patient, even through the holidays, as I struggled with my deadlines. Anna, your dedication
to medicine and your own publications has given me the strength to finish this
project. Thank you for all your support and encouraging words, despite being even busier than I.
—Nicholas Haemel
Introduction
Welcome to the fourth edition of the OpenGL SuperBible. For more than ten years, we have
striven to provide the world’s best introduction to not only OpenGL, but 3D graphics
programming in general. This book is both a comprehensive reference of the entire
OpenGL API and a tutorial that will teach you how to use this powerful API to create stunning
3D visualizations, games, and other graphics of all kinds. Starting with basic 3D
terminology and concepts, we take you through basic primitive assembly, transformations,
lighting, texturing, and eventually bring you into the full power of the programmable
graphics pipeline with the OpenGL Shading Language.
Regardless of whether you are programming on Windows, Mac OS X, Linux, or a handheld
gaming device, this book is a great place to start learning OpenGL, and how to make
the most of it on your specific platform. The majority of the book is highly portable C++
code hosted by the GLUT or FreeGLUT toolkit. You will also find OS-specific chapters that
show how to wire OpenGL into your native window systems. Throughout the book, we
try to make few assumptions about how much previous knowledge the reader has of 3D
graphics programming topics. This yields a tutorial that is accessible by both the beginning
programmer and the experienced programmer beginning OpenGL.
What’s New in This Edition
Readers of the previous editions will notice right away that the reference material has
been reorganized. Instead of attempting to place individual functions with chapters that
use them, we now have Appendix C, which contains the complete OpenGL API reference
for the GL function. This is a much more appropriate and useful organizational structure
for this material. These reference pages are also now based on the “official” OpenGL man
pages, which means there will be no more incomplete or missing function calls. Detailed
function entries will also be more concise and complete.
The Mac OS X and Linux chapters in this edition have been totally rewritten from the
ground up. Sometimes a revision is not sufficient, and the best thing to do is just start
over. We think readers will like these two newly rewritten chapters, which will be useful to
anyone needing an introduction to the specifics of getting OpenGL up and running on
their particular platform. Also, on the platform topic, the Windows chapter has been
updated and pruned of some older and obsolete topics. Of note is the fact that OpenGL’s
widely rumored demise on Vista has, in fact, NOT occurred.
We have also added two completely new chapters. In this edition, we bring you full coverage
of the latest OpenGL ES specification. We also provide a very exciting chapter on
advanced OpenGL buffer usage, including off screen rendering, floating point buffers and
textures, and pixel buffer objects. Throughout all the chapters, coverage has been touched
up to include OpenGL 2.1 functionality, and to focus more on current OpenGL programming
techniques. (Chapter 11, for example, deals with geometry submission and was
modified heavily for this purpose.)
Finally, you’ll find a Color insert with a gallery of images for which black and white just
does not do adequate justice. A book on graphics programming is certainly more useful
with color images. Some techniques, for example, are impossible to demonstrate on the
printed page without the use of color. Other images are provided because the black-andwhite
versions simply do not convey the same information about how a particular image should look.
How This Book Is Organized
The OpenGL SuperBible is divided into three parts: The Old Testament, The New Testament,
and the Apocrypha. Each section covers a particular personality of OpenGL—namely, the
fixed pipeline, programmable hardware, and finally some platform-specific bindings. We
certainly would not equate our humble work with anyone’s sacred texts. However, the
informed reader will certainly see how strong and irresistible this metaphor actually is.
Part I: The Old Testament
You’ll learn how to construct a program that uses OpenGL, how to set up your 3D-rendering
environment, and how to create basic objects and light and shade them. Then we’ll
delve deeper into using OpenGL and some of its advanced features and different special
effects. These chapters are a good way to introduce yourself to 3D graphics programming
with OpenGL and provide the conceptual foundation on which the more advanced capabilities later in the book are based.
Chapter 1—Introduction to 3D Graphics and OpenGL. This introductory chapter is
for newcomers to 3D graphics. It introduces fundamental concepts and some common vocabulary.
Chapter 2—Using OpenGL. In this chapter, we provide you with a working knowledge of
what OpenGL is, where it came from, and where it is going. You will write your first
program using OpenGL, find out what headers and libraries you need to use, learn how to
set up your environment, and discover how some common conventions can help you
remember OpenGL function calls.
We also introduce the OpenGL state machine and errorhandling mechanism.
Chapter 3—Drawing in Space: Geometric Primitives and Buffers. Here, we present
the building blocks of 3D graphics programming. You’ll basically find out how to tell a
computer to create a three-dimensional object with OpenGL. You’ll also learn the basics
of hidden surface removal and ways to use the stencil buffer.
Chapter 4—Geometric Transformations: The Pipeline. Now that you’re creating threedimensional
shapes in a virtual world, how do you move them around? How do you
move yourself around? These are the things you’ll learn here.
Chapter 5—Color, Materials, and Lighting: The Basics. In this chapter, you’ll take your
three-dimensional “outlines” and give them color. You’ll learn how to apply material
effects and lights to your graphics to make them look real.
Chapter 6—More on Colors and Materials. Now it’s time to learn about blending objects
with the background to make transparent (see-through) objects. You’ll also learn some
special effects with fog and the accumulation buffer.
Chapter 7—Imaging with OpenGL. This chapter is all about manipulating image data
within OpenGL. This information includes reading a TGA file and displaying it in an
OpenGL window. You’ll also learn some powerful OpenGL image-processing capabilities.
Chapter 8—Texture Mapping: The Basics. Texture mapping is one of the most useful
features of any 3D graphics toolkit. You’ll learn how to wrap images onto polygons and
how to load and manage multiple textures at once.
Chapter 9—Texture Mapping: Beyond the Basics. In this chapter, you’ll learn how to
generate texture coordinates automatically, use advanced filtering modes, and use built-in
hardware support for texture compression. You’ll also learn about OpenGL’s support for point sprites.
Chapter 10—Curves and Surfaces. The simple triangle is a powerful building block. This
chapter gives you some tools for manipulating the mighty triangle. You’ll learn about
some of OpenGL’s built-in quadric surface generation functions and ways to use automatic
tessellation to break complex shapes into smaller, more digestible pieces. You’ll also
explore the utility functions that evaluate Bézier and NURBS curves and surfaces. You can
use these functions to create complex shapes with an amazingly small amount of code.
Chapter 11—It’s All About the Pipeline: Faster Geometry Throughput. For this chapter,
we introduce OpenGL display lists, vertex arrays, and vertex buffer objects for improving
performance and organizing your models. You’ll also learn how to create a detailed analysis
showing how to best represent large, complex models.
Chapter 12—Interactive Graphics. This chapter explains two OpenGL features: selection
and feedback. These groups of functions make it possible for the user to interact with
objects in the scene. You can also get rendering details about any single object in the scene.
Chapter 13—Occlusion Queries: Why Do More Work Than You Need To? Here, you’ll
learn about the OpenGL occlusion query mechanism. This feature effectively lets you
perform an inexpensive test-render of objects in your scene to find out whether they will
be hidden behind other objects, in which case you can save time by not drawing the
actual full-detail version.
Chapter 14—Depth Textures and Shadows. This chapter covers OpenGL’s depth textures
and shadow comparisons. You’ll learn how to introduce real-time shadow effects to your
scene, regardless of the geometry’s complexity.
Part II: The New Testament
In the second part of the book, you’ll find chapters on the new features in OpenGL
supporting programmable hardware, in particular the OpenGL Shading Language (GLSL).
These chapters don’t represent just the newest OpenGL features, they cover the fundamental
shift that has occurred in graphics programming—a shift that is fundamentally different,
yet complementary, and descended from the old fixed-pipeline-based hardware.
Chapter 15—Programmable Pipeline: This Isn’t Your Father’s OpenGL. Out with the
old, in with the new. This chapter revisits the conventional fixed-functionality pipeline
before introducing the new programmable vertex and fragment pipeline stages.
Programmability via the OpenGL Shading Language allows you to customize your rendering
in ways never before possible.
Chapter 16—Vertex Shading: Do-It-Yourself Transform, Lighting, and Texgen. This
chapter illustrates the usage of vertex shaders by surveying a handful of examples, including
lighting, fog, squash and stretch, and skinning.
Chapter 17—Fragment Shading: Empower Your Pixel Processing. You learn by
example—with a variety of fragment shaders. Examples include per-pixel lighting, color
conversion, image processing, bump mapping, and procedural texturing. Some of these
examples also use vertex shaders; these examples are representative of real-world usage,
where you often find vertex and fragment shaders paired together.
Chapter 18—Advanced Buffers. Here, we discuss some of the latest and most exciting
features in OpenGL, including offscreen accelerated rendering, faster ways to copy pixel
data asynchronously, and floating-point color data for textures and color buffers.
Part III: The Apocrypha
Where do we put material that does not belong in the OpenGL canon? The Apocrypha!
The third and last part of the book is less about OpenGL than about how different operating
systems interface with and make use of OpenGL. Here we wander outside the “official”
OpenGL specification to see how OpenGL is supported and interfaced with on Windows,
Mac OS X, Linux, and hand-held devices.
Chapter 19—Wiggle: OpenGL on Windows. Here, you’ll learn how to write real
Windows (message-based) programs that use OpenGL. You’ll learn about Microsoft’s
“wiggle” functions that glue OpenGL rendering code to Windows device contexts.
You’ll also learn how to respond to Windows messages for clean, well-behaved OpenGL
applications. Yes, we also talk about OpenGL on Vista.
Chapter 20—OpenGL on Mac OS X. In this chapter, you’ll learn how to use OpenGL in
native Mac OS X applications. Sample programs show you how to start working with
GLUT, Carbon, or Cocoa using the Xcode development environment.
Chapter 21—GLX: OpenGL on Linux. This chapter discusses GLX, the OpenGL extension
used to support OpenGL applications through the X Window System on UNIX and
Linux. You’ll learn how to create and manage OpenGL contexts as well as how to create
OpenGL drawing areas.
Chapter 22—OpenGL ES: OpenGL on the Small. This chapter is all about how OpenGL
is pared down to fit on hand-held and embedded devices. We cover what’s gone, what’s
new, and how to get going even with an emulated environment.
Conventions Used in This Book
The following typographic conventions are used in this book:
• Code lines, commands, statements, variables,
and any text you type or see onscreen appear in a computer typeface.
• Placeholders in syntax descriptions appear in an italic computer typeface. You
should replace the placeholder with the actual filename,
parameter, or whatever element it represents.
• Italics highlight technical terms when they first appear in the text and are being defined.
About the Companion Web Site
This is the first time this book has shipped without a CD-ROM. Welcome to the age of the
Internet! Instead, all our source code is available online at our support
Web site: www.opengl.org/superbible
Here you’ll find the source code to all the sample programs in the book, as well as prebuilt
projects for Developers Studio (Windows), and Xcode (Mac OS X). For Linux users we’ll
have make files for command-line building of the projects as well. We even plan to post a
few tutorials, so check back from time to time, even after you’ve downloaded all the source code.
Product details
Price
|
|
---|---|
File Size
| 13,225 KB |
Pages
|
1262 p |
File Type
|
PDF format |
ISBN
| 0-321-49882-8 |
Copyright
| 2007 Pearson Education, Inc |
Contents at a Glance
Preface
About the Authors
Introduction
Part I The Old Testament
1 Introduction to 3D Graphics and OpenGL
2 Using OpenGL
3 Drawing in Space: Geometric Primitives and Buffers
4 Geometric Transformations: The Pipeline
5 Color, Materials, and Lighting: The Basics
6 More on Colors and Materials
7 Imaging with OpenGL
8 Texture Mapping: The Basics
9 Texture Mapping: Beyond the Basics
10 Curves and Surfaces
11 It’s All About the Pipeline: Faster Geometry Throughput
12 Interactive Graphics
13 Occlusion Queries: Why Do More Work Than You Need To?
14 Depth Textures and Shadows
Part II The New Testament
15 Programmable Pipeline: This Isn’t Your Father’s OpenGL
16 Vertex Shading: Do-It-Yourself Transform, Lighting, and Texgen
17 Fragment Shading: Empower Your Pixel Processing
18 Advanced Buffers
Part III The Apocrypha
19 Wiggle: OpenGL on Windows
20 OpenGL on MacOS X
21 OpenGL on Linux.
22 OpenGL ES – OpenGL on the Small
A Appendix A: Further Reading/References
B Appendix B: Glossary
C Appendix C: API Reference
Index
Table of Contents
Preface .......
About the Authors.....
Introduction ..................
What’s New in This Edition.......
How This Book Is Organized ........
Part I: The Old Testament ........
Part II: The New Testament ..
Part III: The Apocrypha ...
Conventions Used in This Book...
About the Companion Web Site .........
Part I The Old Testament ...............7
1 Introduction to 3D Graphics and OpenGL............................9
A Brief History of Computer Graphics ...........................................................9
Going Electric ......................................................................................10
Going 3D .............................................................................................11
A Survey of 3D Effects ..................................................................................14
Perspective ...........................................................................................14
Color and Shading...............................................................................15
Light and Shadows ..............................................................................15
Texture Mapping..................................................................................16
Fog........................................................................................................17
Blending and Transparency.................................................................18
Antialiasing ..........................................................................................18
Common Uses for 3D Graphics....................................................................19
Real-Time 3D .......................................................................................19
Non–Real-Time 3D...............................................................................22
Shaders .................................................................................................22
Basic 3D Programming Principles ................................................................23
Immediate Mode and Retained Mode.................................................23
Coordinate Systems .............................................................................24
Projections: Getting 3D to 2D.............................................................28
Summary .......................................................................................................30
2 Using OpenGL.......................................33
What Is OpenGL? .........................................................................................33
Evolution of a Standard.......................................................................34
The API Wars .......................................................................................36
The Future of OpenGL ........................................................................37
How Does OpenGL Work?............................................................................38
Generic Implementations....................................................................38
Hardware Implementations.................................................................39
The Pipeline .........................................................................................40
OpenGL: An API, Not a Language................................................................41
Standard Libraries and Headers...........................................................41
Some Header Customizations .............................................................42
API Specifics ..................................................................................................43
Data Types............................................................................................44
Function-Naming Conventions ..........................................................45
Platform Independence ................................................................................46
Using GLUT .........................................................................................47
Your First Program ...............................................................................48
Drawing Shapes with OpenGL............................................................53
Animation with OpenGL and GLUT............................................................61
Double Buffering .................................................................................64
The OpenGL State Machine .........................................................................65
Saving and Restoring States.................................................................66
OpenGL Errors ..............................................................................................67
When Bad Things Happen to Good Code ..........................................67
Identifying the Version.................................................................................68
Getting a Clue with glHint...........................................................................69
Using Extensions...........................................................................................69
Checking for an Extension..................................................................69
Whose Extension Is This?....................................................................71
Summary .......................................................................................................71
3 Drawing in Space: Geometric Primitives and Buffers.......................73
Drawing Points in 3D ...................................................................................74
Setting Up a 3D Canvas................................................................................74
A 3D Point: The Vertex.................................................................................76
Draw Something! ..........................................................................................77
Drawing Points ....................................................................................78
Our First Example................................................................................78
Setting the Point Size....................................................................................81
Drawing Lines in 3D.....................................................................................85
Line Strips and Loops ..........................................................................87
Approximating Curves with Straight Lines ........................................88
Setting the Line Width ........................................................................89
Line Stippling.......................................................................................91
Drawing Triangles in 3D...............................................................................94
Triangles: Your First Polygon...............................................................94
Winding ...............................................................................................95
Triangle Strips ......................................................................................96
Triangle Fans........................................................................................97
Building Solid Objects...................................................................................98
Setting Polygon Colors ......................................................................101
Hidden Surface Removal ...................................................................102
Culling: Hiding Surfaces for Performance.........................................104
Polygon Modes ..................................................................................107
Other Primitives..........................................................................................107
Four-Sided Polygons: Quads..............................................................108
Quad Strips ........................................................................................108
General Polygons...............................................................................108
Filling Polygons, or Stippling Revisited ............................................109
Polygon Construction Rules..............................................................113
Subdivision and Edges.......................................................................114
Other Buffer Tricks......................................................................................117
Using Buffer Targets...........................................................................117
Manipulating the Depth Buffer.........................................................119
Cutting It Out with Scissors ..............................................................119
Using the Stencil Buffer.....................................................................121
Creating the Stencil Pattern ..............................................................122
Summary .....................................................................................................126
4 Geometric Transformations: The Pipeline ..........................127
Is This the Dreaded Math Chapter? ...........................................................127
Understanding Transformations.................................................................128
Eye Coordinates.................................................................................129
Viewing Transformations ..................................................................130
Modeling Transformations ................................................................130
The Modelview Duality .....................................................................132
Projection Transformations ...............................................................132
Viewport Transformations.................................................................134
The Matrix: Mathematical Currency for 3D Graphics...............................134
What Is a Matrix? ..............................................................................134
The Transformation Pipeline.............................................................135
The Modelview Matrix ......................................................................136
The Identity Matrix ...........................................................................140
The Matrix Stacks ..............................................................................142
A Nuclear Example ............................................................................143
Using Projections ........................................................................................146
Orthographic Projections ..................................................................147
Perspective Projections ......................................................................148
A Far-Out Example ............................................................................151
Advanced Matrix Manipulation .................................................................154
Loading a Matrix ...............................................................................156
Performing Your Own Transformations............................................157
Adding Transformations Together.....................................................160
Moving Around in OpenGL Using Cameras and Actors ...........................161
An Actor Frame..................................................................................161
Euler Angles: “Use the Frame, Luke!” ...............................................163
Camera Management ........................................................................164
Bringing It All Together ..............................................................................165
Summary .....................................................................................................171
5 Color, Materials, and Lighting: The Basics..............................173
What Is Color? ............................................................................................174
Light as a Wave..................................................................................174
Light as a Particle...............................................................................175
Your Personal Photon Detector .........................................................176
The Computer as a Photon Generator..............................................176
PC Color Hardware .....................................................................................177
PC Display Modes .......................................................................................179
Screen Resolution ..............................................................................179
Color Depth .......................................................................................179
Using Color in OpenGL..............................................................................180
The Color Cube .................................................................................180
Setting the Drawing Color ................................................................182
Shading ..............................................................................................183
Setting the Shading Model ................................................................185
Color in the Real World..............................................................................186
Ambient Light....................................................................................187
Diffuse Light ......................................................................................188
Specular Light ....................................................................................188
Putting It All Together.......................................................................189
Materials in the Real World ........................................................................190
Material Properties.............................................................................190
Adding Light to Materials..................................................................190
Calculating Ambient Light Effects ....................................................190
Diffuse and Specular Effects ..............................................................191
Adding Light to a Scene..............................................................................192
Enabling the Lighting........................................................................192
Setting Up Cosmic Background Radiation........................................192
Setting Material Properties ................................................................193
Using a Light Source ...................................................................................196
Which Way Is Up?.............................................................................197
Surface Normals.................................................................................197
Specifying a Normal ..........................................................................198
Unit Normals .....................................................................................201
Finding a Normal...............................................................................202
Setting Up a Source............................................................................203
Setting the Material Properties ..........................................................205
Specifying the Polygons ....................................................................205
Lighting Effects ...........................................................................................207
Specular Highlights............................................................................207
Specular Light ....................................................................................208
Specular Reflectance ..........................................................................208
Specular Exponent.............................................................................209
Normal Averaging..............................................................................211
Putting It All Together ................................................................................213
Creating a Spotlight...........................................................................214
Drawing a Spotlight...........................................................................216
Shadows.......................................................................................................221
What Is a Shadow? ............................................................................222
Squish Code .......................................................................................223
A Shadow Example ............................................................................223
Sphere World Revisited......................................................................227
Summary .....................................................................................................227
6 More on Colors and Materials...................................229
Blending ......................................................................................................229
Combining Colors .............................................................................230
Changing the Blending Equation .....................................................234
Antialiasing ........................................................................................234
Multisample .......................................................................................238
Applying Fog...............................................................................................240
Fog Equations ....................................................................................242
Fog Coordinates.................................................................................244
Accumulation Buffer...................................................................................244
Other Color Operations..............................................................................248
Color Masking ...................................................................................248
Color Logical Operations...................................................................248
Alpha Testing .....................................................................................249
Dithering............................................................................................250
Summary .....................................................................................................250
7 Imaging with OpenGL ........................................251
Bitmaps........................................................................................................252
Bitmapped Data .................................................................................253
The Raster Position ............................................................................256
Pixel Packing ...............................................................................................257
Pixmaps.......................................................................................................258
Packed Pixel Formats .........................................................................260
A More Colorful Example..................................................................261
Moving Pixels Around.......................................................................265
Saving Pixels ......................................................................................266
More Fun with Pixels..................................................................................268
Pixel Zoom.........................................................................................275
Pixel Transfer .....................................................................................277
Pixel Mapping....................................................................................281
The Imaging “Subset” and Pipeline............................................................283
Color Matrix ......................................................................................288
Color Lookup.....................................................................................289
Proxies................................................................................................290
Other Operations...............................................................................291
Convolutions .....................................................................................292
Histogram ..........................................................................................297
Minmax Operations...........................................................................301
Summary .....................................................................................................301
8 Texture Mapping: The Basics ...............................303
Loading Textures.........................................................................................304
Using the Color Buffer ......................................................................307
Updating Textures..............................................................................307
Mapping Textures to Geometry ........................................................308
Texture Matrix ...................................................................................311
A Simple 2D Example .................................................................................311
Texture Environment..................................................................................316
Texture Parameters......................................................................................318
Basic Filtering.....................................................................................318
Texture Wrap .....................................................................................320
Cartoons with Texture.......................................................................321
Mipmapping ......................................................................................325
Texture Objects ...........................................................................................330
Managing Multiple Textures .............................................................331
Summary .....................................................................................................339
9 Texture Mapping: Beyond the Basics........................341
Secondary Color..........................................................................................341
Anisotropic Filtering ...................................................................................344
Texture Compression ..................................................................................347
Compressing Textures........................................................................348
Loading Compressed Textures...........................................................349
Texture Coordinate Generation..................................................................350
Object Linear Mapping......................................................................354
Eye Linear Mapping...........................................................................355
Sphere Mapping.................................................................................356
Cube Mapping ...................................................................................357
Multitexture ................................................................................................362
Multiple Texture Coordinates ...........................................................363
A Multitextured Example ..................................................................364
Texture Combiners......................................................................................369
Point Sprites ................................................................................................371
Using Points.......................................................................................372
Texture Application ...........................................................................374
Point Parameters................................................................................374
Summary .....................................................................................................375
10 Curves and Surfaces.........................................377
Built-in Surfaces ..........................................................................................378
Setting Quadric States........................................................................379
Drawing Quadrics ..............................................................................381
Modeling with Quadrics....................................................................385
Bézier Curves and Surfaces .........................................................................388
Parametric Representation.................................................................388
Evaluators...........................................................................................391
NURBS .........................................................................................................401
From Bézier to B-Splines....................................................................402
Knots ..................................................................................................402
Creating a NURBS Surface .................................................................403
NURBS Properties...............................................................................404
Defining the Surface ..........................................................................404
Trimming ...........................................................................................406
NURBS Curves....................................................................................409
Tessellation..................................................................................................409
The Tessellator ...................................................................................411
Tessellator Callbacks ..........................................................................412
Specifying Vertex Data ......................................................................413
Putting It All Together.......................................................................414
Summary .....................................................................................................419
11 It’s All About the Pipeline: Faster Geometry Throughput.........................421
Display Lists ................................................................................................422
Batch Processing ................................................................................423
Preprocessed Batches .........................................................................424
Display List Caveats...........................................................................426
Converting to Display Lists...............................................................426
Vertex Arrays ...............................................................................................428
Loading the Geometry ......................................................................432
Enabling Arrays..................................................................................432
Where’s the Data?..............................................................................433
Pull the Data and Draw .....................................................................434
Indexed Vertex Arrays .......................................................................435
Vertex Buffer Objects ..................................................................................450
Managing and Using Buffer Objects .................................................450
Back to the Thunderbird! ..................................................................452
Summary .....................................................................................................455
12 Interactive Graphics........................................457
Selection ......................................................................................................458
Naming Your Primitives ....................................................................458
Working with Selection Mode...........................................................460
The Selection Buffer...........................................................................461
Picking ...............................................................................................464
Hierarchical Picking...........................................................................466
Feedback.............................................................................................471
The Feedback Buffer ..........................................................................471
Feedback Data....................................................................................472
Passthrough Markers .........................................................................473
A Feedback Example ...................................................................................473
Label the Objects for Feedback..........................................................473
Step 1: Select the Object....................................................................476
Step 2: Get Feedback on the Object ..................................................478
Summary .....................................................................................................480
13 Occlusion Queries: Why Do More Work Than You Need To? ...................481
The World Before Occlusion Queries .........................................................482
Bounding Boxes ..........................................................................................485
Querying the Query Object ........................................................................490
Best Practices ...............................................................................................492
Summary .....................................................................................................493
14 Depth Textures and Shadows................................495
Be That Light...............................................................................................496
Fit the Scene to the Window.............................................................496
No Bells or Whistles, Please...............................................................497
A New Kind of Texture ...............................................................................498
Size Matters........................................................................................499
Draw the Shadows First?!............................................................................500
And Then There Was Light.........................................................................501
Projecting Your Shadow Map: The “Why” .......................................501
Projecting Your Shadow Map: The “How”........................................503
The Shadow Comparison ..................................................................505
Two Out of Three Ain’t Bad........................................................................509
A Few Words About Polygon Offset ...........................................................510
Summary .....................................................................................................511
Part II The New Testament........................513
15 Programmable Pipeline: This Isn’t Your Father’s OpenGL ........................515
Out with the Old ........................................................................................516
Fixed Vertex Processing .....................................................................518
Fixed Fragment Processing ................................................................520
In with the New..........................................................................................521
Programmable Vertex Shaders...........................................................523
Fixed Functionality Glue ...................................................................524
Programmable Fragment Shaders......................................................525
OpenGL Shading Language: A First Glimpse .............................................526
Managing GLSL Shaders .............................................................................528
Shader Objects ...................................................................................528
Program Objects ................................................................................530
Variables ......................................................................................................532
Basic Types .........................................................................................532
Structures ...........................................................................................534
Arrays .................................................................................................534
Qualifiers............................................................................................535
Built-In Variables ...............................................................................536
Expressions..................................................................................................537
Operators ...........................................................................................537
Array Access .......................................................................................538
Constructors ......................................................................................538
Component Selectors ........................................................................540
Control Flow ...............................................................................................541
Loops..................................................................................................541
if/else..................................................................................................542
discard................................................................................................542
Functions ...........................................................................................542
Summary .....................................................................................................545
16 Vertex Shading: Do-It-Yourself Transform, Lighting, and Texgen ............547
Getting Your Feet Wet.................................................................................548
Diffuse Lighting ..........................................................................................549
Specular Lighting ........................................................................................551
Improved Specular Lighting .......................................................................553
Per-Vertex Fog .............................................................................................557
Per-Vertex Point Size ...................................................................................560
Customized Vertex Transformation............................................................561
Vertex Blending...........................................................................................563
Summary .....................................................................................................566
17 Fragment Shading: Empower Your Pixel Processing...............567
Color Conversion........................................................................................568
Grayscale............................................................................................568
Sepia Tone..........................................................................................569
Inversion ............................................................................................570
Heat Signature ...................................................................................571
Per-Fragment Fog...............................................................................572
Image Processing.........................................................................................574
Blur.....................................................................................................575
Sharpen ..............................................................................................577
Dilation and Erosion .........................................................................578
Edge Detection...................................................................................580
Lighting.......................................................................................................582
Diffuse Lighting .................................................................................582
Multiple Specular Lights....................................................................585
Procedural Texture Mapping.......................................................................587
Checkerboard Texture........................................................................588
Beach Ball Texture .............................................................................592
Toy Ball Texture .................................................................................595
Summary .....................................................................................................600
18 Advanced Buffers .........................601
Pixel Buffer Objects.....................................................................................601
How to Use PBOs...............................................................................602
The Benefits of PBOs .........................................................................603
PBOs in Action...................................................................................604
Oh, Where Is the Home Where the PBOs Roam? ............................608
Framebuffer Objects....................................................................................608
How to Use FBOs ...............................................................................609
Offscreen Rendering ..........................................................................613
Rendering to Textures........................................................................615
Multiple Render Targets.....................................................................619
Floating-Point Textures...............................................................................622
High Dynamic Range ........................................................................622
OpenEXR File Format ........................................................................623
Tone Mapping....................................................................................626
Making Your Whites Whiter and Your Brights Brighter ............................630
Drawing the Scene.............................................................................630
Bright Pass..........................................................................................633
Gaussian Blur with a Little Help .......................................................634
The Sum Is Greater Than Its Parts.....................................................636
PBOs Make a Comeback ....................................................................638
Summary .....................................................................................................638
Part III The Apocrypha.....................639
19 Wiggle: OpenGL on Windows .................641
OpenGL Implementations on Windows ....................................................642
Generic OpenGL................................................................................642
Installable Client Driver ....................................................................642
Mini-Client Driver .............................................................................643
Mini-Driver ........................................................................................643
OpenGL on Vista ...............................................................................644
Extended OpenGL .............................................................................644
Basic Windows Rendering ..........................................................................645
GDI Device Contexts.........................................................................646
Pixel Formats .....................................................................................647
The OpenGL Rendering Context ......................................................654
Putting It All Together ................................................................................655
Creating the Window ........................................................................655
Using the OpenGL Rendering Context.............................................660
Other Windows Messages..................................................................664
OpenGL and Windows Fonts .....................................................................666
3D Fonts and Text .............................................................................666
2D Fonts and Text .............................................................................669
Full-Screen Rendering .................................................................................671
Creating a Frameless Window...........................................................672
Creating a Full-Screen Window.........................................................672
Multithreaded Rendering............................................................................675
OpenGL and WGL Extensions ...................................................................676
Simple Extensions..............................................................................677
Using New Entrypoints .....................................................................678
Auto-Magic Extensions......................................................................679
WGL Extensions ................................................................................680
Summary .....................................................................................................684
20 OpenGL on Mac OS X.............................685
GLUT...........................................................................................................686
Setting Up a GLUT Project ................................................................686
Application Frameworks....................................................................687
Ditching Cocoa..................................................................................688
OpenGL with Carbon .................................................................................689
Setting Up for OpenGL......................................................................689
Bitmap Fonts......................................................................................697
OpenGL with Cocoa ...................................................................................699
Creating a Cocoa Program ................................................................699
Wiring It All Together........................................................................703
Hang on a Second There! ..................................................................705
Full-Screen Rendering .................................................................................706
Managing the Display .......................................................................706
AGL Full-Screen Support ...................................................................708
Summary .....................................................................................................711
21 OpenGL on Linux..........................713
The Basics....................................................................................................713
Setup............................................................................................................714
Setting Up Mesa.................................................................................715
Setting Up Hardware Drivers.............................................................715
More Setup Details.............................................................................715
Setting Up GLUT ...............................................................................716
Building OpenGL Apps......................................................................716
GLUT...........................................................................................................717
GLX—Dealing with the X Windows Interface...........................................718
Displays and X...................................................................................718
Config Management and Visuals ......................................................719
Windows and Render Surfaces ..........................................................723
Context Management........................................................................724
Synchronization ................................................................................726
GLX Strings........................................................................................727
The Rest of GLX.................................................................................727
Putting It All Together ................................................................................729
Summary .....................................................................................................734
22 OpenGL ES: OpenGL on the Small....................735
OpenGL on a Diet.......................................................................................735
What’s the ES For? .............................................................................735
A Brief History ...................................................................................736
Which Version Is Right for You? ................................................................738
ES 1.0..................................................................................................739
ES 1.1..................................................................................................742
ES 2.0..................................................................................................746
ES SC ..................................................................................................752
The ES Environment...................................................................................754
Application Design Considerations...................................................754
Dealing with a Limited Environment ...............................................755
Fixed-Point Math ...............................................................................756
EGL: A New Windowing Environment ......................................................757
EGL Displays......................................................................................758
Creating a Window............................................................................759
Context Management........................................................................763
Presenting Buffers and Rendering Synchronization .........................764
More EGL Stuff ..................................................................................765
Negotiating Embedded Environments .......................................................766
Popular Operating Systems................................................................766
Embedded Hardware..........................................................................766
Vendor-Specific Extensions ...............................................................767
For the Home Gamer.........................................................................767
Putting OpenGL ES into Action .................................................................767
Setting Up the Environment .............................................................768
Setting Up OpenGL ES State..............................................................769
Rendering ..........................................................................................770
Cleaning Up.......................................................................................771
Summary .....................................................................................................772
A Further Reading/References.......................................................................773
Other Good OpenGL Books........................................................................773
3D Graphics Books......................................................................................773
Web Sites .....................................................................................................774
B Glossary.......................................................................................................777
C API Reference..............................................................................................783
Overview of Appendix C ............................................................................783
Index..........................................................................................................1141
●▬▬▬▬▬❂❂❂▬▬▬▬▬●
●▬▬❂❂▬▬●
●▬❂▬●
●❂●