advertisement
▼
Scroll to page 2
of 621
Bull AIX 5L OpenGL 2.1 Reference Manual AIX ORDER REFERENCE 86 A2 71EF 00 Bull AIX 5L OpenGL 2.1 Reference Manual AIX Software April 2001 BULL CEDOC 357 AVENUE PATTON B.P.20845 49008 ANGERS CEDEX 01 FRANCE ORDER REFERENCE 86 A2 71EF 00 The following copyright notice protects this book under the Copyright laws of the United States of America and other countries which prohibit such actions as, but not limited to, copying, distributing, modifying, and making derivative works. Copyright Bull S.A. 1992, 2001 Printed in France Suggestions and criticisms concerning the form, content, and presentation of this book are invited. A form is provided at the end of this book for this purpose. To order additional copies of this book or other Bull Technical Publications, you are invited to use the Ordering Form also provided at the end of this book. Trademarks and Acknowledgements We acknowledge the right of proprietors of trademarks mentioned in this book. AIXR is a registered trademark of International Business Machines Corporation, and is being used under licence. UNIX is a registered trademark in the United States of America and other countries licensed exclusively through the Open Group. The information in this document is subject to change without notice. Groupe Bull will not be liable for errors contained herein, or for incidental or consequential damages in connection with the use of this material. Contents About This Book . . . . Who Should Use This Book Highlighting . . . . . . ISO 9000 . . . . . . . Related Publications . . . Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Chapter 1. OpenGL Subroutines. . . glAccum Subroutine . . . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glActiveTextureARB Subroutine . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glAlphaFunc Subroutine . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Files . . . . . . . . . . . . Related Information. . . . . . . glAreTexturesResident Subroutine . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Related Information . . . . . . . glAreTexturesResidentEXT Subroutine . Purpose . . . . . . . . . . . Library . . . . . . . . . . . © Copyright IBM Corp. 1994, 2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . lvii lvii lvii lvii lvii lviii . 1 . 6 . 6 . 6 . 6 . 6 . 7 . 7 . 7 . 7 . 7 . 7 . 8 . 8 . 8 . 8 . 8 . 8 . 8 . 8 . 8 . 9 . 9 . 9 . 9 . 9 . 9 . 9 . 10 . 10 . 10 . 10 . 10 . 10 . 10 . 10 . 10 . 10 . 11 . 11 . 11 . 11 . 11 . 11 . 11 . 11 iii C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . Related Information. . . . glArrayElement Subroutine . . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Related Information. . . . glArrayElementEXT Subroutine Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . File. . . . . . . . . . Related Information. . . . glBegin or glEnd Subroutine . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Errors . . . . . . . . . Files . . . . . . . . . Related Information. . . . glBindTexture Subroutine. . . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Related Information. . . . glBindTextureEXT Subroutine . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . Related Information. . . . glBitmap Subroutine . . . . Purpose . . . . . . . . iv OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 16 17 17 17 17 18 18 18 18 18 18 19 19 19 19 19 19 19 19 Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . Related Information. . . . glBlendColor Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Related Information. . . . glBlendColorEXT Subroutine . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Related Information. . . . glBlendEquation Subroutine. . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Related Information. . . . glBlendEquationEXT Subroutine Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Related Information. . . . glBlendFunc Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 20 20 20 21 21 21 21 21 21 21 21 21 22 22 22 22 22 22 22 22 22 22 22 22 22 23 23 23 23 23 23 23 23 23 23 24 24 24 24 24 24 24 24 24 25 25 25 25 25 25 25 25 27 27 28 Contents v Associated Gets . . . Examples . . . . . Files . . . . . . . Related Information. . glBlendFuncSeparateEXT Purpose . . . . . . Library . . . . . . C Syntax . . . . . Description . . . . . Parameters. . . . . Notes . . . . . . . Error Codes . . . . Files . . . . . . . Related Information. . glCallList Subroutine . . Purpose . . . . . . Library . . . . . . C Syntax . . . . . Description . . . . . Parameters. . . . . Notes . . . . . . . Associated Gets . . . Files . . . . . . . Related Information. . glCallLists Subroutine . . Purpose . . . . . . Library . . . . . . C Syntax . . . . . Description . . . . . Parameters. . . . . Notes . . . . . . . Associated Gets . . . Files . . . . . . . Related Information. . glClear Subroutine . . . Purpose . . . . . . Library . . . . . . C Syntax . . . . . Description . . . . . Parameters. . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . Related Information. . glClearAccum Subroutine Purpose . . . . . . Library . . . . . . C Syntax . . . . . Description . . . . . Parameters. . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . Related Information. . glClearColor Subroutine . vi . . . . . . . . . . . . . . . . Subroutine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 28 28 28 28 28 28 29 29 30 30 30 30 30 30 30 30 30 30 31 31 31 31 31 31 31 31 31 32 32 33 33 33 33 33 33 33 33 33 34 34 34 34 34 34 34 34 34 35 35 35 35 35 35 35 35 Purpose . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . Parameters. . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information. . . . . . . . . . . . . glClearDepth Subroutine . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . Parameters. . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information. . . . . . . . . . . . . glClearIndex Subroutine . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . Parameters. . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information. . . . . . . . . . . . . glClearStencil Subroutine . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . Parameters. . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information. . . . . . . . . . . . . glClientActiveTextureARB Subroutine . . . . . . . Purpose . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . Parameters. . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . . Error Codes . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information. . . . . . . . . . . . . glClipBoundingBoxIBM or glClipBoundingSphereIBM or Purpose . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . Parameters. . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . glClipBoundingVerticesIBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Subroutine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 35 36 36 36 36 36 36 36 36 36 36 36 37 37 37 37 37 37 37 37 37 37 37 37 38 38 38 38 38 38 38 38 38 38 38 38 39 39 39 39 39 39 39 39 39 40 40 40 40 40 40 40 40 41 41 vii Error Codes . . . . . . . . Files . . . . . . . . . . . glClipPlane Subroutine . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters. . . . . . . . . Description . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . Related Information. . . . . . glColor Subroutine . . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . . Parameters. . . . . . . . . Notes . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . Related Information. . . . . . glColorMask Subroutine . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . . Parameters. . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . Related Information. . . . . . glColorMaterial Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . . Parameters. . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . Related Information. . . . . . glColorNormalVertexSUN Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . . Parameters. . . . . . . . . Notes . . . . . . . . . . . Files . . . . . . . . . . . Related Information. . . . . . glColorPointer Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . viii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 41 42 42 42 42 42 42 42 42 42 43 43 43 43 43 43 45 45 46 46 46 46 46 46 46 46 46 47 47 47 47 47 47 47 47 47 47 48 48 48 48 48 48 48 48 49 49 49 49 49 50 50 50 50 50 C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . . Related Information. . . . . glColorPointerEXT Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . File. . . . . . . . . . . Related Information. . . . . glColorPointerListIBM Subroutine. Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . . Related Information. . . . . glColorSubTable Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . Related Information. . . . . glColorTable Subroutine . . . . Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . Related Information. . . . . glColorTableParameter Subroutine Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 50 50 51 51 51 51 52 52 52 52 52 52 53 53 53 53 53 54 54 54 54 54 54 55 55 55 55 56 56 56 56 56 56 56 57 57 57 57 57 57 57 57 58 59 60 60 60 61 61 61 61 61 61 61 61 ix Notes . . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . Related Information. . . . . glColorVertexSUN Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Files . . . . . . . . . . Related Information. . . . . glCopyColorSubTable Subroutine. Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . Related Information. . . . . glCopyColorTable Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . Related Information. . . . . glCopyPixels Subroutine . . . . Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Examples . . . . . . . . Files . . . . . . . . . . Related Information. . . . . glCopyTexImage1D Subroutine . Purpose . . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . . Parameters. . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . x OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 62 62 62 62 62 62 62 62 63 63 63 63 64 64 64 64 64 64 64 64 64 65 65 65 65 65 65 65 65 66 66 67 67 67 67 67 67 67 67 67 69 69 69 70 70 70 70 70 70 70 70 70 71 71 71 Associated Gets . . . . . . . . Related Information. . . . . . . glCopyTexImage2D Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . . Parameters. . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Related Information. . . . . . . glCopyTexSubImage1D Subroutine . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . . Parameters. . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Related Information. . . . . . . glCopyTexSubImage2D Subroutine . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . . Parameters. . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Related Information. . . . . . . glCopyTexSubImage3D Subroutine . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . . Parameters. . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Related Information. . . . . . . glCopyTexSubImage3DEXT Subroutine Purpose . . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . . Parameters. . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Related Information. . . . . . . glCullFace Subroutine . . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 72 72 72 72 72 72 73 73 73 74 74 74 74 74 74 74 74 75 75 75 75 75 75 75 75 76 76 76 76 77 77 77 77 77 77 77 78 78 78 79 79 79 79 79 79 79 80 80 80 80 80 81 81 81 81 xi Parameters. . . . . . . Description . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . Related Information. . . . glDeleteLists Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Errors . . . . . . . . . Files . . . . . . . . . Related Information. . . . glDeleteTextures Subroutine . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Parameters. . . . . . . Description . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Related Information. . . . glDeleteTexturesEXT Subroutine Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . File. . . . . . . . . . Related Information. . . . glDepthFunc Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . Related Information. . . . glDepthMask Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . Parameters. . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . xii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 81 81 81 81 81 81 82 82 82 82 82 82 82 82 82 82 82 82 83 83 83 83 83 83 83 83 83 83 83 84 84 84 84 84 84 84 84 84 84 84 85 85 85 85 85 85 86 86 86 86 86 86 86 86 86 Related Information. . . glDepthRange Subroutine . Purpose . . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . . Parameters. . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Files . . . . . . . . Related Information. . . glDrawArrays Subroutine. . Purpose . . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . . Parameters. . . . . . Notes . . . . . . . . Errors . . . . . . . . Related Information. . . glDrawArraysEXT Subroutine Purpose . . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . . Parameters. . . . . . Notes . . . . . . . . Errors . . . . . . . . File. . . . . . . . . Related Information. . . glDrawBuffer Subroutine . . Purpose . . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . . Parameters. . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Files . . . . . . . . Related Information. . . glDrawElements Subroutine. Purpose . . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . . Notes . . . . . . . . Parameters. . . . . . Errors . . . . . . . . Related Information. . . glDrawPixels Subroutine . . Purpose . . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 86 86 86 87 87 87 87 87 87 87 87 87 87 87 88 88 88 88 88 88 89 89 89 89 89 89 89 90 90 90 90 90 90 90 90 91 91 91 91 91 91 92 92 92 92 92 92 92 92 93 93 93 93 93 93 xiii Parameters. . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glDrawRangeElements Subroutine . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Related Information . . . . . . glEdgeFlag Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glEdgeFlagPointer Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Associated Gets . . . . . . . Related Information . . . . . . glEdgeFlagPointerEXT Subroutine . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . File . . . . . . . . . . . . Related Information . . . . . . glEdgeFlagPointerListIBM Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Associated Gets . . . . . . . Related Information . . . . . . xiv OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 . . . . 99 . . . . 99 . . . . 100 . . . . 100 . . . . 100 . . . . 100 . . . . 100 . . . . 100 . . . . 100 . . . . 100 . . . . 101 . . . . 101 . . . . 101 . . . . 101 . . . . 101 . . . . 101 . . . . 101 . . . . 102 . . . . 102 . . . . 102 . . . . 102 . . . . 102 . . . . 102 . . . . 102 . . . . 102 . . . . 102 . . . . 103 . . . . 103 . . . . 103 . . . . 103 . . . . 103 . . . . 103 . . . . 104 . . . . 104 . . . . 104 . . . . 104 . . . . 104 . . . . 104 . . . . 104 . . . . 105 . . . . 105 . . . . 105 . . . . 105 . . . . 105 . . . . 105 . . . . 106 . . . . 106 . . . . 106 . . . . 106 . . . . 106 . . . . 106 . . . . 106 . . . . 107 . . . . 107 . . . . 107 glEnable or glDisable Subroutine . . . . . . . . Purpose . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . glEnableClientState or glDisableClientState Subroutine Purpose . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . glEvalCoord Subroutine . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . glEvalMesh Subroutine . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . glEvalPoint Subroutine . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . glFeedbackBuffer Subroutine . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents 107 107 107 107 107 111 111 112 112 112 112 112 112 112 112 112 112 113 113 113 113 113 113 114 114 115 115 115 115 115 116 116 117 117 117 117 118 118 118 118 118 118 118 118 119 119 119 119 119 119 119 121 121 121 121 121 xv Related Information . . . . . . glFinish Subroutine . . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glFlush Subroutine . . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glFog Subroutine . . . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glFogCoordEXT Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glFogCoordPointerEXT Subroutine. . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glFogCoordPointerListIBM Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . xvi OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 121 121 121 122 122 122 122 122 122 122 122 122 122 122 122 123 123 123 123 123 123 123 123 125 125 125 126 126 126 126 126 126 126 126 126 127 127 127 127 127 127 127 128 128 128 128 128 128 128 129 129 129 129 130 130 glFrontFace Subroutine . . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Errors . . . . . . . . Associated Gets . . . . Files . . . . . . . . . Related Information . . . glFrustum Subroutine . . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Files . . . . . . . . . Related Information . . . glGenLists Subroutine . . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Errors . . . . . . . . Associated Gets . . . . Files . . . . . . . . . Related Information . . . glGenTextures Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Parameters . . . . . . Description . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Related Information . . . glGenTexturesEXT Subroutine Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . File . . . . . . . . . Related Information . . . glGet Subroutine . . . . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 130 130 130 130 130 130 131 131 131 131 131 131 131 131 132 132 132 133 133 133 133 133 133 133 133 133 133 134 134 134 134 134 134 134 134 134 135 135 135 135 135 135 135 135 135 135 136 136 136 136 136 136 136 136 136 xvii Description . . . . . . . . . Parameters . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glGetClipPlane Subroutine. . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glGetColorTable Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glGetColorTableParameter Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glGetError Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Errors . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glGetLight Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glGetMap Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . xviii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 158 158 158 158 158 158 158 158 158 158 159 159 159 159 159 159 159 159 159 160 160 160 161 161 161 161 161 161 161 162 162 162 162 162 163 163 163 163 163 164 164 164 164 164 164 164 164 165 166 166 166 166 166 166 166 C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Files . . . . . . . . . . Related Information . . . . glGetMaterial Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Files . . . . . . . . . . Related Information . . . . glGetPixelMap Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . . Related Information . . . . glGetPointerv Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Error Codes . . . . . . . Related Information . . . . glGetPointervEXT Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . File . . . . . . . . . . Related Information . . . . glGetPolygonStipple Subroutine. Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 166 167 167 167 167 167 167 167 168 168 168 168 169 169 169 169 169 169 169 169 169 170 170 170 170 170 170 171 171 171 171 171 171 172 172 172 172 172 172 172 172 173 173 173 173 173 173 173 173 173 174 174 174 174 174 xix Related Information . . . . . glGetString Subroutine . . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glGetTexEnv Subroutine . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glGetTexGen Subroutine . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glGetTexImage Subroutine. . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Parameters . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . . Related Information . . . . . glGetTexLevelParameter Subroutine Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glGetTexParameter Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . xx OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 174 174 174 174 174 175 175 175 175 175 175 175 175 176 176 176 177 177 177 177 177 177 177 178 178 178 178 178 178 179 179 179 179 179 179 179 180 180 180 180 180 181 181 181 181 181 182 182 182 183 183 183 183 183 183 Description . . . . . . Parameters . . . . . . Notes . . . . . . . . Errors . . . . . . . . Files . . . . . . . . . Related Information . . . glHint Subroutine . . . . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Notes . . . . . . . . Errors . . . . . . . . Files . . . . . . . . . Related Information . . . glIndex Subroutine . . . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Notes . . . . . . . . Associated Gets . . . . Files . . . . . . . . . Related Information . . . glIndexMask Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Errors . . . . . . . . Associated Gets . . . . Files . . . . . . . . . Related Information . . . glIndexPointer Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Related Information . . . glIndexPointerEXT Subroutine Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 184 184 184 184 184 185 185 185 185 185 186 186 186 186 187 187 187 187 187 187 187 187 188 188 188 188 188 188 188 188 188 188 188 189 189 189 189 189 189 189 189 190 190 190 190 190 190 190 191 191 191 191 192 192 192 xxi Related Information . . . . glIndexPointerListIBM Subroutine Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Error Codes . . . . . . . Associated Gets . . . . . Related Information . . . . glInitNames Subroutine . . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Errors . . . . . . . . . Associated Gets . . . . . Files . . . . . . . . . . Related Information . . . . glInterleavedArrays Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Related Information . . . . glIsEnabled Subroutine . . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . Files . . . . . . . . . . Related Information . . . . glIsList Subroutine. . . . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Errors . . . . . . . . . Files . . . . . . . . . . Related Information . . . . glIsTexture Subroutine . . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Errors . . . . . . . . . xxii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 192 192 192 192 192 193 193 194 194 194 194 194 194 194 194 194 194 195 195 195 195 195 195 195 195 196 196 196 196 196 196 196 196 198 198 198 198 198 198 198 198 198 198 198 198 199 199 199 199 199 199 199 199 199 199 Related Information . . glIsTextureEXT Subroutine Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Notes . . . . . . . Errors . . . . . . . File . . . . . . . . Related Information . . glLight Subroutine . . . . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glLightModel Subroutine . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glLineStipple Subroutine . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glLineWidth Subroutine . . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glListBase Subroutine . . Purpose . . . . . . Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 199 199 200 200 200 200 200 200 200 200 200 200 200 200 201 203 203 203 203 203 203 203 203 204 204 204 205 205 205 206 206 206 206 206 206 206 207 207 207 207 207 207 207 207 207 207 208 208 208 208 208 209 209 209 209 xxiii C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glLoadIdentity Subroutine . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glLoadMatrix Subroutine . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glLoadName Subroutine . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glLoadNamedMatrixIBM Subroutine . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Error Codes . . . . . . . . . . Files . . . . . . . . . . . . . glLoadTransposeMatrixARB Subroutine . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Error Codes . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glLockArraysEXT Subroutine . . . . . Purpose . . . . . . . . . . . xxiv OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 209 209 209 209 209 209 209 209 210 210 210 210 210 210 210 211 211 211 211 211 211 211 211 212 212 212 212 212 212 212 212 212 212 213 213 213 213 213 213 213 213 214 214 214 214 214 214 214 214 214 214 215 215 215 215 Library . . . . . C Syntax . . . . Description . . . Parameters . . . Errors . . . . . Related Information glLogicOp Subroutine Purpose . . . . Library . . . . . C Syntax . . . . Description . . . Parameters . . . Notes . . . . . Errors . . . . . Associated Gets . Files . . . . . . Related Information glMap1 Subroutine . Purpose . . . . Library . . . . . C Syntax . . . . Description . . . Parameters . . . Notes . . . . . Errors . . . . . Associated Gets . Files . . . . . . Related Information glMap2 Subroutine . Purpose . . . . Library . . . . . C Syntax . . . . Description . . . Parameters . . . Notes . . . . . Errors . . . . . Associated Gets . Files . . . . . . Related Information glMapGrid Subroutine Purpose . . . . Library . . . . . C Syntax . . . . Description . . . Parameters . . . Errors . . . . . Associated Gets . Files . . . . . . Related Information glMaterial Subroutine. Purpose . . . . Library . . . . . C Syntax . . . . Description . . . Parameters . . . Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215 215 215 215 216 216 216 216 216 216 216 217 217 217 217 217 218 218 218 218 218 218 220 220 221 221 221 221 221 221 221 222 222 225 225 225 225 226 226 226 226 226 226 227 227 227 227 228 228 228 228 228 228 228 229 230 xxv Errors . . . . . . . . . . . . . Associated Gets . . . . . . . . . Files . . . . . . . . . . . . . . Related Information . . . . . . . . glMatrixMode Subroutine . . . . . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Associated Gets . . . . . . . . . Errors . . . . . . . . . . . . . Files . . . . . . . . . . . . . . Related Information . . . . . . . . glMultiDrawArraysEXT Subroutine . . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Notes . . . . . . . . . . . . . Errors . . . . . . . . . . . . . Related Information . . . . . . . . glMultiDrawElementsEXT Subroutine . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Notes . . . . . . . . . . . . . Errors . . . . . . . . . . . . . Associated Gets . . . . . . . . . Related Information . . . . . . . . glMultiModeDrawArraysIBM Subroutine . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Notes . . . . . . . . . . . . . Error Codes . . . . . . . . . . . Related Information . . . . . . . . glMultiModeDrawElementsIBM Subroutine . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Notes . . . . . . . . . . . . . Errors . . . . . . . . . . . . . Related Information . . . . . . . . glMultiTexCoordARB Subroutine . . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . xxvi OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 230 230 230 230 230 230 230 231 231 231 231 231 231 231 231 231 231 232 232 232 232 232 233 233 233 233 233 233 233 234 234 234 234 234 234 234 234 234 235 235 235 235 235 235 235 235 236 236 236 236 236 236 236 237 238 Parameters . . . . . . . . . Notes . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glMultMatrix Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glMultTransposeMatrixARB Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glNewList or glEndList Subroutine . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Associated Gets . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glNormal Subroutine . . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Associated Gets . . . . . . . Related Information . . . . . . glNormalPointer Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Related Information . . . . . . glNormalPointerEXT Subroutine. . . Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 239 239 239 239 239 239 239 239 239 240 240 240 240 240 240 240 241 241 241 241 241 241 241 241 241 241 242 242 242 242 242 243 243 243 243 243 243 243 244 244 244 244 244 244 244 244 245 245 245 245 246 246 246 246 246 xxvii Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . File . . . . . . . . . . . Related Information . . . . . glNormalPointerListIBM Subroutine Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glNormalVertexSUN Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glOrtho Subroutine . . . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . . Related Information . . . . . glPassThrough Subroutine. . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . . Related Information . . . . . glPixelMap Subroutine . . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Errors . . . . . . . . . . xxviii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 246 246 247 247 247 247 248 248 248 248 248 248 248 249 249 249 249 249 250 250 250 250 250 250 250 251 251 251 251 251 251 251 252 252 252 252 252 253 253 253 253 253 253 253 253 253 253 253 254 254 254 254 254 255 255 Associated Gets . . . Files . . . . . . . . Related Information . . glPixelStore Subroutine . . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glPixelTransfer Subroutine . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glPixelZoom Subroutine. . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Parameters . . . . . Description . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glPointSize Subroutine . . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Notes . . . . . . . Parameters . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glPolygonMode Subroutine Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Description . . . . . Parameters . . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 256 256 256 256 256 257 257 261 261 261 261 262 262 262 262 262 262 262 265 265 265 265 266 266 266 266 266 266 266 266 267 267 267 267 267 267 267 267 267 268 268 268 268 269 269 269 269 269 269 269 269 269 270 270 270 xxix Files . . . . . . . . . . . . Related Information . . . . . . glPolygonOffset Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Related Information . . . . . . glPolygonOffsetEXT Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . File . . . . . . . . . . . . Related Information . . . . . . glPolygonStipple Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Associated Gets . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glPrioritizeTextures Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Parameters . . . . . . . . . Description . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . Related Information . . . . . . glPrioritizeTexturesEXT Subroutine . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Parameters . . . . . . . . . Description . . . . . . . . . Notes . . . . . . . . . . . Errors . . . . . . . . . . . Associated Gets . . . . . . . File . . . . . . . . . . . . Related Information . . . . . . glPushAttrib or glPopAttrib Subroutine Purpose . . . . . . . . . . xxx OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270 270 270 270 270 270 270 271 271 271 271 271 271 271 271 271 271 271 272 272 272 272 272 272 272 272 272 272 273 273 273 273 273 273 273 273 273 273 274 274 274 274 274 274 274 274 275 275 275 275 275 275 276 276 276 276 Library . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . Description . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . Files . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . glPushClientAttrib or glPopClientAttrib Subroutine Purpose . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . Description . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . Related Information . . . . . . . . . . glPushMatrix or glPopMatrix Subroutine . . . . Purpose . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . Description . . . . . . . . . . . . . Error Codes . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . Files . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . glPushName or glPopName Subroutine . . . . Purpose . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . Description . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . Error Codes . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . glRasterPos Subroutine. . . . . . . . . . Purpose . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . Description . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . . Files . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . glReadBuffer Subroutine . . . . . . . . . Purpose . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . Description . . . . . . . . . . . . . Error Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276 276 276 276 279 279 279 279 280 280 280 280 280 280 280 280 281 281 281 281 281 281 281 281 282 282 282 282 282 282 282 283 283 283 283 283 283 283 283 283 284 284 285 285 286 286 286 286 286 286 286 286 287 287 287 287 xxxi Associated Gets . . . Files . . . . . . . . Related Information . . glReadPixels Subroutine . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Parameters . . . . . Description . . . . . Notes . . . . . . . Error Codes . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . glRect Subroutine . . . . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Parameters . . . . . Description . . . . . Errors . . . . . . . Files . . . . . . . . Related Information . . glRenderMode Subroutine . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Parameters . . . . . Description . . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Return Values . . . . Files . . . . . . . . Related Information . . glRotate Subroutine . . . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Parameters . . . . . Description . . . . . Associated Gets . . . Errors . . . . . . . Files . . . . . . . . Related Information . . glScale Subroutine . . . Purpose . . . . . . Library . . . . . . . C Syntax . . . . . . Parameters . . . . . Description . . . . . Notes . . . . . . . Errors . . . . . . . Associated Gets . . . Files . . . . . . . . Related Information . . xxxii . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 287 287 288 288 288 288 288 288 293 293 293 294 294 294 294 294 294 295 295 295 295 295 295 295 295 295 295 296 296 296 297 297 297 297 297 297 297 297 297 297 298 298 298 298 298 298 298 298 299 299 299 299 299 300 300 glScissor Subroutine . . . . . . . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Parameters . . . . . . . . . . . Description . . . . . . . . . . . Errors . . . . . . . . . . . . . Associated Gets . . . . . . . . . Files . . . . . . . . . . . . . . Related Information . . . . . . . . glSecondaryColorEXT Subroutine . . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Files . . . . . . . . . . . . . . glSecondaryColorPointerEXT Subroutine . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Files . . . . . . . . . . . . . . Related Information . . . . . . . . glSecondaryColorPointerListIBM Subroutine Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . Notes . . . . . . . . . . . . . Error Codes . . . . . . . . . . . Files . . . . . . . . . . . . . . Related Information . . . . . . . . glSelectBuffer Subroutine . . . . . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Parameters . . . . . . . . . . . Description . . . . . . . . . . . Notes . . . . . . . . . . . . . Errors . . . . . . . . . . . . . Associated Gets . . . . . . . . . Files . . . . . . . . . . . . . . Related Information . . . . . . . . glShadeModel Subroutine . . . . . . . Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Parameters . . . . . . . . . . . Description . . . . . . . . . . . Errors . . . . . . . . . . . . . Associated Gets . . . . . . . . . Files . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 300 300 300 300 300 300 301 301 301 301 301 301 301 302 302 302 302 302 302 302 303 303 303 303 304 304 304 304 304 304 305 305 306 306 306 306 306 306 306 306 307 307 307 307 307 308 308 308 308 308 308 308 308 309 309 xxxiii glStencilFunc Subroutine . . . . . . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Parameters . . . . . . . . . . . . Description . . . . . . . . . . . . Notes . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . glStencilMask Subroutine . . . . . . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Parameters . . . . . . . . . . . . Description . . . . . . . . . . . . Errors . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . glStencilOp Subroutine . . . . . . . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Parameters . . . . . . . . . . . . Description . . . . . . . . . . . . Notes . . . . . . . . . . . . . . Errors . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . glTexCoord Subroutine . . . . . . . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Parameters . . . . . . . . . . . . Description . . . . . . . . . . . . Notes . . . . . . . . . . . . . . Associated Gets . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . glTexCoordColorNormalVertexSUN Subroutine Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . Parameters . . . . . . . . . . . . Notes . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . glTexCoordColorVertexSUN Subroutine . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . xxxiv OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 309 309 309 309 309 310 310 310 310 311 311 311 311 311 311 311 311 311 311 311 312 312 312 312 312 312 313 313 313 313 313 314 314 314 314 315 315 316 316 316 316 316 316 316 316 317 317 318 318 318 318 318 318 318 319 Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glTexCoordNormalVertexSUN Subroutine Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glTexCoordPointer Subroutine . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . Related Information . . . . . . . glTexCoordPointerEXT Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Parameters . . . . . . . . . . Description . . . . . . . . . . Notes . . . . . . . . . . . . Errors . . . . . . . . . . . . Associated Gets . . . . . . . . File . . . . . . . . . . . . . Related Information . . . . . . . glTexCoordPointerListIBM Subroutine . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Error Codes . . . . . . . . . . Associated Gets . . . . . . . . Related Information . . . . . . . glTexCoordVertexSUN Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Notes . . . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glTexEnv Subroutine . . . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 319 319 319 319 319 319 320 320 320 320 320 320 321 321 321 321 321 321 321 322 322 322 322 322 322 322 322 323 323 323 324 324 324 324 324 324 324 324 325 325 326 326 326 326 326 326 326 326 327 327 327 327 327 327 327 xxxv C Syntax . . . . . . . Parameters . . . . . . Description . . . . . . Notes . . . . . . . . Error Codes . . . . . . Associated Gets . . . . Files . . . . . . . . . Related Information . . . glTexGen Subroutine . . . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Parameters . . . . . . Description . . . . . . Error Codes . . . . . . Associated Gets . . . . Files . . . . . . . . . Related Information . . . glTexImage1D Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Parameters . . . . . . Description . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Related Information . . . glTexImage2D Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Parameters . . . . . . Description . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Related Information . . . glTexImage3D Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Parameters . . . . . . Description . . . . . . Notes . . . . . . . . Errors . . . . . . . . Associated Gets . . . . Related Information . . . glTexImage3DEXT Subroutine Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Parameters . . . . . . Description . . . . . . Notes . . . . . . . . Errors . . . . . . . . xxxvi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 328 329 332 332 332 333 333 333 333 333 333 333 334 336 336 336 336 336 336 336 336 337 337 341 341 342 342 342 342 342 342 343 343 347 347 348 348 348 348 348 348 348 349 353 353 353 353 354 354 354 354 354 355 357 358 Associated Gets . . . . . . Related Information . . . . . glTexParameter Subroutine . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glTexSubImage1D Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glTexSubImage1DEXT Subroutine . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . File . . . . . . . . . . . Related Information . . . . . glTexSubImage2D Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glTexSubImage2DEXT Subroutine . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . File . . . . . . . . . . . Related Information . . . . . glTexSubImage3D Subroutine . . Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358 358 359 359 359 359 359 360 362 362 362 362 362 362 362 363 363 363 367 367 368 368 368 368 368 368 368 369 369 369 370 370 370 370 370 370 370 370 371 375 375 376 376 376 376 376 376 377 377 377 377 378 378 378 378 378 xxxvii Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glTexSubImage3DEXT Subroutine . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glTranslate Subroutine . . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . . Related Information . . . . . glUnLockArraysEXT Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Errors . . . . . . . . . . Related Information . . . . . glVertex Subroutine . . . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glVertexPointer Subroutine . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glVertexPointerEXT Subroutine . . Purpose . . . . . . . . . xxxviii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378 378 379 379 383 383 384 384 384 384 384 384 384 385 385 385 386 386 386 386 386 386 386 386 387 387 387 387 387 387 388 388 388 388 388 388 388 388 388 389 390 390 390 390 390 390 390 390 390 391 391 391 391 391 392 392 Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Notes . . . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . File . . . . . . . . . . . Related Information . . . . . glVertexPointerListIBM Subroutine . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . . Associated Gets . . . . . . Related Information . . . . . glViewport Subroutine . . . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Parameters . . . . . . . . Description . . . . . . . . Errors . . . . . . . . . . Associated Gets . . . . . . Files . . . . . . . . . . . Related Information . . . . . glVisibilityBufferIBM Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glVisibilityThresholdIBM Subroutine Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 392 392 392 392 393 393 393 393 394 394 394 394 394 394 395 395 395 395 395 395 396 396 396 396 396 396 396 396 396 396 397 397 397 397 398 398 398 398 398 398 398 398 398 398 398 399 399 Chapter 2. OpenGL Utility (GLU) Library. gluBeginCurve or gluEndCurve Subroutine. Purpose . . . . . . . . . . . . Library . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . Description . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 402 402 402 402 403 403 Contents xxxix Examples . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . gluBeginPolygon or gluEndPolygon Subroutine Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . Parameters . . . . . . . . . . . . Notes . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . gluBeginSurface or gluEndSurface Subroutine Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . Parameters . . . . . . . . . . . . Examples . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . gluBeginTrim or gluEndTrim Subroutine . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . Parameters . . . . . . . . . . . . Examples . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . gluBuild1DMipmapLevels Subroutine . . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . Parameters . . . . . . . . . . . . Notes . . . . . . . . . . . . . . Error Codes . . . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . gluBuild1DMipmaps Subroutine . . . . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . Parameters . . . . . . . . . . . . NOTES. . . . . . . . . . . . . . ERRORS . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . Related Information . . . . . . . . . gluBuild2DMipmapLevels Subroutine . . . . Purpose . . . . . . . . . . . . . Library . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . Description . . . . . . . . . . . . xl OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 403 403 403 403 403 403 403 404 404 404 404 404 404 404 404 404 405 405 405 405 405 405 405 405 405 406 406 406 407 407 407 407 407 407 407 407 409 409 410 410 410 410 410 410 410 411 413 414 414 414 414 414 414 414 414 Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluBuild2DMipmaps Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluBuild3DMipmapLevels Subroutine . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluBuild3DMipmaps Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluCheckExtension Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluCylinder Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluDeleteNurbsRenderer Subroutine . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 417 417 418 418 418 418 418 418 418 419 421 421 422 422 422 422 422 422 422 423 425 425 426 426 426 426 426 426 426 427 429 429 430 430 430 430 430 430 431 431 431 431 431 431 431 431 431 431 432 432 432 432 432 432 432 Contents xli Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluDeleteQuadric Subroutine . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluDeleteTess Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluDisk Subroutine . . . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluErrorString Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . gluGetNurbsProperty Subroutine Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluGetString Subroutine . . . Purpose . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Error Codes . . . . . . . Related Information . . . . gluGetTessProperty . . . . . Purpose . . . . . . . . Library . . . . . . . . . xlii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 432 433 433 433 433 433 433 433 433 433 433 433 433 433 433 434 434 434 434 434 434 434 434 434 435 435 435 435 435 435 435 435 435 436 436 436 436 436 436 436 436 436 437 437 437 437 437 437 437 437 438 438 438 438 438 C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Related Information . . . . . . gluLoadSamplingMatrices Subroutine. Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluLookAt Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNewNurbsRenderer Subroutine . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNewQuadric Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNewTess Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNextContour Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Examples . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNurbsCallback Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 438 438 438 438 438 438 439 439 439 439 439 439 439 439 439 440 440 440 440 440 440 440 441 441 441 441 441 441 441 441 441 441 441 441 441 442 442 442 442 442 442 442 442 442 442 443 443 443 443 443 443 443 444 444 446 xliii Files . . . . . . . . . . . . Related Information . . . . . . gluNurbsCallbackData Subroutine . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNurbsCallbackDataEXT Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNurbsCurve Subroutine. . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Examples . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNurbsProperty Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluNurbsSurface Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Examples . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluOrtho2D Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . gluPartialDisk Subroutine . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . xliv OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446 446 446 446 447 447 447 447 447 447 447 447 447 447 447 447 448 448 448 448 448 448 448 448 449 449 449 449 449 449 449 449 452 452 452 453 453 453 453 453 453 453 454 454 454 454 454 454 454 454 455 455 455 455 455 455 C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluPerspective Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Files . . . . . . . . . . Related Information . . . . gluPickMatrix Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Examples . . . . . . . . Files . . . . . . . . . . Related Information . . . . gluProject Subroutine . . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Return Values . . . . . . Files . . . . . . . . . . Related Information . . . . gluPwlCurve Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluQuadricCallback Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . gluQuadricDrawStyle Subroutine Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Files . . . . . . . . . . Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 455 456 456 456 456 456 456 456 456 457 457 457 457 457 457 457 458 458 458 458 458 459 459 459 459 459 459 459 460 460 460 460 460 460 460 460 460 461 461 461 461 461 461 461 461 461 461 461 461 462 462 462 462 462 462 xlv gluQuadricNormals Subroutine . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . gluQuadricOrientation Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . gluQuadricTexture Subroutine . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . gluScaleImage Subroutine . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Return Values . . . . . . . . . Error Codes . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . gluSphere Subroutine . . . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . gluTessBeginContour, gluTessEndContour Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Related Information . . . . . . . gluTessBeginPolygon Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Examples . . . . . . . . . . . xlvi OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 462 462 462 463 463 463 463 463 463 463 463 463 464 464 464 464 464 464 464 464 464 464 464 465 465 465 465 465 465 467 467 467 467 467 467 467 467 467 468 468 468 468 468 468 468 468 468 469 469 469 469 469 469 469 469 Related Information . . . gluTessCallback Subroutine . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Examples . . . . . . . Files . . . . . . . . . Related Information . . . gluTessEndPolygon Subroutine Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Examples . . . . . . . Related Information . . . gluTessNormal Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Related Information . . . gluTessProperty Subroutine . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Related Information . . . gluTessVertex Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Files . . . . . . . . . Examples . . . . . . . Notes . . . . . . . . Related Information . . . gluUnProject Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . Parameters . . . . . . Return Values . . . . . Files . . . . . . . . . Related Information . . . gluUnProject4 Subroutine . . Purpose . . . . . . . Library . . . . . . . . C Syntax . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 470 470 470 470 470 473 473 474 474 474 474 474 474 474 474 474 475 475 475 475 475 475 476 476 476 476 476 476 476 478 478 478 478 478 478 478 478 478 479 479 479 479 479 479 479 480 480 480 480 480 480 480 481 481 481 xlvii Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481 Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 Chapter 3. OpenGL in the AIXwindows (GLX) Environment Related Information . . . . . . . . . . . . . . . . How to Render into an X Drawable . . . . . . . . . . Procedure. . . . . . . . . . . . . . . . . . . Example . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . OpenGL in the AIXwindows environment (GLX) Subroutines . glXChooseFBConfig Subroutine. . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . . . . Return Values . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . glXChooseVisual Subroutine . . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . . . . Return Values . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . glXCopyContext Subroutine . . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . . . . Error Codes . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . glXCreateContext Subroutine. . . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . . . . Error Codes . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . glXCreateGLXPixmap Subroutine . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . xlviii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 483 483 483 484 486 486 487 487 487 488 488 490 490 490 490 490 491 491 491 491 491 491 493 493 494 494 494 494 494 494 494 495 495 495 495 495 496 496 496 496 496 496 496 497 497 497 497 497 497 497 497 C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glXCreateNewContext Subroutine . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Notes . . . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glXCreatePbuffer Subroutine . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glXCreatePixmap Subroutine . . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glXCreateWindow Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glXDestroyContext Subroutine . . Purpose . . . . . . . . . Library . . . . . . . . . . C Syntax . . . . . . . . . Description . . . . . . . . Parameters . . . . . . . . Error Codes . . . . . . . . Files . . . . . . . . . . . Related Information . . . . . glXDestroyGLXPixmap Subroutine . Purpose . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498 498 498 498 498 498 498 499 499 499 499 499 499 500 500 500 500 500 500 500 500 500 501 501 502 502 502 502 502 502 502 502 503 503 503 503 503 503 503 503 503 504 504 504 504 504 504 504 504 504 505 505 505 505 505 505 xlix C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . glXDestroyPbuffer Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . glXDestroyPixmap Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . glXDestroyWindow Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . glXFreeContextEXT Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Errors . . . . . . . . . Related Information . . . . glXGetClientString Subroutine . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Related Information . . . . glXGetConfig Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . l OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 505 505 505 505 506 506 506 506 506 506 506 506 506 506 506 506 507 507 507 507 507 507 507 507 507 507 507 507 508 508 508 508 508 508 508 508 508 508 508 509 509 509 509 509 509 509 509 510 510 510 510 510 510 512 512 Return Values . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glXGetContextIDEXT Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Errors . . . . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glXGetCurrentContext Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Return Values . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glXGetCurrentDisplay Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Notes . . . . . . . . . . . . Related Information . . . . . . . glXGetCurrentDrawable Subroutine . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Return Values . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glXGetCurrentReadDrawable Subroutine Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Return Values . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glXGetFBConfigAttrib Subroutine . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . Description . . . . . . . . . . Parameters . . . . . . . . . . Return Values . . . . . . . . . Files . . . . . . . . . . . . . Related Information . . . . . . . glXGetFBConfigs Subroutine . . . . . Purpose . . . . . . . . . . . Library . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Contents 513 513 513 513 513 513 513 513 513 513 514 514 514 514 514 514 514 514 514 514 515 515 515 515 515 515 515 515 515 515 515 515 515 516 516 516 516 516 516 516 516 516 516 517 517 517 517 517 520 520 520 520 520 520 521 521 li Description . . . . . . . . . Parameters . . . . . . . . . Return Values . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXGetProcAddressARB Subroutine . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Return Values . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXGetSelectedEvent Subroutine . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Errors . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXGetVisualFromFBConfig Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Notes . . . . . . . . . . . Return Values . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXImportContextEXT Subroutine . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Errors . . . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXIsDirect Subroutine . . . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Return Values . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXMakeContextCurrent Subroutine . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . lii OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 521 521 521 521 521 521 521 521 522 522 522 522 522 523 523 523 523 523 523 523 523 523 523 523 523 524 524 524 524 524 524 524 524 524 524 524 525 525 525 525 525 525 525 525 526 526 526 526 526 526 526 526 526 526 526 Description . . . . . . . . . Parameters . . . . . . . . . Return Values . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXMakeCurrent Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Return Values . . . . . . . . Notes . . . . . . . . . . . Error Codes . . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXQueryContext Subroutine . . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Errors . . . . . . . . . . . Related Information . . . . . . glXQueryContextInfoEXT Subroutine . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Errors . . . . . . . . . . . Related Information . . . . . . glXQueryDrawable Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Parameters . . . . . . . . . Errors . . . . . . . . . . . Related Information . . . . . . glXQueryExtension Subroutine . . . Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . Description . . . . . . . . . Notes . . . . . . . . . . . Parameters . . . . . . . . . Return Values . . . . . . . . Files . . . . . . . . . . . . Related Information . . . . . . glXQueryExtensionsString Subroutine Purpose . . . . . . . . . . Library . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527 527 527 527 528 528 528 528 528 528 528 528 529 529 529 529 530 530 530 530 530 530 530 530 531 531 531 531 531 531 531 531 531 531 532 532 532 532 532 532 532 533 533 533 533 533 533 533 533 533 533 534 534 534 534 534 Contents liii Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Related Information . . . . glXQueryServerString Subroutine Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Files . . . . . . . . . . Related Information . . . . glXQueryVersion Subroutine . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Return Values . . . . . . Files . . . . . . . . . . Related Information . . . . glXSelectEvent Subroutine . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . glXSwapBuffers Subroutine . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Notes . . . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . glXUseXFont Subroutine . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Parameters . . . . . . . Error Codes . . . . . . . Files . . . . . . . . . . Related Information . . . . glXWaitGL Subroutine . . . . Purpose . . . . . . . . Library . . . . . . . . . C Syntax . . . . . . . . Description . . . . . . . Notes . . . . . . . . . liv OpenGL 2.1 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 534 534 534 534 534 534 535 535 535 535 535 535 535 535 535 536 536 536 536 536 536 536 536 536 536 537 538 538 538 538 538 538 538 538 539 539 539 539 539 539 539 539 539 540 540 540 540 540 540 541 541 541 541 541 541 Files . . . . . . Related Information glXWaitX Subroutine . Purpose . . . . Library . . . . . C Syntax . . . . Description . . . Notes . . . . . Error Codes . . . Files . . . . . . Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 541 541 541 541 541 542 542 542 542 542 Chapter 4. OpenGL Drawing Widgets and Related Functions GLwCreateMDrawingArea Function . . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . . GLwDrawingArea or GLwMDrawingArea Widget. . . . . . . Purpose . . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . New Resources . . . . . . . . . . . . . . . . . Inherited Resources . . . . . . . . . . . . . . . . Callback Information . . . . . . . . . . . . . . . . Translations . . . . . . . . . . . . . . . . . . . Action Routines. . . . . . . . . . . . . . . . . . Initialization . . . . . . . . . . . . . . . . . . . Notes . . . . . . . . . . . . . . . . . . . . . Examples . . . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . . GLwDrawingAreaMakeCurrent Function . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . . GLwDrawingAreaSwapBuffers Function . . . . . . . . . . Purpose . . . . . . . . . . . . . . . . . . . . Library . . . . . . . . . . . . . . . . . . . . . C Syntax . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . Parameters . . . . . . . . . . . . . . . . . . . Files . . . . . . . . . . . . . . . . . . . . . . Related Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 543 543 543 543 543 543 543 544 544 544 544 544 544 545 548 548 548 549 549 549 549 551 551 551 551 551 551 551 551 551 552 552 552 552 552 552 552 552 552 Appendix. Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555 Contents lv lvi OpenGL 2.1 Reference Manual About This Book OpenGL Programmer’s Reference provides reference information on the OpenGL application programming interface (API). This publication documents the functional interface of: v OpenGL 1.2 (first introduced in AIX 4.3.2) v GLX 1.3 (first introduced in AIX 4.3.2) v GLU 1.3 (first introduced in AIX 4.3.3) It also documents several OpenGL extensions supported on this operating system. Applications/users should query OpenGL to determine if the extension is supported (glXQueryExtensionsString, glGetString, and gluGetString) prior to making extension specific OpenGL, GLX, or GLU calls. Further information is also avaiable in /usr/lpp/OpenGL/README on your installed operating system. Who Should Use This Book This book is intended for programmers with C programming knowledge who want to develop 3D applications. Highlighting The following highlighting conventions are used in this book: Bold Italics Monospace Identifies commands, subroutines, keywords, files, structures, directories, and other items whose names are predefined by the system. Also identifies graphical objects such as buttons, labels, and icons that the user selects. Identifies parameters whose actual names or values are to be supplied by the user. Identifies examples of specific data values, examples of text similar to what you might see displayed, examples of portions of program code similar to what you might write as a programmer, messages from the system, or information you should actually type. ISO 9000 ISO 9000 registered quality systems were used in the development and manufacturing of this product. Related Publications The following books contain information about or related to OpenGL Programmer’s Reference: v AIX 5L for POWER-based Systems OpenGL 2.1 Reference Manual v AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs v GL3.2 Version 4.1 for AIX: Programming Concepts (POWER-based Systems Only) v GL3.2 for AIX: Graphics Library (GL) Technical Reference (POWER-based Systems Only) © Copyright IBM Corp. 1994, 2000 lvii Trademarks The following terms are trademarks of International Business Machines Corporation in the United States, other countries, or both: v AIXwindows UNIX is a registered trademark of The Open Group in the United States and other countries. Other company, product, or service names may be the trademarks or service marks of others. lviii OpenGL 2.1 Reference Manual Chapter 1. OpenGL Subroutines Following is a list of the basic OpenGL subroutines and the purpose of each. A glAccum glActiveTextureARB glAlphaFunc glAreTexturesResident glAreTexturesResidentEXT glArrayElement glArrayElementEXT B glBegin or glEnd glBindTexture glBindTextureEXT glBitmap glBlendColor glBlendColorEXT glBlendEquation glBlendEquationEXT glBlendFunc glBlendFuncSeparateEXT C glCallList glCallLists glClear glClearAccum glClearColor glClearDepth glClearIndex glClearStencil glClientActiveTextureARB glClipBoundingBoxIBM or glClipBoundingSphereIBM or glClipBoundingVerticesIBM glClipPlane glColor glColorMask glColorMaterial glColorNormalVertexSUN glColorPointer glColorPointerEXT glColorPointerListIBM glColorSubTable glColorTable glColorTableParameter glColorVertexSUN © Copyright IBM Corp. 1994, 2000 Operates on the accumulation buffer. Specifies which texture unit is active. Specifies the alpha test function. Determines if textures are loaded in texture memory. Determines if textures are loaded in texture memory. Renders a vertex using the specified vertex array element. Renders a vertex using the specified vertex array element. Delimits the vertices of a primitive or group of like primitives. Binds a named texture to a texturing target. Binds a named texture to a texturing target. Draws a bitmap. Sets the blend color. Sets the blend color. Specifies the RGB color blend equation. Specifies the RGB color blend equation. Specifies pixel arithmetic. Specifies separate RGB and Alpha blend factors. Executes a display list. Executes a list of display lists. Clears buffers within the viewport. Specifies clear values for the accumulation buffer. Specifies clear values for the color buffers. Specifies the clear value for the depth buffer. Specifies the clear value for the color index buffers. Specifies the clear value for the stencil buffer. Specifies which texture unit is active. Determines whether the specified object is trivially accepted, trivially rejected, or clipped by the current set of clipping planes. Specifies a plane against which all geometry is clipped. Sets the current color. Enables and disables the writing of frame buffer color components. Causes a material color to track the current color. Specifies a color, a normal and a vertex in one call. Defines an array of colors. Defines an array of colors. Defines a list of color arrays. Defines a contiguous subset of a color lookup table. Defines a color lookup table. Specifies attributes to be used when loading a color table. Specifies a color and a vertex in one call. 1 glCopyColorSubTable glCopyColorTable glCopyPixels glCopyTexImage1D glCopyTexImage2D glCopyTexSubImage1D glCopyTexSubImage2D glCopyTexSubImage3D glCopyTexSubImage3DEXT glCullFace D glDeleteLists glDeleteTextures glDeleteTexturesEXT glDepthFunc glDepthMask glDepthRange glDisable glDisableClientState glDrawArrays glDrawArraysEXT glDrawBuffer glDrawElements glDrawPixels glDrawRangeElements E glEdgeFlag glEdgeFlagPointer glEdgeFlagPointerEXT glEdgeFlagPointerListIBM glEnable or glDisable glEnableClientState orglDisableClientState glEnd Loads a subset of a color lookup table from the current GL_READ_BUFFER. Load a color lookup table from the current GL_READ_BUFFER. Copies pixels in the frame buffer. Defines a one-dimensional (1D) texture image. Defines a two-dimensional (2D) texture image. Copies a one-dimensional (1D) texture subimage. Copies a two-dimensional (2D) texture subimage. Copies a three-dimensional (3D) texture subimage. Copies a three-dimensional (3D) texture subimage. Specifies whether frontfacing or backfacing facets may be culled. Deletes a contiguous group of display lists. Deletes named textures. Deletes named textures. Specifies the function used for depth buffer comparisons. Enables or disables writing into the depth buffer. Specifies the mapping of z values from normalized device coordinates to window coordinates. Tests whether a capability is enabled. Disables an array. Renders primitives from array data. Renders primitives from array data. Specifies which color buffers are to be used for drawing. Renders primitives from array data. Writes a block of pixels to the frame buffer. Renders primitives from array data. glEvalPoint Marks edges as either boundary or nonboundary. Defines an array of edge flags. Defines an array of edge flags. Defines a list of edge flag arrays. Tests whether a capability is enabled. Enables or disables an array. Delimits the vertices of a primitive or group of like primitives. Evaluates enabled one-dimensional (1D) and two-dimensional (2D) maps. Computes a one-dimensional (1D) or two-dimensional (2D) grid of points or lines. Generates and evaluates a single point in a mesh. F glFeedbackBuffer glFinish glFlush glFog glFogCoordEXT glFogCoordPointerEXT glFogCoordPointerListIBM glFrontFace Controls the feedback mode. Blocks until all GL execution is complete. Forces the running of GL subroutines in finite time. Specifies fog parameters. Specifies a Fog Coordinate. Specifies an array of fog coordinates. Defines a list of arrays of fog coordinates. Defines frontfacing and backfacing polygons. glEvalCoord glEvalMesh 2 OpenGL 2.1 Reference Manual glFrustum G glGenLists glGenTextures glGenTexturesEXT glGet glGetClipPlane glGetColorTable glGetColorTableParameter glGetError glGetLight glGetMap glGetMaterial glGetPixelMap glGetPointerv glGetPointervEXT glGetPolygonStipple glGetString glGetTexEnv glGetTexGen glGetTexImage glGetTexLevelParameter Multiplies the current matrix by a perspective matrix. glGetTexParameter Generates a contiguous set of empty display lists. Generate texture names. Generates texture names. Returns the value or values of a selected parameter. Returns the coefficients of the clipping plane. Returns a color lookup table to the user. Returns attributes used when loading a color table. Returns error information. Returns light source parameter values. Returns evaluator parameters. Returns material parameters. Returns the specified pixel map. Returns the address of the specified pointer. Returns the address of a vertex data array. Returns the polygonstipple pattern. Returns a string describing the current GL connection. Returns texture environment parameters. Returns texture coordinate generation parameters. Returns a texture image. Returns texture parameter levels for a specific level of detail. Returns texture parameter values. H glHint Specifies implementation-specific hints. I glIndex glIndexMask glIndexPointer glIndexPointerEXT glIndexPointerListIBM glInitNames glInterleavedArrays glIsEnabled glIsList glIsTexture glIsTextureEXT L glLight glLightModel glLineStipple glLineWidth glListBase glLoadIdentity glLoadMatrix glLoadName glLoadNamedMatrixIBM Sets the current color index. Controls the writing of individual bits in the color index buffers. Defines an array of color indexes. Defines an array of color indexes. Defines a list of color index arrays. Initializes the name stack. Simultaneously specifies and enables several interleaved arrays. Tests whether a capability is enabled. Tests for display list existence. Determines if a name corresponds to a texture. Determines if a name corresponds to a texture. Sets light source parameters. Sets the lighting model parameters. Specifies the line stipple pattern. Specifies the width of rasterized lines. Sets the display-list base for the glCallLists subroutine. Replaces the current matrix with the identity matrix. Replaces the current matrix with an arbitrary matrix. Loads a name onto the name stack. Loads a pre-defined matrix into the top of the named matrix stack. Chapter 1. OpenGL Subroutines 3 glLoadTransposeMatrixARB glLockArraysEXT glLogicOp M glMap1 glMap2 glMapGrid glMaterial glMatrixMode glMultiDrawArraysEXT glMultiDrawElementsEXT glMultiModeDrawArraysIBM glMultiModeDrawElementsIBM glMultiTexCoordARB glMultMatrix glMultTransposeMatrixARB Loads a matrix in row-major order, rather than column-major order. Locks the currently enabled vertex arrays. Specifies a logical pixel operation for color index rendering. Defines a one-dimensional (1D) evaluator. Defines a two-dimensional (2D) evaluator. Defines a one-dimensional (1D) or two-dimensional (2D) mesh. Specifies material parameters for the lighting model. Specifies the current matrix. Renders multiple primitives from array data. Renders multiple primitives from array data. Renders primitives of multiple primitive types from array data. Renders primitives of multiple primitive types from array data. Sets the current texture coordinates. Multiplies the current matrix by an arbitrary matrix. Multiplies the current matrix by a matrix specified in row-major order, rather than column-major order. N glNewList glNormal glNormalPointer glNormalPointerEXT glNormalPointerListIBM glNormalVertexSUN Creates or replaces a display list. Sets the current normal vector. Defines an array of normals. Defines an array of normals. Defines a list of normal arrays. Specifies a normal and a vertex in one call. O glOrtho Multiplies the current matrix by an orthographic matrix. P glPassThrough glPixelMap glPixelStore glPixelTransfer glPixelZoom glPointSize glPolygonMode glPolygonOffset glPolygonOffsetEXT glPolygonStipple glPrioritizeTextures glPrioritizeTexturesEXT glPushAttrib or glPopAttrib glPushClientAttrib or glPopClientAttrib glPushMatrix or glPopMatrix glPushName or glPopName Places a marker in the feedback buffer. Sets up pixel transfer maps. Sets pixel storage modes. Sets pixel transfer modes. Specifies the pixel zoom factors. Specifies the diameter of rasterized points. Selects a polygon rasterization mode. Sets the scale and bias used to calculate depth values. Sets the scale and bias used to calculate z values. Sets the polygon stippling pattern. Sets texture residence priority. Sets texture residence priority. Pushes and pops the attribute stack. Pushes and pops the attribute stack. Pushes and pops the current matrix stack. Pushes and pops the name stack. R glRasterPos glReadBuffer Specifies the raster position for pixel operations. Selects a color buffer source for pixels. 4 OpenGL 2.1 Reference Manual glReadPixels glRect glRenderMode glRotate S glScale glScissor glSecondaryColorEXT glSecondaryColorPointerEXT glSecondaryColorPointerListIBM glSelectBuffer glShadeModel glStencilFunc glStencilMask glStencilOp T glTexCoord glTexCoordColorNormalVertexSUN Reads a block of pixels from the frame buffer. Draws a rectangle. Sets rasterization mode. Multiplies the current matrix by a rotation matrix. Multiplies the current matrix by a general scaling matrix. Defines the scissor box. Specifies an RGB color used by the Color Sum stage. Specifies an array of secondary colors. Defines a list of arrays of secondary colors. Establishes a buffer for selection mode values. Selects flat or smooth shading. Sets function and reference values for stencil testing. Controls the writing of individual bits in the stencil planes. Sets stencil test actions. glTexCoordPointer glTexCoordPointerEXT glTexCoordPointerListIBM glTexCoordVertexSUN glTexEnv glTexGen glTexImage1D glTexImage2D glTexImage3D glTexImage3DEXT glTexParameter glTexSubImage1D glTexSubImage1DEXT glTexSubImage2D glTexSubImage2DEXT glTexSubImage3D glTexSubImage3DEXT glTranslate Sets the current texture coordinates. Specifies a texture coordinate, a color, a normal and a vertex in one call. Specifies a texture coordinate, a color, and a vertex in one call. Specifies a texture coordinate, a normal and a vertex in one call. Defines an array of texture coordinates. Defines an array of texture coordinates. Defines a list of texture coordinate arrays. Specifies a texture coordinate and a vertex in one call. Sets texture environment parameters. Controls the generation of texture coordinates. Specifies a one-dimensional (1D) texture image. Specifies a two-dimensional (2D) texture image. Specifies a three-dimensional (3D) texture image. Specifies a three-dimensional (3D) texture image. Sets texture parameters. Specifies a one-dimensional (1D) texture subimage. Specifies a one-dimensional (1D) texture subimage. Specifies a two-dimensional (2D) texture subimage. Specifies a two-dimensional (2D) texture subimage. Specifies a three-dimensional (3D) texture subimage. Specifies a three-dimensional (3D) texture subimage. Multiplies the current matrix by a translation matrix. U glUnLockArraysEXT Unlocks the currently enabled vertex arrays. glTexCoordColorVertexSUN glTexCoordNormalVertexSUN V glVertex glVertexPointer glVertexPointerEXT glVertexPointerListIBM glViewport glVisibilityBufferIBM Specifies a vertex. Defines an array of vertex data. Defines an array of vertex data. Defines a list of vertex arrays. Sets the viewport. Specifies the array in which visibility calculation results are stored. Chapter 1. OpenGL Subroutines 5 glVisibilityThresholdIBM Specifies the number of visible fragments rendered before a visibility hit is registered. glAccum Subroutine Purpose Operates on the accumulation buffer. Library OpenGL C bindings library: libGL.a C Syntax void glAccum(GLenum GLfloat Operation, Value) Description The accumulation buffer is an extended-range color buffer. Images are not rendered into it. Rather, images rendered into one of the color buffers are added to the contents of the accumulation buffer after rendering. Effects such as antialiasing (of points, lines, and polygons), motion-blur, and depth of field can be created by accumulating images generated with different transformation matrices. Each pixel in the accumulation buffer consists of red, green, blue, and alpha (RGBA) values. The number of bits per component in the accumulation buffer depends on the implementation. You can examine this number by calling glGetInteger four times, with arguments GL_ACCUM_RED_BITS, GL_ACCUM_GREEN_BITS, GL_ACCUM_BLUE_BITS, and GL_ACCUM_ALPHA_BITS, respectively. (See the glGet subroutine for more information on glGetInteger.) Regardless of the number of bits per component, however, the range of values stored by each component is [-1,1]. The accumulation buffer pixels are mapped 1-to-1 with frame buffer pixels. The glAccum subroutine operates on the accumulation buffer. The first argument, Operation, is a symbolic constant that selects an accumulation buffer operation. The second argument, Value, is a floating-point value to be used in that operation. Five operations are specified: GL_LOAD, GL_ACCUM, GL_ADD, GL_MULT, and GL_RETURN. All accumulation buffer operations are limited to the area of the current scissor box and are applied identically to the RGBA components of each pixel. The contents of an accumulation buffer pixel component are undefined if the glAccum operation results in a value outside the range [-1,1]. The operations are: GL_ACCUM GL_LOAD GL_ADD GL_MULT 6 Obtains RGBA values from the buffer currently selected for reading. (See glReadBuffer.) Each component value is divided by 2n-1, where n is the number of bits allocated to each color component in the currently selected buffer. The result is a floating-point value in the range [0,1], which is multiplied by value and added to the corresponding pixel component in the accumulation buffer, thereby updating the accumulation buffer. Functions similarly to GL_ACCUM, except that the current value in the accumulation buffer is not used in the calculation of the new value. That is, the RGBA values from the currently selected buffer are divided by 2n-1, multiplied by Value, and then stored in the corresponding accumulation buffer cell, overwriting the current value. Adds Value to each R, G, B, and A in the accumulation buffer. Multiplies each RGBA in the accumulation buffer by Value and returns the scaled component to its corresponding accumulation buffer location. OpenGL 2.1 Reference Manual GL_RETURN Transfers accumulation buffer values to the color buffer or buffers currently selected for writing. Each RGBA component is multiplied by Value, then multiplied by 2n-1, clamped to the range [0, 2n-1] and stored in the corresponding display buffer cell. The only fragment operations that are applied to this transfer are pixel ownership, scissor, dithering, and color writemasks. The accumulation buffer is cleared by specifying R, G, B, A values to set it to with the glClearAccum directive, and then issuing a glClear subroutine with the accumulation buffer enabled. Parameters Operation Value Specifies the accumulation buffer operation. Symbolic constants GL_LOAD, GL_ACCUM, GL_MULT, GL_ADD, and GL_RETURN are accepted. Specifies a floating-point value used in the accumulation buffer operation. The Operation parameter determines how Value is used. Notes All glAccum operations update only those pixels within the current scissor box. Errors GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_OPERATION Operation is set to an unaccepted value. There is no accumulation buffer. The glAccum subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glAccum subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_ACCUM_RED_BITS glGet with argument GL_ACCUM_GREEN_BITS glGet with argument GL_ACCUM_BLUE_BITS glGet with argument GL_ACCUM_ALPHA_BITS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glBlendFunc subroutine, glClear subroutine, glClearAccum subroutine, glCopyPixels subroutine, glLogicOp subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glReadBuffer subroutine, glReadPixels subroutine, glScissor subroutine, glStencilOp subroutine. Chapter 1. OpenGL Subroutines 7 glActiveTextureARB Subroutine Purpose Specify which texture unit is active. Library OpenGL C bindings library: (libGL.a) C Syntax void glActiveTextureARB(GLenum texture) Description glActiveTextureARB selects which texture unit subsequent texture state calls will affect. The number of texture units an implementation supports is implementation dependent, but must be at least two. The texture parameter must be one of GL_TEXTUREi_ARB, where 0 <= i < GL_MAX_TEXTURE_UNITS_ARB. The initial value is GL_TEXTURE0_ARB. Parameters texture specifies which texture unit to make active. Notes Vertex arrays are client-side GL resources, which are selected by the glClientActiveTextureARB routine. If the GL_ARB_multitexture extension is NOT present, then the number of texture units supported by the implementation is one, not two, as described above. The following OpenGL subroutines will be routed to different texture units based on this call: v glEnable (GL_TEXTURE_GEN_*) v v v v v v glDisable (GL_TEXTURE_GEN_*) glTexGen* glTexEnv* glTexImage* glTexSubImage* glCopyTexImage* v glCopyTexSubImage* v glBindTexture Errors GL_INVALID_OPERATION is generated if texture is not one of the accepted values. Files /usr/include/GL/gl.h 8 OpenGL 2.1 Reference Manual Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glEnableClientState or glDisableClientState subroutine, the glMultiTexCoordARB subroutine, the glTexCoordPointer. glAlphaFunc Subroutine Purpose Specifies the alpha test function. Library OpenGL C bindings library: libGL.a C Syntax void glAlphaFunc(GLenum Function, GLclampf Reference) Description The alpha test discards fragments conditional on the outcome of a comparison between the incoming fragment’s alpha value and a constant reference value. The glAlphaFunc subroutine specifies the reference and comparison function. The comparison is performed only if alpha testing is enabled. (See glEnable or glDisable of GL_ALPHA_TEST.) The Function and Reference parameters specify the conditions under which the pixel is drawn. The incoming alpha value is compared to the Reference parameter using the function specified by Function. If the comparison passes, the incoming fragment is drawn, conditional on subsequent stencil and depth-buffer tests. If the comparison fails, no change is made to the frame buffer at that pixel location. The comparison functions are: GL_NEVER GL_LESS GL_EQUAL GL_LEQUAL GL_GREATER GL_NOTEQUAL GL_GEQUAL GL_ALWAYS Never passes. Passes if the incoming Passes if the incoming Passes if the incoming Passes if the incoming Passes if the incoming Passes if the incoming Always passes. alpha alpha alpha alpha alpha alpha value value value value value value is is is is is is less than the reference value. equal to the reference value. less than or equal to the reference value. greater than the reference value. not equal to the reference value. greater than or equal to the reference value. The glAlphaFunc subroutine operates on all pixel write operations, including those resulting from the scan conversion of points, lines, polygons, and bitmaps, and those resulting from pixel draw and copy operations. The glAlphaFunc subroutine does not affect screen clear operations. Parameters Function Reference Specifies the alpha comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The default function is GL_ALWAYS. Specifies the reference value to which incoming alpha values are compared. This value is clamped to the range 0 (zero) through 1 (one), where 0 represents the lowest possible alpha value, and 1 the highest possible value. The default reference is 0. Chapter 1. OpenGL Subroutines 9 Notes Alpha testing is done only in RGBA mode. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Function is set to an unaccepted value. The glAlphaFunc subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glAlphaFunc subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_ALPHA_TEST_FUNC glGet with argument GL_ALPHA_TEST_REF glIsEnabled with argument GL_ALPHA_TEST. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glBlendFunc subroutine, glClear subroutine, glDepthfunc subroutine, glEnable or glDisable subroutine, glStencilFunc subroutine. glAreTexturesResident Subroutine Purpose Determines if textures are loaded in texture memory. Library OpenGL C bindings library: libGL.a C Syntax GLboolean glAreTexturesResident(GLsizei const GLuint * textures, GLboolean * residences) n, Description On machines with a limited amount of texture memory, OpenGL establishes a “working set” of textures that are resident in texture memory. These textures may be bound to a texture target much more efficiently than textures that are not resident. The glAreTexturesResident subroutine queries the texture residence status of the n textures named by the elements of textures. If all the named textures are resident, glAreTexturesResident returns GL_TRUE and the contents of residences are undisturbed. If not all the named textures are resident, 10 OpenGL 2.1 Reference Manual glAreTexturesResident returns GL_FALSE and detailed status is returned in the n elements of residences. If an element of residences is GL_TRUE, then the texture named by the corresponding element of textures is resident. The residence status of a single bound texture may also be queried by calling glGetTexParameter with the target argument set to the target to which the texture is bound, and the parameter name argument set to GL_TEXTURE_RESIDENT. This is the only way that the residence status of a default texture can be queried. The glAreTexturesResident subroutine is not included in display lists. Parameters n textures residences Specifies the number of textures to be queried. Specifies an array containing the names of the textures to be queried. Specifies an array in which the texture residence status is returned. The residence status of a texture named by an element of textures is returned in the corresponding element of residences. Notes The glAreTexturesResident subroutine is available only if the GL version is 1.1 or greater. The glAreTexturesResident subroutine returns the residency status of the textures at the time of invocation. It does not guarantee that the textures will remain resident at any other time. If textures live in virtual memory (there is no texture memory) they are considered always resident. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_VALUE is generated if any element in textures is zero or does not name a texture. In that case, the function returns GL_FALSE and the contents of residences is indeterminate. GL_INVALID_OPERATION is generated if glAreTexturesResident is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexParameter with parameter name GL_TEXTURE_RESIDENT retrieves the residence status of a currently-bound texture. Related Information The glBindTexture subroutine, glPrioritizeTextures subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexParameter subroutine. glAreTexturesResidentEXT Subroutine Purpose Renders a vertex using the specified vertex array element. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 11 C Syntax GLboolean glAreTexturesResidentEXT(GLsizei const GLuint * textures, GLboolean * residences) n, Description On machines with a limited amount of texture memory, OpenGL establishes a “working set” of textures that are resident in texture memory. These textures may be bound to a texture target much more efficiently than textures that are not resident. The glAreTexturesResidentEXT subroutine queries the texture residence status of the n textures named by the elements of textures. If all the named textures are resident, glAreTexturesResidentEXT returns GL_TRUE and the contents of residences are undisturbed. If not all the named textures are resident, glAreTexturesResidentEXT returns GL_FALSE and detailed status is returned in the n elements of residences. If an element of residences is GL_TRUE, then the texture named by the corresponding element of textures is resident. The residence status of a single bound texture may also be queried by calling glGetTexParameter with the target argument set to the target to which the texture is bound, and the parameter name argument set to GL_TEXTURE_RESIDENT_EXT. This is the only way that the residence status of a default texture can be queried. The glAreTexturesResidentEXT subroutine is not included in display lists. Parameters n textures residences Specifies the number of textures to be queried. Specifies an array containing the names of the textures to be queried. Specifies an array in which the texture residence status is returned. The residence status of a texture named by an element of textures is returned in the corresponding element of residences. Notes The glAreTexturesResidentEXT subroutine is part of the EXT_texture_object extension, not part of the core GL command set. If GL_EXT_texture_object is included in the string returned by glGetString (when called with argument GL_EXTENSIONS), extension EXT_texture_object is supported by the connection. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_VALUE is generated if any element in textures is zero or does not name a texture. GL_INVALID_OPERATION is generated if glAreTexturesResidentEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexParameter with parameter name GL_TEXTURE_RESIDENT_EXT retrieves the residence status of a currently-bound texture. Files /usr/include/GL/glext.h 12 OpenGL 2.1 Reference Manual Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBindTextureEXT subroutine, glPrioritizeTexturesEXT subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexParameter subroutine. glArrayElement Subroutine Purpose Renders a vertex using the specified vertex array element. Library OpenGL C bindings library: libGL.a C Syntax void glArrayElement(GLint i) Description The glArrayElement commands are used within glBegin/glEnd pairs to specify vertex and attribute data for point, line, and polygon primitives. If GL_VERTEX_ARRAY is enabled when glArrayElement is called, a single vertex is drawn, using vertex and attribute data taken from location i of the enabled arrays. If GL_VERTEX_ARRAY is not enabled, no drawing occurs but the attributes correspoinding to the enabled arrays are modified. Use glArrayElement to construct primitives by indexing vertex data, rather than by streaming through arrays of data in first-to-last order. Because each call specifies only a single vertex, it is possible to explicitly specify per- primitive attributes, such as a single normal per individual triangle. Changes made to array data between the execution of glBegin and the corresponding execution of glEnd may affect calls to glArrayElement that are made within the same glBegin/glEnd period in non-sequential ways. That is, a call to glArrayElement that precedes a change to array data may access the changed data, and a call that follows a change to array data may access original data. Parameters i Specifies an index into the enabled vertex data arrays. Notes The glArrayElement subroutine is available only if the GL version is 1.1 or greater. The glArrayElement subroutine is included in display lists. If glArrayElement is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Related Information The glClientActiveTextureARB subroutine, glColorPointer subroutine, glDrawArrays subroutine, glEdgeFlagPointer subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glNormalPointer subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. Chapter 1. OpenGL Subroutines 13 glArrayElementEXT Subroutine Purpose Specifies the array elements used to render a vertex. Library OpenGL C bindings library: libGL.a C Syntax void glArrayElementEXT(GLint i ) Description The glArrayElementEXT commands are used within glBegin/glEnd pairs to specify vertex and attribute data for point, line and polygon primitives. When glArrayElementEXT is called, a single vertex is drawn, using vertex and attribute data taken from location i of the enabled arrays. Use glArrayElementEXT to construct primitives by indexing vertex data, rather than by streaming through arrays of data in first-to-last order. Because each call specifies only a single vertex, it is possible to explicitly specify perprimitive attributes, such as a single normal per individual triangle. Parameters i Specifies an index in the enabled arrays. Notes The glArrayElementEXT subroutine may be included in display lists. If glArrayElementEXT is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Static array data may be read and cached by the implementation at any time. If static array elements are modified and the arrays are not respecified, the results of any subsequent calls to glArrayElementEXT are undefined. The glArrayElementEXT subroutine executes even if GL_VERTEX_ARRAY_EXT is not enabled. No drawing occurs in this case, but the attributes corresponding to enabled arrays are modified. Although it is not an error to respecify an array between the execution of glBegin and the corresponding execution of glEnd, the result of such respecification is undefined. The glArrayElementEXT subroutine is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. File /usr/include/GL/glext.h 14 OpenGL 2.1 Reference Manual Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glClientActiveTextureARB subroutine, glColorPointerEXT subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glGetPointervEXT subroutine, glIndexPointerEXT subroutine, glInterleavedArrays subrou glNormalPointerEXT subroutine, glTexCoordPointerEXT subroutine, glVertexPointerEXT subroutine. glBegin or glEnd Subroutine Purpose Delimits the vertices of a primitive or group of like primitives. Library OpenGL C bindings library: libGL.a C Syntax void glBegin(GLenum mode) void glEnd(void) Description The glBegin and glEnd subroutines delimit the vertices that define a primitive or group of like primitives. The glBegin subroutine accepts a single argument that specifies which of 10 ways the vertices will be interpreted. Taking n as an integer count starting at 1 (one), and N as the total number of vertices specified, the interpretations are: GL_POINTS GL_LINES GL_LINE_STRIP GL_LINE_LOOP GL_TRIANGLES GL_TRIANGLE_STRIP GL_TRIANGLE_FAN GL_QUADS GL_QUAD_STRIP GL_POLYGON Treats each vertex as a single point. Vertex n defines point n. N points are drawn. Treats each pair of vertices as an independent line segment. Vertices 2n-1 and 2n define line n. N/2 lines are drawn. Draws a connected group of line segments from the first vertex to the last. Vertices n and n+1 define line n. N-1 lines are drawn. Draws a connected group of line segments from the first vertex to the last, then back to the first. Vertices n and n+1 define line n. The last line, however, is defined by vertices N and 1. N lines are drawn. Treats each triplet of vertices as an independent triangle. Vertices 3n-2, 3n-1, and 3n define triangle n. N/3 triangles are drawn. Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. For odd n, vertices n, n+1, and n+2 define triangle n. For even n, vertices n+1, n, and n+2 define triangle n. N-2 triangles are drawn. Draws a connected group of triangles. One triangle is defined for each vertex presented after the first two vertices. Vertices 1, n+1, and n+2 define triangle n. N-2 triangles are drawn. Treats each group of four vertices as an independent quadrilateral. Vertices 4n-3, 4n-2, 4n-1, and 4n define quadrilateral n. N/4 quadrilaterals are drawn. Draws a connected group of quadrilaterals. One quadrilateral is defined for each pair of vertices presented after the first pair. Vertices 2n-1, 2n, 2n+2, and 2n+1 define quadrilateral n. N/2-1 quadrilaterals are drawn. Note that the order in which vertices are used to construct a quadrilateral from strip data is different from that used with independent data. Draws a single, convex polygon. Vertices 1 through N define this polygon. Only a subset of GL subroutines can be used between the glBegin and glEnd subroutines. The subroutines are: glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, and glEdgeFlag. Also, it is acceptable to use glCallList or glCallLists to execute display lists Chapter 1. OpenGL Subroutines 15 that include only the preceding subroutines. If any other GL subroutine is called between the glBegin and glEnd subroutines, the error flag is set and the subroutine is ignored. Regardless of the value chosen for mode, there is no limit to the number of vertices that can be defined between the glBegin and glEnd subroutines. Lines, triangles, quadrilaterals, and polygons that are incompletely specified are not drawn. Incomplete specification results when either too few vertices are provided to specify even a single primitive or when an incorrect multiple of vertices is specified. The incomplete primitive is ignored; the rest are drawn. The minimum specification of vertices for each primitive is as follows: 1 for a point, 2 for a line, 3 for a triangle, 4 for a quadrilateral, and 3 for a polygon. Modes that require a certain multiple of vertices are: GL_LINES (2), GL_TRIANGLES (3), GL_QUADS (4), and GL_QUAD_STRIP (2). Parameters mode Specifies the primitive or primitives that will be created from vertices presented between glBegin and the subsequent glEnd. Ten symbolic constants are accepted: GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, and GL_POLYGON. Errors INVALID_ENUM GL_INVALID_OPERATION Indicates that mode is set to an unaccepted value. Indicates that a subroutine other than glVertex, glColor, glIndex, glNormal, glTexCoord, glEvalCoord, glEvalPoint, glMaterial, glEdgeFlag, glCallList, or glCallLists subroutine is called between glBegin and the corresponding glEnd. Indicates that glEnd is called before the corresponding glBegin is called. GL_INVALID_OPERATION Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElement subroutine, glArrayElementEXT subroutine, glColor subroutine, glCallList subroutine, glCallLists subroutine, glEdgeFlag subroutine, glEvalCoord subroutine, glEvalPoint subroutine, glIndex subroutine, glMaterial subroutine, glNormal subroutine, glTexCoord subroutine, glVertex subroutine. glBindTexture Subroutine Purpose Binds a named texture to a texturing target. Library OpenGL C bindings library: libGL.a C Syntax void glBindTexture(GLenum GLuint texture) 16 target, OpenGL 2.1 Reference Manual Description The glBindTexture subroutine lets you create or use a named texture. Calling glBindTexture with target set to GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_3D_EXT and texture set to the name of the new texture binds the texture name to the target. When a texture is bound to a target, the previous binding for that target is automatically broken. Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names and the corresponding texture contents are local to the shared display-list space (see glXCreateContext) of the current GL rendering context; two rendering contexts share texture names only if they also share display lists. You can use glGenTextures to generate a set of new texture names. When a texture is first bound, it assumes the dimensionality of its target: A texture first bound to GL_TEXTURE_1D becomes one-dimensional (1D), a texture first bound to GL_TEXTURE_2D becomes two-dimensional (2D), a texture first bound to GL_TEXTURE_3D becomes three-dimensional (3D), a texture first bound to GL_TEXTURE_3D_EXT becomes three-dimensional (3D). The state of a (1D) texture immediately after it is first bound is equivalent to the state of the default GL_TEXTURE_1D at GL initialization, and similarly for 2D and 3D textures. While a texture is bound, GL operations on the target to which it is bound affect the bound texture, and queries of the target to which it is bound return state from the bound texture. If texture mapping of the dimensionality of the target to which a texture is bound is active, the bound texture is used. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name zero refers to the default textures that were bound to them at initialization. A texture binding created with glBindTexture remains active until a different texture is bound to the same target, or until the bound texture is deleted with glDeleteTextures. Once created, a named texture may be rebound to the target of the matching dimensionality as often as needed. It is usually much faster to use glBindTexture to bind an existing named texture to one of the texture targets than it is to reload the texture image using glTexImage1D or glTexImage2D. For additional control over performance, use glPrioritizeTextures. The glBindTexture subroutine is included in display lists. Parameters target texture Specifies the target to which the texture is bound. Must be either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_3D_EXT (EXT_texture3D). Specifies the name of a texture. Errors GL_INVALID_ENUM is generated if target is not one of the allowable values. GL_INVALID_OPERATION is generated if texture has a dimensionality which doesn’t match that of target. GL_INVALID_OPERATION is generated if glBindTexture is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_TEXTURE_1D_BINDING glGet with argument GL_TEXTURE_2D_BINDING Chapter 1. OpenGL Subroutines 17 glGet with argument GL_TEXTURE_3D_BINDING glGet with argument GL_TEXTURE_3D_BINDING_EXT Related Information The glAreTexturesResident subroutine, glDeleteTextures subroutine, glGenTextures subroutine, glGet subroutine, glGetTexParameter subroutine, glIsTexture subroutine, glPrioritizeTextures subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. glBindTextureEXT Subroutine Purpose Binds a named texture to a texturing target. Library OpenGL C bindings library: libGL.a C Syntax void glBindTextureEXT(GLenum GLuint texture) target, Description glBindTextureEXT is part of the EXT_texture_object extension. This extension makes it possible to use named 1-, 2-dimensional textures in addition to the usual OpenGL texture targets designated by GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D_EXT, etc. Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names and the corresponding texture contents are local to the shared display-list space (see glXCreateContext) of the current OpenGL rendering context; two rendering contexts will share texture names only if they also share display lists. To create a named texture, simply bind a previously-unused texture name to one of the texture targets listed above. This can be accomplished by calling glBindTextureEXT with target set to the appropriate texture target, and texture set to the name of the new texture. When a texture is bound to a target, the previous binding for that target is automatically broken. Note that glGenTexturesEXT may be used to generate a set of fresh texture names. When a texture is first bound, it assumes the dimensionality of its target: A texture first bound to GL_TEXTURE_1D becomes one-dimensional (1D), a texture first bound to GL_TEXTURE_2D becomes two-dimensional (2D), a texture first bound to GL_TEXTURE_3D_EXT becomes three-dimensional (3D). The state of a (1D) texture immediately after it is first bound is equivalent to the state of the default GL_TEXTURE_1D at GL initialization, and similarly for 2D and 3D textures. While a texture is bound, GL operations on the target towhich it is bound affect the bound texture, and queries of the target to which it is bound return state from the bound texture. If texture mapping of the dimensionality of the target to which a texture is bound is active, the bound texture is used. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name zero refers to the default textures that were bound to them at initialization. A texture binding created with glBindTextureEXT remains active until a different texture is bound to the same target, or until the bound texture is deleted with glDeleteTexturesEXT. 18 OpenGL 2.1 Reference Manual Once created, a named texture may be re-bound to the appropriate target as often as needed. It is usually much faster to bind an existing named texture to one of the texture targets using glBindTextureEXT than it is to reload the texture image using glTexImage*. For additional control over performance, consider using glPrioritizeTexturesEXT. glBindTextureEXT is included in display lists. Parameters target texture The target to which the texture will be bound. Must be one of GL_TEXTURE_1D, GL_TEXTURE_2D, or GL_TEXTURE_3D_EXT (EXT_texture3D). The name of a texture. Notes glBindTextureEXT is part of the EXT_texture_object extension, not part of the core GL command set. If GL_EXT_texture_object is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_texture_object is supported by the connection. Errors GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_OPERATION Generated if target is not one of the allowable values. Generated if texture has a dimensionality and it doesn’t match that of target. Generated if glBindTextureEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGet with argument GL_TEXTURE_1D_BINDING_EXT glGet with argument GL_TEXTURE_2D_BINDING_EXT glGet with argument GL_TEXTURE_3D_BINDING_EXT Files /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glDeleteTexturesEXT subroutine, glGenTexturesEXT subroutine, glGet subroutine, glGetTexParameter subroutine, glIsTexture subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. glBitmap Subroutine Purpose Draws a bitmap. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 19 C Syntax void glBitmap(GLsizei Width, GLsizei Height, GLfloat xOrigin, GLfloat yOrigin, GLfloat xMove, GLfloat yMove, const GLubyte * Bitmap) Description A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corresponding to 1’s in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to 0’s in the bitmap are not modified. The glBitmap subroutine takes seven arguments. The first pair of arguments specify the width and height of the bitmap image. The second pair of arguments specify the location of the bitmap origin relative to the lower left corner of the bitmap image. The final pair of arguments specify x and y offsets to be added to the current raster position after the bitmap has been drawn. The final argument is a pointer to the bitmap image itself. The bitmap image is interpreted like image data for the glDrawPixels subroutine, with Width and Height corresponding to the width and height arguments of that subroutine, and with Type set to GL_BITMAP and Format set to GL_COLOR_INDEX. Modes specified using the glPixelStore subroutine affect the interpretation of bitmap image data; modes specified using the glPixelTransfer subroutine do not. If the current raster position is not valid, the glBitmap subroutine is ignored. Otherwise, the lower left corner of the bitmap image is positioned at the following window coordinates: xw = yw = [xr - xo] [yr - yo] where ( xr, yr ) is the raster position, and ( xo, yo ) is the bitmap origin. Fragments are then generated for each pixel corresponding to a 1 in the bitmap image. These fragments are generated using the current raster z coordinate, color or color index, and current raster texture coordinates. They are then treated just as if they had been generated by a point, line, or polygon, including texture mapping, fogging, and all per-fragment operations such as alpha and depth testing. After the bitmap has been drawn, the x and y coordinates of the current raster position are offset by xMove and yMove. No change is made to the z coordinate of the current raster position, or to the current raster color, index, or texture coordinates. Parameters Width Height xOrigin yOrigin xMove yMove Bitmap 20 Specifies the pixel width of the bitmap image. Specifies the pixel height of the bitmap image. Specifies the location of the x origin in the bitmap image. The x origin is measured from the lower left corner of the bitmap, with right and up being the positive axes. Specifies the location of the y origin in the bitmap image. The y origin is measured from the lower left corner of the bitmap, with right and up being the positive axes. Specifies the x offset to be added to the current raster position after the bitmap is drawn. Specifies the y offset to be added to the current raster position after the bitmap is drawn. Specifies the address of the bitmap image. OpenGL 2.1 Reference Manual Errors GL_INVALID_VALUE GL_INVALID_OPERATION Either Width or Height is negative. The glBitmap subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glBitmap subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_CURRENT_RASTER_POSITION glGet with argument GL_CURRENT_RASTER_COLOR glGet with argument GL_CURRENT_RASTER_INDEX glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS glGet with argument GL_CURRENT_RASTER_POSITION_VALID. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glDrawPixels subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glRasterPos subroutine. glBlendColor Subroutine Purpose Sets the blend color. This subroutine is part of OpenGL 1.2 ARB Imaging subset extension. Library OpenGL C bindings library: libGL.a C Syntax void glBlendColor(GLclampf GLclampf GLclampf GLclampf red, green, blue, alpha) Description The GL_BLEND_COLOR may be used to calculate the source and destination blending factors. See glBlendFunc for a complete description of the blending operations. Initially the GL_BLEND_COLOR is set to (0, 0, 0, 0). Chapter 1. OpenGL Subroutines 21 Parameters red, green, blue, alpha Specify the components of GL_BLEND_COLOR. Notes The glBlendColor subroutine is available only if the GL version is 1.1 or greater. Errors GL_INVALID_OPERATION The glBlendColor is called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_BLEND_COLOR. Related Information The glBlendFunc subroutine, glGetString subroutine. glBlendColorEXT Subroutine Purpose Sets the blend color. This subroutine is part of OpenGL 1.2 ARB Imaging subset extension. Library OpenGL C bindings library: libGL.a C Syntax void glBlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) Description The GL_BLEND_COLOR_EXT may be used to calculate the source and destination blending factors. See glBlendFunc for a complete description of the blending operations. Initially the GL_BLEND_COLOR_EXT is set to (0, 0, 0, 0). Parameters red, green, blue, alpha Specify the components of GL_BLEND_COLOR_EXT. Notes The glBlendColorEXT subroutine is available only if the GL version is 1.1 or greater. Errors GL_INVALID_OPERATION 22 OpenGL 2.1 Reference Manual The glBlendColorEXT is called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_BLEND_COLOR_EXT. Related Information The glBlendFunc subroutine, glGetString subroutine. glBlendEquation Subroutine Purpose Specifies the RGB color blend equation. This subroutine is part of the OpenGL 1.2 ARB Imaging subset. Library OpenGL C bindings library: libGL.a C Syntax void glBlendEquation(GLenum mode) Description Blending combines corresponding source and destination color components according to the blending operation specified by the mode. The blend equations are: GL_FUNC_ADD GL_FUNC_SUBTRACT GL_FUNC_REVERSE_SUBTRACT GL_LOGIC_OP GL_MIN GL_MAX min(Cs*sf + Cd*df, 1) max(Cs*sf - Cd*df, 0) max(Cd*df - Cs*sf, 0) Cs Lop Cd min(Cs, Cd) max(Cs, Cd) where Cs and Cd are the source and destination color components, respectively; sf and df are the source and destination blending factors are specified by glBlendFunc; Lop is one of the 16 bitwise operators specified by glLogicOp. Parameters mode Specifies how source and destination RGBA color components are combined. The symbolic constants GL_FUNC_ADD, GL_MIN, GL_MAX, GL_FUNC_SUBTRACT, GL_REVERSE_SUBTRACT are accepted. The initial mode is GL_FUNC_ADD. Notes The mode GL_LOGIC_OP is part of the EXT_blend_logic_op extension, not part of the core GL command set. If GL_EXT_blend_logic_op is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_blend_logic_op is supported by the connection. Errors GL_INVALID_ENUM GL_INVALID_OPERATION The mode parameter is not an accepted or supported value. The glBlendEquation is called between a call to glBegin and the corresponding call to glEnd. Chapter 1. OpenGL Subroutines 23 Associated Gets glGet with argument GL_BLEND_EQUATION. Related Information The glBlendFunc subroutine, glEnable or glDisable subroutine, glGet subroutine, glLogicOp subroutine. glBlendEquationEXT Subroutine Purpose Specifies the RGB color blend equation. Library OpenGL C bindings library: libGL.a C Syntax void glBlendEquationEXT(GLenum mode) Description Blending combines corresponding source and destination color components according to the blending operation specified by the mode. The blend equations are: GL_FUNC_ADD_EXT GL_FUNC_SUBTRACT_EXT GL_FUNC_REVERSE_SUBTRACT_EXT GL_LOGIC_OP GL_MIN_EXT GL_MAX_EXT min(Cs*sf + Cd*df, 1) max(Cs*sf - Cd*df, 0) max(Cd*df - Cs*sf, 0) Cs Lop Cd min(Cs, Cd) max(Cs, Cd) where Cs and Cd are the source and destination color components, respectively; sf and df are the source and destination blending factors are specified by glBlendFunc; Lop is one of the 16 bitwise operators specified by glLogicOp. Parameters mode Specifies how source and destination RGBA color components are combined. The symbolic constants GL_FUNC_ADD_EXT, GL_MIN_EXT, GL_MAX_EXT, GL_FUNC_SUBTRACT_EXT, GL_REVERSE_SUBTRACT_EXT are accepted. The initial mode is GL_FUNC_ADD_EXT. Notes The modes GL_FUNC_SUBTRACT_EXT and GL_FUNC_REVERSE_SUBTRACT_EXT are part of the EXT_blend_subtract extension, not part of the core GL command set. If GL_EXT_blend_subtract is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_blend_subtract is supported by the connection. The mode GL_LOGIC_OP is part of the EXT_blend_logic_op extension, not part of the core GL command set. If GL_EXT_blend_logic_op is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_blend_logic_op is supported by the connection. 24 OpenGL 2.1 Reference Manual The modes GL_MIN_EXT and GL_MAX_EXT are part of the EXT_blend_minmax extension, not part of the core GL command set. If GL_EXT_blend_minmax is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_blend_minmax is supported by the connection. Errors GL_INVALID_ENUM GL_INVALID_OPERATION The mode parameter is not an accepted or supported value. The glBlendEquation is called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_BLEND_EQUATION_EXT. Related Information The glBegin subroutine, glBlendFunc subroutine, glEnable or glDisable subroutine, glGet subroutine, glGetString subroutine, glLogicOp subroutine. glBlendFunc Subroutine Purpose Specifies pixel arithmetic. Library OpenGL C bindings library: libGL.a C Syntax void glBlendFunc(GLenum SourceFactor, GLenum DestinationFactor) Description In RGB mode, pixels can be drawn using a function that blends the incoming (source) red, green, blue, and alpha (RGBA) values with the RGBA values that are already in the frame buffer (the destination values). By default, blending is disabled. Use the glEnable and glDisable subroutines with argument GL_BLEND to enable and disable blending. When blending is enabled, glBlendFunc and glBlendEquationEXT determine the blending operation. SourceFactor and DestinationFactor specify the scaling rules used for scaling the source and destination color components, respectively. Each rule defines four scale factors, one each for red, green, blue, and alpha. The rules are described in the table below. In the table and in subsequent equations, source color components are referred to as: (Rs, Gs, Bs, As) Destination color components are referred to as: (Rd, Gd, Bd, Ad) Constant color components are referred to as: (Rc, Gc, Bc, Ac) They are understood to have integer values between 0 (zero) and: Chapter 1. OpenGL Subroutines 25 (kR, kG, kB, kA) where (kc = 2mc - 1) (m R, m G, m B, m A) represents the number of RGBA bit planes. Source scale factors are referred to as: (s R, s G, s B, s A) Destination scale factors are referred to as: (d R, d G, d B, d A) The scale factors: (fR, fG, fB, fA) represent either source or destination factors. All scale factors have the range [0,1]. Parameter (fR, fG, fB, fA) GL_ZERO (0, 0, 0, 0 ) GL_ONE (1, 1, 1, 1 ) GL_SRC_COLOR (Rs/kR, Gs/kG, Bs/kB, As/kA) GL_ONE_MINUS_SRC_COLOR (1, 1, 1, 1 ) - (Rs/kR, Gs/kG, Bs/kB, As/kA) GL_DST_COLOR (Rd/kR, Gd/kG, Bd/kB, Ad/kA) GL_ONE_MINUS_DST_COLOR (1, 1, 1, 1 ) - (Rd/kR, Gd/kG, Bd/kB, Ad/kA) GL_SRC_ALPHA (As/kA, As/kA, As/kA, As/kA) GL_ONE_MINUS_SRC_ALPHA (1, 1, 1, 1 ) - (As/kA, As/kA, As/kA, As/kA) GL_DST_ALPHA (Ad/kA, Ad/kA, Ad/kA, Ad/kA) GL_ONE_MINUS_DST_ALPHA (1, 1, 1, 1 ) - (Ad/kA, Ad/kA, Ad/kA, Ad/kA) GL_CONSTANT_COLOR (Rc/kR, Gc/kG, Bc/kB, Ac/kA) GL_ONE_MINUS_CONSTANT_COLOR (1, 1, 1, 1 ) - (Rc/kR, Gc/kG, Bc/kB, Ac/kA) GL_CONSTANT_ALPHA (Ac/kA, Ac/kA, Ac/kA, Ac/kA) GL_ONE_MINUS_CONSTANT_ALPHA (1, 1, 1, 1 ) - (Ac/kA, Ac/kA, Ac/kA, Ac/kA) GL_SRC_ALPHA_SATURATE (i, i, i, 1) i = min (As, kA - Ad )/kA To determine the blended RGBA values of a pixel when drawing in RGB mode, the system uses the following equations: Rd Gd Bd Ad = = = = min min min min (kR, (kG, (kB, (kA, RssR GssG BssB AssA + + + + RddR) GddG) BddB) AddA) Blending combines corresponding source and destination color components according to the blending operation specified by GL_BLEND_EQUATION_EXT. The blending operations are: GL_BLEND_EQUATION_EXT Binary Operation GL_FUNC_ADD_EXT min(Cs x sC+Cd x dC,kC) 26 OpenGL 2.1 Reference Manual GL_BLEND_EQUATION_EXT Binary Operation GL_FUNC_SUBTRACT_EXT max(Cs x sC-Cd x dC,0) GL_FUNC_REVERSE_SUBTRACT_EXT max(Cd x dC-Cs x sC,0) GL_LOGIC_OP Cs Lop Cd GL_MIN_EXT min(Cs, Cd) GL_MAX_EXT max(Cs, Cd) where C is the relevant color component (R, G, B, or A), Cs and Cd are the source and destination color components, respectively, sC and sD are the source and destination scale factors, respectively, and Lop is one of 16 bitwise operators specified by glLogicOp. Despite the apparent precision of the preceding equations, blending arithmetic is not exactly specified, because blending operates with imprecise integer color values. However, a blend factor that should be equal to 1 is guaranteed not to modify its multiplicand, and a blend factor equal to 0 reduces its multiplicand to 0. Thus, for example, when SourceFactor is GL_SRC_ALPHA, DestinationFactor is GL_ONE_MINUS_SRC_ALPHA, and As is equal to kA, the equations reduce to simple replacement: Rd Gd Rd Ad = = = = Rs Gs Bs As Parameters SourceFactor DestinationFactor Specifies how the RGBA source-blending factors are computed. Thirteen symbolic constants are accepted: GL_ZERO, GL_ONE, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_CONSTANT_COLOR_EXT, GL_ONE_MINUS_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR_EXT, GL_CONSTANT_ALPHA, GL_CONSTANT_ALPHA_EXT, GL_ONE_MINUS_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA_EXT, and GL_SRC_ALPHA_SATURATE. These symbolic constants are defined in the Description section. The initial value is GL_ONE. Specifies how the RGBA destination-blending factors are computed. Twelve symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA , GL_ONE_MINUS_DST_ALPHA, GL_CONSTANT_COLOR, GL_CONSTANT_COLOR_EXT, GL_ONE_MINUS_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR_EXT, GL_CONSTANT_ALPHA, GL_CONSTANT_ALPHA_EXT, GL_ONE_MINUS_CONSTANT_ALPHA, and GL_ONE_MINUS_CONSTANT_ALPHA_EXT. These symbolic constants are defined in the Description section. The initial value is GL_ZERO. Notes Incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 (KA), representing complete opacity, to 0.0 (0), representing complete transparency. When more than one color buffer is enabled for drawing, blending is done separately for each enabled buffer, using for destination color the contents of that buffer. (See the glDrawBuffer subroutine.) Blending affects only RGB rendering. It is ignored by color index renderers. Chapter 1. OpenGL Subroutines 27 The Source and destination factors GL_CONSTANT_COLOR, GL_ONE_MINUS_CONSTANT_COLOR, GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA, and their _EXT versions are only valid if the ARB imaging subset is supported and/or the Blend Color extension. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Either SourceFactor or DestinationFactor is set to an unaccepted value. The glBlendFunc subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glBlendFunc subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_BLEND_SRC, GL_BLEND_DST, GL_LOGIC_OP_MODE, or GL_BLEND_EQUATION_EXT. glIsEnabled with argument GL_BLEND Examples Transparency is best implemented using a blend function (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) with primitives sorted from farthest to nearest. Note that this transparency calculation does not require the presence of alpha bit planes in the frame buffer. The blend function operation (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is also useful for rendering antialiased points and lines in arbitrary order. Polygon antialiasing is optimized using a blend function (GL_SRC_ALPHA_SATURATE, GL_ONE) with polygons sorted from nearest to farthest. (See the glEnable or glDisable subroutine and the GL_POLYGON_SMOOTH argument for information on polygon antialiasing.) Destination alpha bit planes, which must be present for this blend function to operate correctly, store the accumulated coverage. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glAlphaFunc subroutine, glBegin or glEnd subroutine, glClear subroutine, glDrawBuffer subroutine, glEnable or Disable ubroutine, glLogicOp subroutine, glStencilFunc subroutine. glBlendFuncSeparateEXT Subroutine Purpose Specifies separate RGB and Alpha blend factors. Library OpenGL C bindings library: (libGL.a) 28 OpenGL 2.1 Reference Manual C Syntax void glBlendFuncSeparateEXT(enum sfactorRGB, enum dfactorRGB, enum sfactorAlpha, enum dfactorAlpha) Description Blending capability is extended by this function. It allows independent specification of the RGB and alpha blend factors for blend operations that require source and destination blend factors. It is not always desired that the blending used for RGB is also applied to alpha. The accepted values for sfactorRGB and sfactorAlpha are: GL_ZERO GL_ONE GL_DST_COLOR GL_ONE_MINUS_DST_COLOR GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_DST_ALPHA GL_ONE_MINUS_DST_ALPHA GL_CONSTANT_COLOR (_EXT) GL_ONE_MINUS_CONSTANT_COLOR (_EXT) GL_CONSTANT_ALPHA (_EXT) GL_ONE_MINUS_CONSTANT_ALPHA (_EXT) GL_SRC_ALPHA_SATURATE The accepted values for sfactorRGB and sfactorAlpha are: GL_ZERO GL_ONE GL_SRC_COLOR GL_ONE_MINUS_SRC_COLOR GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_DST_ALPHA GL_ONE_MINUS_DST_ALPHA GL_CONSTANT_COLOR (_EXT) GL_ONE_MINUS_CONSTANT_COLOR (_EXT) GL_CONSTANT_ALPHA (_EXT) GL_ONE_MINUS_CONSTANT_ALPHA (_EXT) GL_SRC_ALPHA_SATURATE For further information on the mathematical function of each of these accepted values, see glBlendFunc. Chapter 1. OpenGL Subroutines 29 Parameters sfactorRGB sfactorAlpha dfactorRGB dfactorAlpha is is is is the the the the source blend factor for the RGB components. source blend factor for the Alpha component. destination blend factor for the RGB components. destination blend factor for the Alpha component. Notes This subroutine is only valid if the EXT_blend_func_separate extension is defined. GL_CONSTANT_COLOR (_EXT), GL_ONE_MINUS_CONTANT_COLOR (_EXT), GL_CONSTANT_ALPHA (_EXT), and GL_ONE_MINUS_CONSTANT_ALPHA (_EXT) are only valid if the GL_EXT_blend_color extension is defined. The (_EXT) at the end of these values above indicates that the enum can be specified with or without the _EXT suffix, and behaves identically in both cases. Error Codes GL_INVALID_ENUM is generated if any of sfactorRGB, dfactorRGB, sfactorAlpha, or dfactorAlpha are not accepted values. is generated if glBlendFuncSeparateEXT is executed between the execution of glBegin and the corresponding execution of glEnd. GL_INVALID_OPERATION Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBlendFunc sunbroutine. glCallList Subroutine Purpose Executes a display list. Library OpenGL C bindings library: libGL.a C Syntax void glCallList(GLuint List) Description The glCallList subroutine causes the named display list to be executed. The subroutines saved in the display list are executed in order, just as if they were called without using a display list. If List has not been defined as a display list, glCallList is ignored. 30 OpenGL 2.1 Reference Manual The glCallList subroutine may appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, an implementation-dependent limit is placed on the the nesting level of display lists during display list execution. This limit is at least 64. GL state is not saved and restored across a call to glCallList. Thus, changes made to GL state during the execution of a display list will remain after execution of the display list is completed. Use the glPushAttrib, glPopAttrib, PushMatrix, and glPopMatrix subroutines to preserve GL state across glCallList calls. Parameters List Specifies the integer name of the display list to be executed. Notes Display lists can be executed between a call to glBegin and the corresponding call to glEnd, as long as the display list includes only commands that are allowed in this interval. Associated Gets The associated get for the glCallList subroutine is as follows. (See the glGet subroutine for more information.) glGet with argument GL_MAX_LIST_NESTING glIsList. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallLists subroutine, glDeleteLists subroutine, glGenLists subroutine, glNewList subroutine, glPushAttrib or glPopAttrib subroutine, glPushMatrix or glPopMatrix subroutine. glCallLists Subroutine Purpose Executes a list of display lists. Library OpenGL C bindings library: libGL.a C Syntax void glCallLists(GLsizei Number, GLenum Type, const GLvoid * Lists) Chapter 1. OpenGL Subroutines 31 Description The glCallLists subroutine causes each display list in the list of names passed as lists to be executed. As a result, the commands saved in each display list are executed in order, just as if they were called without using a display list. Names of display lists that have not been defined are ignored. The glCallLists subroutine provides an efficient means for executing display lists. The Number parameter allows lists with various name formats to be accepted. The formats are: GL_BYTE GL_UNSIGNED_BYTE GL_SHORT GL_UNSIGNED_SHORT GL_INT GL_UNSIGNED_INT GL_FLOAT GL_2_BYTES GL_3_BYTES GL_4_BYTES Lists is treated as an array of signed bytes, each in the range -128 through 127. Lists is treated as an array of unsigned bytes, each in the range 0 through 255. Lists is treated as an array of signed 2-byte integers, each in the range -32,768 through 32,767. Lists is treated as an array of unsigned 2-byte integers, each in the range 0 through 65,535. Lists is treated as an array of signed 4-byte integers. Lists is treated as an array of unsigned 4-byte integers. Lists is treated as an array of 4-byte floating-point values. Lists is treated as an array of unsigned bytes. Each pair of bytes specifies a single display list name. The value of the pair is computed as 256 times the unsigned value of the first byte plus the unsigned value of the second byte. Lists is treated as an array of unsigned bytes. Each triplet of bytes specifies a single display list name. The value of the triplet is computed as 65,536 times the unsigned value of the first byte, plus 256 times the unsigned value of the second byte, plus the unsigned value of the third byte. Lists is treated as an array of unsigned bytes. Each quadruplet of bytes specifies a single display list name. The value of the quadruplet is computed as 16,777,216 times the unsigned value of the first byte, plus 65,536 times the unsigned value of the second byte, plus 256 times the unsigned value of the third byte, plus the unsigned value of the fourth byte. The list of display list names is not null-terminated. Rather, the Number parameter specifies how many names are to be taken from Lists. An additional level of indirection is made available with the glListBase subroutine, which specifies a signed offset that is added to each display list name specified in Lists before that display list is executed. The glCallLists subroutine can appear inside a display list. To avoid the possibility of infinite recursion resulting from display lists calling one another, an implementation-dependent limit is placed on the the nesting level of display lists during display list execution. This limit must be at least 64. GL state is not saved and restored across a call to glCallLists. Thus, changes made to GL state during the execution of the display lists remain after execution is completed. Use the glPushAttrib, glPopAttrib, glPushMatrix, and glPopMatrix subroutines to preserve GL state across glCallLists calls. Parameters Number Type Lists 32 Specifies the number of display lists to be executed. Specifies the type of values in lists. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, GL_2_BYTES, GL_3_BYTES, and GL_4_BYTES are accepted. Specifies the address of an array of name offsets in the display list. The pointer type is void because the offsets can be bytes, shorts, ints, or floats, depending on the value of Type. OpenGL 2.1 Reference Manual Notes Display lists can be executed between a call to glBegin and the corresponding call to glEnd, as long as the display list includes only commands that are allowed in this interval. Associated Gets Associated gets for the glCallLists subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_LIST_BASE glGet with argument GL_MAX_LIST_NESTING glIsList. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallList subroutine, glDeleteLists subroutine, glGenLists subroutine, glListBase subroutine, glNewList subroutine, glPushAttrib or glPopAttrib subroutine, glPushMatrix or glPopMatrix subroutine. glClear Subroutine Purpose Clears buffers to preset values. Library OpenGL C bindings library: libGL.a C Syntax void glClear(GLbitfield Mask) Description The glClear subroutine sets the bit plane area of the viewport to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil and glClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using glDrawBuffer. The pixel ownership test, the scissor test, dithering and the buffer writemasks affect the operation of glClear. The scissor box bounds the cleared region. Alpha function, blend function, logical operation, stenciling, texture mapping, and z-buffering are ignored by glClear. The glClear subroutine takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared. The values are: GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT Indicates the buffers currently enabled for color writing. Indicates the depth buffer. Chapter 1. OpenGL Subroutines 33 GL_ACCUM_BUFFER_BIT GL_STENCIL_BUFFER_BIT Indicates the accumulation buffer. Indicates the stencil buffer. The value to which each buffer is cleared depends on the setting of the clear value for that buffer. glGet with argument GL_COLOR_CLEAR_VALUE glGet with argument GL_STENCIL_CLEAR_VALUE. Parameters Mask Bitwise OR of masks that indicate the buffers to be cleared. The four masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT. Notes If a buffer is not present, then a glClear directed at that buffer has no effect. Errors GL_INVALID_VALUE GL_INVALID_OPERATION A bit other than the four defined bits is set in Mask. The glClear subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glClear subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_ACCUM_CLEAR_VALUE glGet with argument GL_DEPTH_CLEAR_VALUE glGet with argument GL_INDEX_CLEAR_VALUE Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glClearAccum subroutine, glClearColor subroutine, glClearDepth subroutine, glClearIndex subroutine, glClearStencil subroutine, glDrawBuffer subroutine, glScissor subroutine. glClearAccum Subroutine Purpose Specifies clear values for the accumulation buffer. Library OpenGL C bindings library: libGL.a 34 OpenGL 2.1 Reference Manual C Syntax void glClearAccum(GLfloat GLfloat Green, GLfloat Blue, GLfloat Alpha) Red, Description The glClearAccum subroutine specifies the red, green, blue, and alpha values used by the glClear subroutine to clear the accumulation buffer. Values specified by glClearAccum are clamped to the range [-1,1]. Parameters Red Green Blue Alpha Specifies Specifies Specifies Specifies the the the the red value used when the accumulation buffer is cleared. The default value is 0 (zero). green value used when the accumulation buffer is cleared. The default value is 0. blue value used when the accumulation buffer is cleared. The default value is 0. alpha value used when the accumulation buffer is cleared. The default value is 0. Errors GL_INVALID_OPERATION The glClearAccum subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glClearAccum subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_ACCUM_CLEAR_VALUE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glClear subroutine. glClearColor Subroutine Purpose Specifies clear values for the color buffers. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 35 C Syntax void glClearColor(GLclampf GLclampf Green, GLclampf Blue, GLclampf Alpha) Red, Description The glClearColor subroutine specifies the red, green, blue, and alpha values used by the glClear subroutine to clear the color buffers. Values specified by glClearColor are clamped to the range [0,1]. Parameters Red Green Blue Alpha Specifies Specifies Specifies Specifies the the the the red value used when the color buffer is cleared. The default value is 0 (zero). green value used when the color buffer is cleared. The default value is 0. blue value used when the color buffer is cleared. The default value is 0. alpha value used when the color buffer is cleared. The default value is 0. Errors GL_INVALID_OPERATION The glClearColor subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glClearColor subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_COLOR_CLEAR_VALUE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glClear subroutine. glClearDepth Subroutine Purpose Specifies the clear value for the depth buffer. Library OpenGL C bindings library: libGL.a C Syntax void glClearDepth(GLclampd 36 OpenGL 2.1 Reference Manual Depth) Description The glClearDepth subroutine specifies the depth value used by the glClear subroutine to clear the depth buffer. Values specified by glClearDepth are clamped to the range [0,1]. Parameters Depth Specifies the depth value used when the depth buffer is cleared. The default value is 0 (zero). Errors GL_INVALID_OPERATION The glClearDepth subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glClearDepth subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_DEPTH_CLEAR_VALUE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glClear subroutine. glClearIndex Subroutine Purpose Specifies the clear value for the color index buffers. Library OpenGL C bindings library: libGL.a C Syntax void glClearIndex(GLfloat Clear) Description The glClearIndex subroutine specifies the index used by glClear to clear the color index buffers. The Clear parameter is not clamped. Rather, Clear is converted to a fixed-point value with unspecified precision to the right of the binary point. The integer part of this value is then masked with 2m -1, where m is the number of bits in a color index stored in the frame buffer. Parameters Clear Specifies the index used when the color index buffers are cleared. The default value is 0 (zero). Chapter 1. OpenGL Subroutines 37 Errors GL_INVALID_OPERATION The glClearIndex subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glClearIndex subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_INDEX_CLEAR_VALUE glGet with argument GL_INDEX_BITS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glClear subroutine. glClearStencil Subroutine Purpose Specifies the clear value for the stencil buffer. Library OpenGL C bindings library: libGL.a C Syntax void glClearStencil(GLint Stencil) Description The glClearStencil subroutine specifies the index used by glClear to clear the stencil buffer. The Stencil parameter is masked with 2m - 1, where m is the number of bits in the stencil buffer. Parameters Stencil Specifies the index used when the stencil buffer is cleared. The default value is 0 (zero). Errors GL_INVALID_OPERATION Indicates that glClearStencil is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glClearStencil subroutine are as follows. (See the glGet subroutine for more information.) 38 OpenGL 2.1 Reference Manual glGet with argument GL_STENCIL_CLEAR_VALUE glGet with argument GL_STENCIL_BITS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glClear subroutine. glClientActiveTextureARB Subroutine Purpose Specify which texture unit is active. Library OpenGL C bindings library: (libGL.a) C Syntax void glClientActiveTextureARB(GLenum texture) Description glClientActiveTextureARB selects which texture unit’s client state parameters will be modified by glTexCoordPointer, and enabled or disabled with glEnableClientState or glDisableClientState, respectively, when called with a parameter of GL_TEXTURE_COORD_ARRAY. The number of texture units an implementation supports is implementation dependent, but must be at least two. The texture parameter must be one of GL_TEXTUREi_ARB, where 0 <= i < GL_MAX_TEXTURE_UNITS_ARB. The initial value is GL_TEXTURE0_ARB. Parameters texture specifies which texture unit to make active. Notes If the GL_ARB_multitexture extension is NOT present, then the number of texture units supported by the implementation is one, not two, as described above. The following OpenGL subroutines will be routed to different texture units based on this call: v glEnableClientState (GL_TEXTURE_COORD_ARRAY) v glDisableClientState (GL_TEXTURE_COORD_ARRAY) v glInterleavedArrays v glTexCoordPointer v glTexCoordPointerEXT v glTexCoordPointerListIBM Subroutine glClientActiveTextureARB is supported only if GL_ARB_multitexture is included in the string returned by glGetString when called with the argument GL_EXTENSIONS. Chapter 1. OpenGL Subroutines 39 Error Codes GL_INVALID_OPERATION is generated if texture is not one of the accepted values. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glActiveTextureARB subroutine, the glEnableClientState or glDisableClientState subroutine, the glMultiTexCoordARB subroutine, the glTexCoordPointer subroutine. glClipBoundingBoxIBM or glClipBoundingSphereIBM or glClipBoundingVerticesIBM Subroutine Purpose Determine whether the specified object is trivially accepted, trivially rejected, or clipped by the current set of clipping planes. Library OpenGL C bindings library: (libGL.a) C Syntax GLenum glClipBoundingBoxIBM (GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat xmin, ymin, zmin, xmax, ymax, zmax) GLenum glClipBoundingSphereIBM (GLfloat GLfloat GLfloat GLfloat x, y, z, radius) GLenum glClipBoundingVerticesIBM (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *data) Description These three new functions can be used by applications to determine if a complex object is fully outside, inside, or both outside and inside the clip volume (ie, view volume plus any enabled clipping planes). The complex object is generally defined by a simplified representation of the object. This extension provides for 3 different simplified object variants - a bounding box, a bounding sphere, and a set of bounding vertices. These functions can not be inserted within a display list. If called while a display list is open, they are executed immediately. 40 OpenGL 2.1 Reference Manual An enable is also provided so that applications can directly update the clip volume hint without having to make a separate OpenGL function call. See GL_UPDATE_CLIP_VOLUME_HINT under glEnable. All functions return the results of the clip check. These results include: GL_REJECT_IBM GL_ACCEPT_IBM GL_CLIP_IBM Indicates that the bounding object is trivially rejected. Rendering the object will result in nothing being rendered. Indicates that the bounding object is trivially accepted. Rendering the object should be entirely within the viewport and can be rendering without clipping. Indicates that the bounding object is not trivially accepted or rejected. Implementations that don’t support clip checking for all rendering enviroments can return CLIP_IBM for those unsupported environments. Parameters xmin,ymin,zmin xmax,ymax,zmax x,y,z radius size type stride count data Specifies the minimum x,y and z modeling coordinates of the bounding box. Specifies the maximum x,y and z modeling coordinates of the bounding box. Specifies the center of the bounding sphere in modeling coordinates. Specifies the radius of the bounding sphere in modeling coordinates. Specifies the number of coordinate components per vertex; must be 2, 3 or 4. Specifies the data type for the data parameter. Symbolic constants GL_SHORT, GL_INT, GL_FLOAT, and GL_DOUBLE are accepted. Specifies the byte offset between consecutive vertexes. If stride is 0, the vertices are understood to be tightly packed in the array. Specifies the number of vertices pointed to by the data parameter. Specifies a pointer to the first coordinate of the vertex list. Notes These three functions are only available if the GL_IBM_clip_check extension is present. Error Codes GL_INVALID_value GL_INVALID_ENUM GL_INVALID_value is generated if size is not 2, 3, or 4. is generated if type is not one of the acceptable values. is generated if count is negative. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Chapter 1. OpenGL Subroutines 41 glClipPlane Subroutine Purpose Specifies a plane against which all geometry is clipped. Library OpenGL C bindings library: libGL.a C Syntax void glClipPlane(GLenum Plane, const GLdouble * Equation) By default, all clipping planes are defined as (0,0,0,0) in eye coordinates and are disabled. Parameters Plane Equation Specifies which clipping plane is being positioned. Symbolic names of the form GL_CLIP_PLANEi, where i is an integer between 0 and GL_MAX_CLIP_PLANES-1, are accepted. Specifies the address of an array of four double-precision floating-point values. These values are interpreted as a plane equation. Description Geometry is always clipped against the boundaries of a six-plane frustum in x, y, and z. The glClipPlane subroutine allows the specification of additional planes, not necessarily perpendicular to the x, y, or z axes, against which all geometry is clipped. Up to GL_MAX_CLIP_PLANES planes can be specified, where GL_MAX_CLIP_PLANES is at least 6 in all implementations. Because the resulting clipping region is the intersection of the defined half-spaces, it is always convex. The glClipPlane subroutine specifies a half-space using a four-component plane equation. When glClipPlane is called, Equation is transformed by the inverse of the modelview matrix and stored in the resulting eye coordinates. Subsequent changes to the modelview matrix have no effect on the stored plane equation components. If the dot product of the eye coordinates of a vertex with the stored plane equation components is positive or 0 (zero), the vertex is in with respect to that clipping plane. Otherwise it is out. Clipping planes are enabled and disabled with glEnable and glDisable, called with the argument GL_CLIP_PLANEi, where i is the plane number. Notes It is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Plane is set to an unaccepted value. The glClipPlane subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glClipPlane subroutine are as follows. (See the glGet subroutine for more information.) 42 OpenGL 2.1 Reference Manual glGetClipPlane glIsEnabled Enabled with argument GL_CLIP_PLANEi. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL Related Information The glBegin or glEnd subroutine, glEnable or glDisable subroutine. glColor Subroutine Purpose Sets the current color. Library OpenGL C bindings library: libGL.a C Syntax glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us, glColor4b, glColor4d, glColor4f, glColor4i,glColor4s, glColor4ub, glColor4ui, glColor4us, glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv, glColor4uiv, glColor4usv -set the current color void glColor3b void glColor3b(GLbyte GLbyte Green, GLbyte Blue) Red, void glColor3d(GLdouble GLdouble Green, GLdouble Blue) void glColor3f(GLfloat GLfloat Green, GLfloat Blue) void glColor3i(GLint GLint Green, GLint Blue) void glColor3s(GLshort GLshort Green, GLshort Blue) Red, Red, Red, Red, Chapter 1. OpenGL Subroutines 43 void glColor3ub(GLubyte GLubyte Green, GLubyte Blue) Red, void glColor3ui(GLuint GLuint Green, GLuint Blue) Red, void glColor3us(GLshort GLshort Green, GLshort Blue) void glColor4b(GLbyte GLbyte Green, GLbyte Blue, GLbyte Alpha) Red, Red, void glColor4d(GLdouble GLdouble Green, GLdouble Blue, GLdouble Alpha) void glColor4f(GLfloat GLfloat Green, GLfloat Blue, GLfloat Alpha) void glColor4i(GLint GLint Green, GLint Blue, GLint Alpha) Red, Red, Red, void glColor4s(GLshort GLshort Green, GLshort Blue, GLshort Alpha) Red, void glColor4ub(GLubyte GLubyte Green, GLubyte Blue, GLubyte Alpha) Red, void glColor4ui (GLuint GLuint Green, GLuint Blue, GLuint Alpha) Red, void glColor4us(GLshort GLshort Green, GLshort Blue, GLshort Alpha) Red, void glColor3bv(const GLbyte * Variable) void glColor3dv(const GLdouble * Variable) 44 OpenGL 2.1 Reference Manual void glColor3fv(const GLfloat * Variable) void glColor3iv(const GLint * Variable) void glColor3sv(const GLshort * Variable) void glColor3ubv(const GLubyte * Variable) void glColor3uiv(const GLuint * Variable) void glColor3usv(const GLushort * Variable) void glColor4bv(const GLbyte * Variable) void glColor4dv(const GLdouble * Variable) void glColor4fv(const GLfloat * Variable) void glColor4iv(const GLint * Variable) void glColor4sv(const GLshort * Variable) void glColor4ubv(const GLubyte * Variable) void glColor4uiv(const GLuint * Variable) void glColorusv(const GLushort * Variable) Description The Graphics Library stores both a current single-valued color index and a current four-valued red, green, blue, alpha (RGBA) color. The glColor subroutine sets a new four-valued RGBA color. The glColor subroutine has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green, and blue values explicitly, and set the current alpha value to 1.0 implicitly. glColor4 variants specify all four color components explicitly. glColor3b, glColor4b, glColor3s, glColor4s, glColor3i, and glColor4i take 3 or 4 unsigned byte, short, or long integers as arguments. When v is appended to the name, the color subroutines can take a pointer to an array of such values. Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and 0 (zero) maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither floating-point nor signed integer specified values are clamped to the range [0,1] before updating the current color. However, color components are clamped to this range before they are interpolated or written into a color buffer. Parameters Red Green Blue Specifies a red value for the current color. The initial value is 1 (one). Specifies a green value for the current color. The initial value is 1 (one). Specifies a blue value for the current color. The initial value is 1 (one). Chapter 1. OpenGL Subroutines 45 Alpha Variable Specifies a new alpha value for the current color. Included only in the four-argument glColor subroutine. The initial value is 1 (one). Specifies a pointer to an array that contains red, green, blue, and (sometimes) alpha values. Notes The current color can be updated at any time. In particular, glColor can be called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glColor subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_CURRENT_COLOR. glGet with argument GL_RGBA_MODE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin subroutine, glColorPointer subroutine, glColorPointerEXT subroutine, glEnd subroutine, glIndex subroutine. glColorMask Subroutine Purpose Enables and disables the writing of frame buffer color components. Library OpenGL C bindings library: libGL.a C Syntax void glColorMask(GLboolean GLboolean Green, GLboolean Blue, GLboolean Alpha) Red, Description The glColorMask subroutine specifies whether the individual color components in the frame buffer can or cannot be written. If the Red parameter is GL_FALSE, for example, no change is made to the red component of any pixel in any of the color buffers, regardless of the drawing operation attempted. Changes to individual bits of components cannot be controlled. Rather, changes are either enabled or disabled for entire color components. 46 OpenGL 2.1 Reference Manual Parameters Red Green Blue Alpha Specifies whether red can or cannot be written into the frame buffer. The default value is True, indicating that the red color component can be written. Specifies whether green can or cannot be written into the frame buffer. The default value is True, indicating that the green color component can be written. Specifies whether blue can or cannot be written into the frame buffer. The default value is True, indicating that the blue color component can be written. Specifies whether alpha can or cannot be written into the frame buffer. The default value is True, indicating that the alpha color component can be written. Errors GL_INVALID_OPERATION The glColorMask subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glColorMask subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_COLOR_WRITEMASK glGet with argument GL_RGBA_MODE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColor subroutine, glDepthMask subroutine, glIndex subroutine, glIndexMask subroutine, glStencilMask subroutine. glColorMaterial Subroutine Purpose Causes a material color to track the current color. Library OpenGL C bindings library: libGL.a C Syntax void glColorMaterial(GLenum GLenum mode) face, Description The glColorMaterial subroutine specifies which material parameters track the current color. When GL_COLOR_MATERIAL is enabled, the material parameter or parameters specified by mode, of the Chapter 1. OpenGL Subroutines 47 material or materials specified by face, track the current color at all times. GL_COLOR_MATERIAL is enabled and disabled using the subroutines glEnable and glDisable, called with GL_COLOR_MATERIAL as their argument. By default it is disabled. Parameters face Specifies whether front, back, or both front and back material parameters should track the current color. Accepted values are GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK. The default value is GL_FRONT_AND_BACK. Specifies which of several material parameters will track the current color. Accepted values are GL_EMISSION, GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, and GL_AMBIENT_AND_DIFFUSE. The default value is GL_AMBIENT_AND_DIFFUSE. mode Notes The glColorMaterial subroutine allows a subset of material parameters to be changed for each vertex using only the glColor subroutine, without calling glMaterial. If only such a subset of parameters is to be specified for each vertex, the use of the glColorMaterial subroutine is preferred over calling glMaterial. Calling glDrawElements may leave the current color indeterminate. If glColorMaterial is enabled while the current color is indeterminate, the lighting material state specified by face and mode is also indeterminate. Errors GL_INVALID_ENUM GL_INVALID_OPERATION face or mode is set to an unaccepted value. The glColorMaterial subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glColorMaterial subroutine are as follows. (See the glGet subroutine for more information.) glIsEnabled with argument GL_COLOR_MATERIAL glGet with argument GL_COLOR_MATERIAL_PARAMETER glGet with argument GL_COLOR_MATERIAL_FACE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColor subroutine, glEnable or glDisable subroutine, glLight subroutine, glLightModel subroutine, glMaterial subroutine. glColorNormalVertexSUN Subroutine Purpose Specifies a color, a normal and a vertex in one call. 48 OpenGL 2.1 Reference Manual Library OpenGL C bindings library: (libGL.a) C Syntax void glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) void glColor4fNormal3fVertex3fvSUN (const GLfloat const GLfloat const GLfloat *c, *n, *v) Description This subroutine can be used as a replacement for the following calls: glColor(); glNormal(); glVertex(); For example, glColor4fNormal3fVertex3fvSUN replaces the following calls: glColor4f(); glNormal3f(); glVertex3fv(); The only reason for using this call is that it reduces the use of bus bandwidth. Parameters r, g, b, a c nx, ny, nz n x, y, z v specifies r, g, b, and a components of the color for this vertex. specifies a pointer to an array of the four components r, g, b, and a. specifies x, y, and z coordinates of the normal vector for this vertex. specifies a pointer to an array of the three elements nx, ny and nz. specifies the x, y, and z coordinates of a vertex. Not all parameters are present in all forms of the command. specifies a pointer to an array of the three elements x, y, and z. Notes Calling glColorNormalVertexSUN outside of a glBegin/glEnd subroutine pair results in undefined behavior. This subroutine is only valid if the GL_SUN_vertex extension is defined. Chapter 1. OpenGL Subroutines 49 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, the glColor subroutine, the glNormal subroutine, the glTexCoord subroutine, the glVertex subroutine. glColorPointer Subroutine Purpose Defines an array of colors. Library OpenGL C bindings library: libGL.a C Syntax void glColorPointer( GLint GLenum type, GLsizei stride, const GLvoid * pointer) size, Description The glColorPointer subroutine specifies the location and data format of an array of color components to use when rendering. The size parameter specifies the number of components per color, and must be 3 or 4. The type parameter specifies the data type of each color component and stride gives the byte stride from one color to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). When a color array is specified, size, type, stride, and pointer are saved as client side state. To enable and disable the color array, call glEnableClientState and glDisableClientState with the argument GL_COLOR_ARRAY. If enabled, the color array is used when glDrawArrays, glDrawElements or glArrayElement is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Color array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters size 50 Specifies the number of components per color. It must be 3 or 4. The initial value is 4. OpenGL 2.1 Reference Manual type stride pointer Specifies the data type of each color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. Specifies the byte offset between consecutive colors. If stride is zero (the initial value), the colors are understood to be tightly packed in the array. The initial value is 0. Specifies a pointer to the first component of the first color element in the array. The initial value is 0 (NULL pointer). Notes The glColorPointer subroutine is available only if the GL version is 1.1 or greater. The color array is initially disabled and it won’t be accessed when glArrayElement, glDrawElements, or glDrawArrays is called. Execution of glColorPointer is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glColorPointer subroutine is typically implemented on the client side with no protocol. Since the color array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. The glColorPointer commands are not included in display lists. Error Codes GL_INVALID_VALUE is generated if size is not 3 or 4. GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride is negative. Associated Gets glIsEnabled with argument GL_COLOR_ARRAY. glGet with argument GL_COLOR_ARRAY_SIZE. glGet with argument GL_COLOR_ARRAY_TYPE. glGet with argument GL_COLOR_ARRAY_STRIDE. glGetPointerv with argument GL_COLOR_ARRAY_POINTER. Related Information The glArrayElement subroutine, glColorPointerListIBM subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. Chapter 1. OpenGL Subroutines 51 glColorPointerEXT Subroutine Purpose Defines an array of colors. Library OpenGL and OpenGL C bindings library: libGL.a C Syntax void glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer) Description The glColorPointerEXT subroutine specifies the location and data format of an array of color components to use when rendering. size specifies the number of components per color, and must be 3 or 4. The type parameter specifies the data type of each color component and stride gives the byte stride from one color to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations). The count parameter indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a color array is specified, size, type, stride, count and pointer are saved as client-side state, and static array elements may be cached by the implementation. The color array is enabled and disabled using glEnable and glDisable with the argument GL_COLOR_ARRAY_EXT. If enabled, the color array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Color array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters size Specifies the number of components per color. It must be 3 or 4. Specifies the data type of each color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE_EXT, are accepted. Specifies the byte offset between consecutive colors. If stride is zero the colors are understood to be tightly packed in the array. Specifies the number of colors, counting from the first, that are static. type stride count 52 OpenGL 2.1 Reference Manual pointer Specifies a pointer to the first component of the first color element in the array. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the color array is disabled and it won’t be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although, it is not an error to call glColorPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glColorPointerEXT will typically be implemented on the client side with no protocol. Since the color array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glColorPointerEXT commands are not entered into display lists. glColorPointerEXT is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. Errors GL_INVALID_VALUE is generated if size is not 3 or 4. GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative. Associated Gets glIsEnabled with argument GL_COLOR_ARRAY_EXT. glGet with argument GL_COLOR_ARRAY_SIZE_EXT. glGet with argument GL_COLOR_ARRAY_TYPE_EXT. glGet with argument GL_COLOR_ARRAY_STRIDE_EXT. glGet with argument GL_COLOR_ARRAY_COUNT_EXT. glGetPointervEXT with argument GL_COLOR_ARRAY_POINTER_EXT. File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElement subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glGetPointervEXT subroutine, glIndexPointerEXT subroutine, glNormalPointerEXT subroutine, glTexCoordPointerEXT subroutine, glVertexPointerEXT subroutine. Chapter 1. OpenGL Subroutines 53 glColorPointerListIBM Subroutine Purpose Defines a list of color arrays. Library OpenGL C bindings library: libGL.a C Syntax void glColorPointerListIBM ( GLint GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) size, Description The glColorPointerListIBM subroutine specifies the location and data format of a list of arrays of color components to use when rendering. The size parameter specifies the number of components per color, and must be 3 or 4. The type parameter specifies the data type of each color component. The stride parameter gives the byte stride from one color to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). The ptrstride parameter specifies the byte stride from one pointer to the next in the pointer array. When a color array is specified, size, type, stride, pointer and ptrstride are saved as client side state. A stride value of 0 does not specify a ″tightly packed″ array as it does in glColorPointer. Instead, it causes the first array element of each array to be used for each vertex. Also, a negative value can be used for stride, which allows the user to move through each array in reverse order. To enable and disable the color arrays, call glEnableClientState and glDisableClientState with the argument GL_COLOR_ARRAY. The color array is initially disabled. When enabled, the color arrays are used when glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glDrawArrays, glDrawElements or glArrayElement is called. The last three calls in this list will only use the first array (the one pointed at by pointer[0]). See the descriptions of these routines for more information on their use. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Color array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters size type 54 Specifies the number of components per color. It must be 3 or 4. The initial value is 4. Specifies the data type of each color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. OpenGL 2.1 Reference Manual stride pointer ptrstride Specifies the byte offset between consecutive colors. The initial value is 0. Specifies a list of color arrays. The initial value is 0 (NULL pointer). Specifies the byte stride between successive pointers in the pointer array. The initial value is 0. Notes The glColorPointerListIBM subroutine is available only if the GL_IBM_vertex_array_lists extension is supported. Execution of glColorPointerListIBM is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glColorPointerListIBM subroutine is typically implemented on the client side. Since the color array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When a glColorPointerListIBM call is encountered while compiling a display list, the information it contains does NOT contribute to the display list, but is used to update the immediate context instead. The glColorPointer call and the glColorPointerListIBM call share the same state variables. A glColorPointer call will reset the color list state to indicate that there is only one color list, so that any and all lists specified by a previous glColorPointerListIBM call will be lost, not just the first list that it specified. Error Codes GL_INVALID_VALUE is generated if size is not 3 or 4. GL_INVALID_ENUM is generated if type is not an accepted value. Associated Gets glIsEnabled with argument GL_COLOR_ARRAY. glGetPointerv with argument GL_COLOR_ARRAY_LIST_IBM. glGet with argument GL_COLOR_ARRAY_LIST_STRIDE_IBM. glGet with argument GL_COLOR_ARRAY_SIZE. glGet with argument GL_COLOR_ARRAY_STRIDE. glGet with argument GL_COLOR_ARRAY_TYPE. Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glMultiDrawArraysEXT subroutine, glMultiDrawElementsEXT subroutine, glMultiModeDrawArraysIBM subroutine, glMultiModeDrawElementsIBM subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. Chapter 1. OpenGL Subroutines 55 glColorSubTable Subroutine Purpose Define a contiguous subset of a color lookup table. Library OpenGL C bindings library: (libGL.a) C Syntax void glColorTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) void glColorTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data) Description glColorSubTable is used to respecify a contiguous portion of a color table previously defined using glColorTable. The pixels reference by data replace the portion of the existing table from indices start to start + count - 1, inclusive. This region may not include any entries outside the range of the color table as it was originally specified. It is not an error to specify a subtable with width of 0, but such a specification has no effect. Parameters target start count format type data must be GL_TEXTURE_COLOR_TABLE_EXT. is the starting index of the portion of the color table to be replaced. is the number of table entries to replace. is the format of the pixel data in data. The allowable values are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_BGR, GL_RGBA and GL_BGRA. is the type of the pixel data in table. The allowable values are GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV. is a pointer to a one-dimensional array of pixel data that is processed to replace the specified region of the color table. Notes GL_TEXTURE_COLOR_TABLE_SGI is an alias for GL_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. GL_PROXY_TEXTURE_COLOR_TABLE_SGI is an alias for GL_PROXY_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. 56 OpenGL 2.1 Reference Manual Error Codes GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_ENUM GL_INVALID_ENUM GL_INVALID_OPERATION is generated if target is not one of the allowable values. is generated if start + count > width, where width is the width of the previously defined color table. is generated if format is not one of the allowable values. is generated if type is not one of the allowable values. is generated if glColorSubTable is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets Associated gets for the glColorSubTable subroutine are as follows. (See the glGet subroutine for more information.) glGet with arguement glGetColorTableParameter. glGet with arguement glGetColorTable. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glColorTable subroutine, the glColorTableParameter subroutine, the glCopyColorTable subroutine, the glCopyColorSubTable subroutine, the glGetColorTable subroutine. glColorTable Subroutine Purpose Define a color lookup table. Library OpenGL C bindings library: (libGL.a) C Syntax void glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) void glColorTableSGI(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table) Chapter 1. OpenGL Subroutines 57 Description glColorTable may be used in two ways: to test the actual size and color resolution of a lookup table given a particular set of parameters, or to load the contents of a color lookup table. Use the targets GL_PROXY_* for the first case and the other targets for the second case. If target is GL_TEXTURE_COLOR_TABLE_EXT, glColorTable builds a color lookup table from an array of pixels. The pixel array specified by width, format, type, and table is extracted from memory and processed just as if glDrawPixels were called, but processing stops after the final expansion to RGBA is completed. The four scale parameters and the four bias parameters that are defined for the table are then used to scale and bias the R, G, B, and A components of each pixel. (Use glColorTableParameter to set these scale and bias parameters). Next, the R, G, B, and A values are clamped to the range [0, 1]. Each pixel is then converted to the internal format specified by internalformat. This conversion simply maps the component values of the pixel (R, G, B, and A) to the values included in the internal format (red, green, blue, alpha, and intensity). The mapping is as follows: Internal Format Red Green GL_ALPHA GL_LUMINANCE GL_LUMINANCE_ALPHA GL_INTENSITY GL_RGB R GL_RGBA R Blue Alpha A A G G B B Luminance R R Intensity R A Finally, the red, green, blue, alpha, luminance, and/or intensity components of the resulting pixels are stored in the color table. They form a one-dimensional table with indices in the range [0, width-1]. If target is GL_PROXY_TEXTURE_COLOR_TABLE_EXT, glColorTable recomputes and stores the values of the proxy color table’s state variables GL_COLOR_TABLE_FORMAT, GL_COLOR_TABLE_WIDTH, GL_COLOR_TABLE_RED_SIZE, GL_COLOR_TABLE_GREEN_SIZE, GL_COLOR_TABLE_BLUE_SIZE, GL_COLOR_TABLE_ALPHA_SIZE, GL_COLOR_TABLE_LUMINANCE_SIZE, and GL_COLOR_TABLE_INTENSITY_SIZE. There is no effect on the image or state of any actual color table. If the specified color table is too large to be supported, then all the proxy state variables listed above are set to zero. Otherwise, the color table could be supported by glColorTable using the corresponding non-proxy target, and the proxy state variable are set as if that target were being defined. The proxy state variables can be retrieved by calling glGetColorTableParameter with a target of GL_PROXY_*. This allows the application to decide what the resulting color table attributes would be. If a color table is enabled, and its width is non-zero, then its contents are used to replace a subset of the components of each RGBA pixel group, based on the internal format of the table. Each pixel group has color components (R, G, B, A) that are in the range [0.0, 1.0]. The color components are rescaled to the size of the color lookup table to form an index. Then a subset of the components based on the internal format of the table are replaced by the table entry specified by that index. If the color components and contents of the table are represented as follows: Representation r g b a L[i] 58 Meaning Table index computed from R Table index computed from G Table index computed from B Table index computed from A Luminance value at table index i OpenGL 2.1 Reference Manual I[i] R[i] G[i] B[i] A[i] Intensity value at table index i Red value at table index i Green value at table index i Blue value at table index i Alpha value at table index i then the result of color table lookup is as follows: Table Internal Format Resulting Color Components R G B A GL_ALPHA GL_LUMINANCE GL_LUMINANCE_ALPHA GL_INTENSITY GL_RGB GL_RGBA R L[r] L[r] I[r] R[r] R[r] G L[g] L[g] I[g] G[g] G[g] B L[b] L[b] I[b] B[b] B[b] A[a] A A[a] I[a] A A[a] Parameters target internalformat width format must be GL_TEXTURE_COLOR_TABLE_EXT or GL_PROXY_TEXTURE_COLOR_TABLE_EXT. is the internal format of the color table. The allowable values are GL_ABGR_EXT, GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGB8, GL_RGB10_A2, GL_RGBA12, and GL_RGB16. is the number of entries in the color lookup table specified by table. is the format of the pixel data in table. The allowable values are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, and GL_422_REV_AVERAGE_EXT. Chapter 1. OpenGL Subroutines 59 type is the type of the pixel data in table. The allowable values are GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV. is pointer to a one-dimensional array of pixel data that is processed to build the color table. table Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. GL_TEXTURE_COLOR_TABLE_SGI is an alias for GL_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. GL_PROXY_TEXTURE_COLOR_TABLE_SGI is an alias for GL_PROXY_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. Error Codes GL_INVALID_ENUM GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_VALUE GL_INVALID_ENUM GL_INVALID_ENUM GL_TABLE_TOO_LARGE GL_INVALID_OPERATION is generated if target is not one of the allowable values. is generated if internalformat is not one of the allowable values. is generated if width is less than zero. is generated if target is set to GL_TEXTURE_COLOR_TABLE_EXT and width is not a power of two. is generated if format is not one of the allowable values. is generated if type is not one of the allowable values. is generated if the requested color table is too large to be supported by the implementation, and target is not a GL_PROXY_* target. is generated if glColorTable is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets Associated gets for the glColorTable subroutine are as follows. (See the glGet subroutine for more information.) glGet with arguement glGetColorTableParameter. glGet with arguement glGetColorTable. 60 OpenGL 2.1 Reference Manual Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glColorSubTable subroutine, the glColorTableParameter subroutine, the glCopyColorTable subroutine, the glCopyColorSubTable subroutine, the glGetColorTable subroutine. glColorTableParameter Subroutine Purpose Specify attributes to be used when loading a color table. Library OpenGL C bindings library: (libGL.a) C Syntax void glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) void glColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) void glColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat *params) void glColorTableParameterivSGI(GLenum target, GLenum pname, const GLint *params) Description glColorTableParameter is used to specify the scale factors and bias terms applied to color components when they are loaded into a color table. target indicates which color table the scale or bias terms apply to. If pname is set to GL_COLOR_TABLE_SCALE, then the four values pointed to by params will be stored as the red, green, blue and alpha scale factors, in that order. If pname is set to GL_COLOR_TABLE_BIAS, then the four values pointed to by params will be stored as the red, green, blue and alpha bias terms, in that order. Parameters target pname is the target color table and must be GL_TEXTURE_COLOR_TABLE_EXT. is the symbolic name of a texture color lookup table parameter. Must be GL_COLOR_TABLE_SCALE or GL_COLOR_TABLE_BIAS. Chapter 1. OpenGL Subroutines 61 params is a pointer to an array where the values of the paramaters are stored. Notes GL_TEXTURE_COLOR_TABLE_SGI is an alias for GL_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. GL_PROXY_TEXTURE_COLOR_TABLE_SGI is an alias for GL_PROXY_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. Error Codes GL_INVALID_ENUM GL_INVALID_ENUM GL_INVALID_OPERATION is generated if target is not one of the allowable values. is generated if pname is not one of the allowable values. is generated if glColorTable is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets Associated gets for the glColorTableParameter subroutine are as follows. (See the glGet subroutine for more information.) glGet with arguement glGetColorTableParameter. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glPixelTransfer subroutine, the glColorTable subroutine. glColorVertexSUN Subroutine Purpose Specifies a color and a vertex in one call. Library OpenGL C bindings library: (libGL.a) C Syntax void glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) void glColor3fVertex3fvSUN (const GLfloat const GLfloat void glColor4ubVertex2fSUN (GLubyte r, 62 OpenGL 2.1 Reference Manual *c, *v) GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y) void glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v) void glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) void glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v) Description This subroutine can be used as a replacement for the following calls: glColor(); glVertex(); For example, glColor4ubVertex3fvSUN replaces the following calls: glColor4ub(); glVertex3fv(); The only reason for using this call is that it reduces the use of bus bandwidth. Parameters x, y, z v r, g, b, a c Specifies the x, y, and z coordinates of a vertex. Not all parameters are present in all forms of the command. Specifies a pointer to an array of two, or three elements. The elements of a two-element array are x and y. The elements of a three-element array are x, y, and z. Specifies the red, green, blue, and alpha components of a color. Not all parameters are present in all forms of the command. Specifies a pointer to an array of three or four elements. The elements of a three-element array are r, g, and b. The elements of a four-element array are r, g, b, and a. Notes Calling glColorVertexSUN outside of a glBegin/glEnd subroutine pair results in undefined behavior. This subroutine is only valid if the GL_SUN_vertex extension is defined. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Chapter 1. OpenGL Subroutines 63 Related Information The glBegin or glEnd subroutine, the glColor subroutine, the glNormal subroutine, the glTexCoord subroutine, the glVertex subroutine. glCopyColorSubTable Subroutine Purpose Load a subset of a color lookup table from the current GL_READ_BUFFER. Library OpenGL C bindings library: (libGL.a) C Syntax void glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) void glCopyColorSubTableSGI(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) Description glCopyColorSubTable is used to respecify a contiguous portion of a color table previously defined using glColorTable. The pixels copied from the framebuffer replace the portion of the existing table from indices start to start + x - 1, inclusive. This region may not include any entries outside the range of the color table as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect. Parameters target start Must be GL_TEXTURE_COLOR_TABLE_EXT. is the starting index of the portion of the color table to be replaced. is the window coordinates of the left end of the row of pixels to be copied. is the width of the pixel rectangle. x, y width Notes GL_TEXTURE_COLOR_TABLE_SGI is an alias for GL_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. GL_PROXY_TEXTURE_COLOR_TABLE_SGI is an alias for GL_PROXY_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. Error Codes GL_INVALID_ENUM GL_INVALID_VALUE 64 OpenGL 2.1 Reference Manual is generated if target is not one of the allowable values. is generated if width is less than zero. GL_INVALID_OPERATION is generated if glCopyColorSubTable is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets Associated gets for the glColorTable subroutine are as follows. (See the glGet subroutine for more information.) glGet with arguement glGetColorTableParameter. glGet with arguement glGetColorTable. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glColorSubTable subroutine, the glColorTableParameter subroutine, the glCopyColorTable subroutine, the glGetColorTable subroutine. glCopyColorTable Subroutine Purpose Load a color lookup table from the current GL_READ_BUFFER. Library OpenGL C bindings library: (libGL.a) C Syntax void glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) void glCopyColorTableSGI(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) Description glCopyColorTable loads a color table with pixels from the current GL_READ_BUFFER (rather than from main memory, as is the case for glColorTable). The screen-aligned pixel rectangle with lower-left corner at (x, y) having width width and height 1 is loaded into the color table. If any pixels within this region are outside the window that is associated with the GL context, the values obtained for those pixels are undefined The pixels in the rectangle are processed just as if glReadPixels were called, with internalformat set to RGBA, but processing stops after the final conversion to RGBA. Chapter 1. OpenGL Subroutines 65 The four scale parameters and the four bias parameters that are defined for the table are then used to scale and bias the R, G, B, and A components of each pixel. (Use glColorTableParameter to set these scale and bias parameters). Next, the R, G, B, and A values are clamped to the range [0, 1]. Each pixel is then converted to the internal format specified by internalformat. This conversion simply maps the component values of the pixel (R, G, B, and A) to the values included in the internal format (red, green, blue, alpha, and intensity). The mapping is as follows: Internal Format Red Green GL_ALPHA GL_LUMINANCE GL_LUMINANCE_ALPHA GL_INTENSITY GL_RGB R GL_RGBA R Blue Alpha A A G G B B Luminance R R Intensity R A Finally, the red, green, blue, alpha, luminance, and/or intensity components of the resulting pixels are stored in the color table. They form a one-dimensional table with indices in the range [0, width-1]. Parameters target internalformat width x y table Must be GL_TEXTURE_COLOR_TABLE_EXT or GL_PROXY_TEXTURE_COLOR_TABLE_EXT. is the internal format of the color table. The allowable values are: GL_ABGR_EXT, GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGB8, GL_RGB10_A2, GL_RGBA12, and GL_RGB16. The width of the pixel rectangle. is the x coordinate of the lower-left corner of the pixel rectangle to be transferred to the color table. is the y coordinate of the lower-left corner of the pixel rectangle to be transferred to the color table. is a pointer to a one-dimensional array of pixel data that is processed to build the color table. Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. GL_TEXTURE_COLOR_TABLE_SGI is an alias for GL_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. GL_PROXY_TEXTURE_COLOR_TABLE_SGI is an alias for GL_PROXY_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. 66 OpenGL 2.1 Reference Manual Error Codes GL_INVALID_ENUM GL_INVALID_ENUM is generated if target is not one of the allowable values. is generated if internalformat is not one of the allowable values. is generated if width is less than zero. is generated if the requested color table is too large to be supported by the implementation. is generated if glCopyColorTable is executed between the execution of glBegin and the corresponding execution of glEnd. GL_INVALID_VALUE GL_TABLE_TOO_LARGE GL_INVALID_OPERATION Associated Gets Associated gets for the glColorTable subroutine are as follows. (See the glGet subroutine for more information.) glGet with arguement glGetColorTableParameter. glGet with arguement glGetColorTable. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glColorTable subroutine, the glColorTableParameter subroutine, the glCopyColorSubTable subroutine, the ReadPixels subroutine, the glGetColorTable subroutine. glCopyPixels Subroutine Purpose Copies pixels in the frame buffer. Library OpenGL C bindings library: libGL.a C Syntax void glCopyPixels(GLint GLint yCoordinate, GLsizei Width, GLsizei Height, GLenum Type) xCoordinate, Description The glCopyPixels subroutine copies a screen-aligned rectangle of pixels from the specified frame buffer location to a region relative to the current raster position. Its operation is well defined only if the entire pixel source region is within the exposed portion of the window. Results of copies from outside the window, or from regions of the window that are not exposed, are hardware-dependent and undefined. Chapter 1. OpenGL Subroutines 67 The x and y parameters specify the window coordinates of the lower left corner of the rectangular region to be copied. The Width and Height parameters specify the dimensions of the rectangular region to be copied. Both Width and Height must be nonnegative numbers. Several parameters control the processing of the pixel data while it is being copied. These parameters are set with three subroutines: glPixelTransfer, glPixelMap, and glPixelZoom. This article describes the effects on glCopyPixels of most, but not all, of the parameters specified by these three subroutines. The glCopyPixels subroutine copies values from each pixel with lower left corner at (x + i, y + j) for 0 <= i <Width and 0 <= j <Height. This pixel is said to be the ith pixel in the jth row. Pixels are copied in row order from the lowest to the highest row, left to right in each row. The Type parameter specifies whether color, depth, or stencil data is to be copied. The details of the transfer for each data type are as follows. GL_COLOR Indices or red, green, blue, alpha (RGBA) colors are read from the buffer currently specified as the read source buffer. (See the glReadBuffer subroutine.) If the GL is in color index mode, each index that is read from this buffer is converted to a fixed-point format with an unspecified number of bits to the right of the binary point. Each index is then shifted left by GL_INDEX_SHIFT bits and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, 0 (zero) bits fill otherwise unspecified bit locations in the result. If GL_MAP_COLOR is True, the index is replaced with the value that it references in lookup table GL_PIXEL_MAP_I_TO_I. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in a color index buffer. If the GL is in RGBA mode, the red, green, blue, and alpha components of each pixel that is read are converted to an internal floating-point format with unspecified precision. The conversion maps the largest representable component value to 1.0, and component value 0 to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively. GL_DEPTH The resulting indices or RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning window coordinates (xr + i , yr + j), where (xr, yr) is the current raster position, and the pixel was the ith pixel in the jth row. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Depth values are read from the depth buffer and converted directly to an internal floating-point format with unspecified precision. The resulting floating-point depth value is then multiplied by GL_DEPTH_SCALE and added to GL_DEPTH_BIAS. The result is clamped to the range [0,1]. The resulting depth components are then converted to fragments by attaching the current raster position color or color index and texture coordinates to each pixel, then assigning window coordinates (xr + i , yr + j), where (xr, yr) is the current raster position, and the pixel was the ith pixel in the jth row. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. 68 OpenGL 2.1 Reference Manual GL_STENCIL Stencil indices are read from the stencil buffer and converted to an internal fixed-point format with an unspecified number of bits to the right of the binary point. Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, 0 bits fill otherwise unspecified bit locations in the result. If GL_MAP_STENCIL is True, the index is replaced with the value that it references in the lookup table GL_PIXEL_MAP_S_TO_S. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in the stencil buffer. The resulting stencil indices are then written to the stencil buffer such that the index read from the ith location of the jth row is written to location (xr + i, yr + j), where (xr, yr) is the current raster position. Only the pixel ownership test, the scissor test, and the stencil writemask affect these writes. The rasterization described thus far assumes pixel zoom factors of 1.0. If glPixelZoom is used to change the x and y pixel zoom factors, pixels are converted to fragments as follows. If (xr, yr) is the current raster position, and a given pixel is in the ith location in the jth row of the source pixel rectangle, fragments are generated for pixels whose centers are in the rectangle with corners at Unmapped format: variant of paragraph (xr + zoomx i, yr + zoomy j) Unmapped format: variant of paragraph and Unmapped format: variant of paragraph (xr + zoomx (i + 1), yr + zoomy ( j + 1 )), where zoom x is the value of GL_ZOOM_X and zoomy is the value of GL_ZOOM_Y. Parameters xCoordinate yCoordinate Width Height Type Specifies the x window coordinate of the lower left corner of the rectangular region of pixels to be copied. Specifies the y window coordinate of the lower left corner of the rectangular region of pixels to be copied. Specifies the width of the rectangular region of pixels to be copied. This parameter does not accept a negative value. Specifies the height of the rectangular region of pixels to be copied. This parameter does not accept a negative value. Specifies whether color values, depth values, or stencil values are to be copied. Symbolic constants GL_COLOR, GL_DEPTH, and GL_STENCIL are accepted. Notes Modes specified by glPixelStore have no effect on the operation of glCopyPixels. Errors GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_OPERATION GL_INVALID_OPERATION GL_INVALID_OPERATION Type is not an accepted value. Either Width or Height is negative. Type is GL_DEPTH and there is no depth buffer. Type is GL_STENCIL and there is no stencil buffer. The glCopyPixels subroutine is called between a call to glBegin and the corresponding call to glEnd. Chapter 1. OpenGL Subroutines 69 Associated Gets Associated gets for the glCopyPixels subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_CURRENT_RASTER_POSITION. glGet with argument GL_CURRENT_RASTER_POSITION_VALID. Examples To copy the color pixel in the lower left corner of the window to the current raster position, enter the following: glCopyPixels(0, 0, 1, 1, GL_COLOR); Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glDepthFunc subroutine, glDrawBuffer subroutine, glDrawPixels subroutine, glPixelMap subroutine, glPixelTransfer subroutine, glPixelZoom subroutine, glRasterPos subroutine, glReadBuffer subroutine, glReadPixels subroutine, glStencilFunc subroutine. glCopyTexImage1D Subroutine Purpose Defines a one-dimensional (1D) texture image. Library OpenGL C bindings library: libGL.a C Syntax void glCopyTexImage1D(GLenum target, GLint level, GLenum internalFormat, GLint xCoordinate, GLint yCoordinate, GLsizei width, GLint border) Description The glCopyTexImage1D subroutine defines a one dimensional texture image with pixels from the current GL_READ_BUFFER. The screen aligned pixel row with left corner at (x,y) and with a length of width + 2 * border defines the texture array at the mipmap level specified by level. IIternalFormat specifies the internal format of the texture array. The pixels in the row are processed exactly as if glCopyPixels had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0, 1] and then converted to the texture’s internal format for storage in the texel array. 70 OpenGL 2.1 Reference Manual Pixel ordering is such that lower x screen coordinates correspond to lower texture coordinates. If any of the pixels within the specified row of the current GL_READ_BUFFER are outside the window associated with the current rendering context, then the values obtained for those pixels are undefined. Parameters target level internalFormat xCoordinate yCoordinate width border Specifies the target texture. Must be GL_TEXTURE_1D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the internal format of the texture. Must be one of the following symbolic constants: GL_ABGR_EXT, GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_RGB, GL_R3_G3_B2, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16. Specifies the x window coordinate of the lower left corner of the row of pixels to be copied. Specifies the y window coordinate of the lower left corner of the row of pixels to be copied. Specifies the width of the texture image. Must be 0 or 2**n + 2*border for some integer n. The height of the texture image is 1. Specifies the width of the border. Must be either 0 or 1. Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. The glCopyTexImage1D subroutine is available only if the GL version is 1.1 or greater. 1, 2, 3, or 4 are not accepted values for internalFormat. An image with zero width indicates a null texture. Errors GL_INVALID_ENUM is generated if target is not one of the allowable values. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2max, where max is the returned value of GL_MAX_TEXTURE_SIZE. GL_INVALID_VALUE is generated if border is not 0 or 1. GL_INVALID_VALUE is generated if width is less than zero, greater than 2 + GL_MAX_TEXTURE_SIZE, or if width cannot be represented as 2**k+ 2 * border for some integer k. GL_INVALID_VALUE is generated if width is less than zero or greater than 2 + GL_MAX_TEXTURE_SIZE, or if it cannot be represented as 2**n + 2 * border for some integer value of n. Chapter 1. OpenGL Subroutines 71 GL_INVALID_OPERATION is generated if glCopyTexImage1D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_1D Related Information The glCopyTexImage2D subroutine, glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexParameter subroutine. glCopyTexImage2D Subroutine Purpose Defines a two-dimensional (2D) texture image. Library OpenGL C bindings library: libGL.a C Syntax void glCopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint xCoordinate, GLint yCoordinate, GLsizei width, GLsizei height, GLint border) Description The glCopyTexImage2D subroutine defines a two-dimensional texture image with pixels from the current GL_READ_BUFFER. The screen aligned pixel rectangle with lower left corner at (x, y) and with a width of width + 2 * border and height height + 2 * border defines the texture array at the mipmap level specified by level. internalFormat specifies the internal format of the texture array. The pixels in the rectangle are processed exactly as if glCopyPixels had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0.0,1.0] and then converted to the texture’s internal format for storage in the texel array. Pixel ordering is such that lower x and y screen coordinates correspond to lower s and t texture coordinates. If any of the pixels within the specified rectangle of the current GL_READ_BUFFER are outside the window associated with the current rendering context, then the values obtained for those pixels are undefined. 72 OpenGL 2.1 Reference Manual Parameters target level internalFormat xCoordinate yCoordinate width height border Specifies the target texture. Must be GL_TEXTURE_2D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the internal format of the texture. Must be one of the following symbolic constants: GL_ABGR_EXT, GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_RGB, GL_R3_G3_B2, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16. Specifies the x window coordinate of the lower left corner of the row of pixels to be copied. Specifies the y window coordinate of the lower left corner of the row of pixels to be copied. Specifies the width of the texture image. Must be 0 or 2**n + 2*border for some integer n. The height of the texture image is 1. Specifies the height of the texture image. Must be 0 or 2**m + 2*border for some integer m. Specifies the width of the border. Must be either 0 or 1. Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. The glCopyTexImage2D subroutine is available only if the GL version is 1.1 or greater. 1, 2, 3, or 4 are not accepted values for internalFormat. An image with height or width of 0 indicates a NULL texture. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2max, where max is the returned value of GL_MAX_TEXTURE_SIZE. GL_INVALID_VALUE is generated if width or height is less than zero, greater than 2 + GL_MAX_TEXTURE_SIZE, or if width or height cannot be represented as 2**k + 2 * border for some integer k. GL_INVALID_VALUE is generated if border is not 0 or 1. GL_INVALID_VALUE is generated if internalFormat is not one of the allowable values. GL_INVALID_OPERATION is generated if glCopyTexImage2D is executed between the execution of glBegin and the corresponding execution of glEnd. Chapter 1. OpenGL Subroutines 73 Associated Gets glGetTexImage. glIsEnabled with argument GL_TEXTURE_2D. Related Information The glCopyPixels subroutine, glCopyTexImage1D subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexImage2D subroutine, glTexParameter subroutine. glCopyTexSubImage1D Subroutine Purpose Copies a one-dimensional (1D) texture subimage. Library OpenGL C bindings library: libGL.a C Syntax void glCopyTexSubImage1D(GLenum GLint level, GLint xoffset, GLint xCoordinate, GLint yCoordinate, GLsizei width) target, Description The glCopyTexSubImage1D subroutine replaces a portion of a one dimensional texture image with pixels from the current GL_READ_BUFFER (rather than from main memory, as is the case for glTexSubImage1D). The screen aligned pixel row with left corner at (x, y), and with length width replaces the portion of the texture array with x indices xoffset through xoffset + width - 1, inclusive. The destination in the texture array may not include any texels outside the texture array as it was originally specified. The pixels in the row are processed exactly as if glCopyPixels had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0, 1] and then converted to the texture’s internal format for storage in the texel array. It is not an error to specify a subtexture with zero width, but such a specification has no effect. If any of the pixels within the specified row of the current GL_READ_BUFFER are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined. No change is made to the internalFormat, width, or border parameters of the specified texture array or to texel values outside the specified subregion. Parameters target level xoffset xCoordinate 74 Specifies the target texture. Must be GL_TEXTURE_1D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the texel offset within the texture array. Specifies the x window coordinate of the lower left corner of the row of pixels to be copied. OpenGL 2.1 Reference Manual yCoordinate width Specifies the y window coordinate of the lower left corner of the row of pixels to be copied. Specifies the width of the texture image subimage. Notes The glCopyTexSubImage1D subroutine is available only if the GL version is 1.1 or greater. Texturing has no effect in color index mode. The glPixelTransfer mode affects texture images in exactly the way they affect glDrawPixels. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_1D. GL_INVALID_OPERATION is generated if the texture array has not been defined by a previous glTexImage1D operation. GL_INVALID_VALUE is generated if width is less than zero. GL_INVALID_VALUE may be generated if level>log2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE. GL_INVALID_VALUE is generated if y < -b or if width < -b, where b is the border width of the texture array. GL_INVALID_VALUE is generated if xoffset < -b, or (xoffset + width) > (w-b). Where w is the GL_TEXTURE_WIDTH, and b is the GL_TEXTURE_BORDER of the texture image being modified. Note that w includes twice the border width. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_1D. Related Information The glCopyTexSubImage2D subroutine, glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexSubImage1D subroutine, glTexParameter subroutine, glCopyTexSubImage2D Subroutine Purpose Copies a two-dimensional (2D) texture subimage. Library OpenGL C bindings library: libGL.a C Syntax void glCopyTexSubImage2D(GLenum GLint level, GLint xoffset, GLint yoffset, target, Chapter 1. OpenGL Subroutines 75 GLint xCoordinate, GLint yCoordinate, GLsizei width, GLsizei height) Description The glCopyTexSubImage2D subroutine replaces a portion of a two dimensional texture image with pixels from the current GL_READ_BUFFER (rather than from main memory, as is the case for glTexSubImage2D). The screen aligned pixel rectangle with lower left corner at (x, y) and with width width and height height replaces the portion of the texture array with x indices xoffset through xoffset + width - 1, inclusive, and y indices yoffset through yoffset + height - 1, inclusive, at the mipmap level specified by level. The pixels in the rectangle are processed exactly as if glCopyPixels had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0, 1] and then converted to the texture’s internal format for storage in the texel array. The destination rectangle in the texture array may not include any texels outside the texture array as it was originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification has no effect. If any of the pixels within the specified rectangle of the current GL_READ_BUFFER are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined. No change is made to the internalformat, width, height, or border parameters of the specified texture array or to texel values outside the specified subregion. Parameters target level xoffset yoffset xCoordinate yCoordinate width height Specifies the target texture. Must be GL_TEXTURE_2D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies a texel offset in the x direction within the texture array. Specifies a texel offset in the y direction within the texture array. Specifies the x window coordinate of the lower left corner of the row of pixels to be copied. Specifies the y window coordinate of the lower left corner of the row of pixels to be copied. Specifies the width of the texture image subimage. Specifies the height of the texture subimage. Notes The glCopyTexSubImage2D subroutine is available only if the GL version is 1.1 or greater. Texturing has no effect in color index mode. The glPixelTransfer mode affects texture images in exactly the way they affect glDrawPixels. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D. GL_INVALID_OPERATION is generated if the texture array has not been defined by a previous glTexImage2D operation. 76 OpenGL 2.1 Reference Manual GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2max, where max is the returned value of GL_MAX_TEXTURE_SIZE. GL_INVALID_VALUE is generated if x < -b or if y < -b, where b is the border width of the texture array. GL_INVALID_VALUE is generated if xoffset < -b, (xoffset + width) > (w - b), yoffset < -b, or (yoffset + height) > (h - b). Where w is the GL_TEXTURE_WIDTH, h is the GL_TEXTURE_HEIGHT, and b is the GL_TEXTURE_BORDER of the texture image being modified. Note that w and h include twice the border width. GL_INVALID_OPERATION is generated if glCopyTexSubImage2D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_2D Related Information The glCopyTexImage2D subroutine, glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage2D subroutine, glTexParameter subroutine. glCopyTexSubImage3D Subroutine Purpose Copies a three-dimensional (3D) texture subimage. This subroutine is only supported on OpenGL 1.2 and later. Library OpenGL C bindings library: libGL.a C Syntax void glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) Description The glCopyTexSubImage3D subroutine replaces a rectangular portion of a three-dimensional texture image with pixels from the current GL_READ_BUFFER (rather than from main memory, as is the case for glTexSubImage3D). Chapter 1. OpenGL Subroutines 77 The screen-aligned pixel rectangle with lower-left corner at (x, y) and with width width and height height replaces the portion of the texture array with x indices xoffset through xoffset + width - 1, inclusive, and y indices yoffset through yoffset + height - 1, inclusive, at the mipmap level specified by level. The pixels in the rectangle are processed exactly as if glCopyPixels had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0, 1] and then converted to the texture’s internal format for storage in the texel array. The destination rectangle in the texture array may not include any texels outside the texture array as it was originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification has no effect. If any of the pixels within the specified rectangle of the current GL_READ_BUFFER are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined. No change is made to the internalformat, width, height, depth, or border parameters of the specified texture array or to texel values outside the specified subregion. Parameters target level xoffset yoffset zoffset x, y width height Specifies the target texture. Must be GL_TEXTURE_3D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies a texel offset in the x direction within the texture array. Specifies a texel offset in the y direction within the texture array. Specifies a texel offset in the z direction within the texture array. Specify the window coordinates of the lower left corner of the rectangular region of pixels to be copied. Specifies the width of the texture subimage. Specifies the height of the texture subimage. Notes Texturing has no effect in color index mode. The glPixelTransfer mode affects texture images in exactly the way they affect glDrawPixels. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_3D. GL_INVALID_OPERATION is generated if texture array has not been defined by a previous glTexImage3D operation. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2max, where max is the returned value of GL_MAX_3D_TEXTURE_SIZE. GL_INVALID_VALUE is generated if x < -b or if y < -b, where b is the border width of the texture array. GL_INVALID_VALUE is generated if xoffset < -b, (xoffset + width) > (w - b), yoffset < -b, (yoffset + height) > (h - b), zoffset < -b, or (zoffset + depth) > (d - b). Where w is the GL_TEXTURE_WIDTH, h is the GL_TEXTURE_HEIGHT, d is the GL_TEXTURE_DEPTH, and b is the GL_TEXTURE_BORDER of the texture image being modified. Note that w, h, and d include twice the border width. 78 OpenGL 2.1 Reference Manual GL_INVALID_OPERATION is generated if glCopyTexSubImage3D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_3D. Related Information The glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage3D subroutine, glTexParameter subroutine. glCopyTexSubImage3DEXT Subroutine Purpose Copies a three-dimensional (3D) texture subimage. Library OpenGL C bindings library: libGL.a C Syntax void glCopyTexSubImage3DEXT(GLenum GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) target, Description The glCopyTexSubImage3DEXT subroutine replaces a rectangular portion of a three-dimensional texture image with pixels from the current GL_READ_BUFFER (rather than from main memory, as is the case for glTexSubImage3DEXT). The screen-aligned pixel rectangle with lower-left corner at (x, y) and with width width and height height replaces the portion of the texture array with x indices xoffset through xoffset + width - 1, inclusive, and y indices yoffset through yoffset + height - 1, inclusive, at the mipmap level specified by level. The pixels in the rectangle are processed exactly as if glCopyPixels had been called, but the process stops just before final conversion. At this point all pixel component values are clamped to the range [0, 1] and then converted to the texture’s internal format for storage in the texel array. The destination rectangle in the texture array may not include any texels outside the texture array as it was originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification has no effect. If any of the pixels within the specified rectangle of the current GL_READ_BUFFER are outside the read window associated with the current rendering context, then the values obtained for those pixels are undefined. Chapter 1. OpenGL Subroutines 79 No change is made to the internalformat, width, height, depth, or border parameters of the specified texture array or to texel values outside the specified subregion. Parameters target level xoffset yoffset zoffset x, y width height Specifies the target texture. Must be GL_TEXTURE_3D_EXT. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies a texel offset in the x direction within the texture array. Specifies a texel offset in the y direction within the texture array. Specifies a texel offset in the z direction within the texture array. Specify the window coordinates of the lower left corner of the rectangular region of pixels to be copied. Specifies the width of the texture subimage. Specifies the height of the texture subimage. Notes The glCopyTexSubImage3DEXT subroutine is available only if the EXT_texture_3d extension is supported. Texturing has no effect in color index mode. The glPixelTransfer mode affects texture images in exactly the way they affect glDrawPixels. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_3D_EXT. GL_INVALID_OPERATION is generated if texture array has not been defined by a previous glTexImage3D operation. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2max, where max is the returned value of GL_MAX_3D_TEXTURE_SIZE_EXT. GL_INVALID_VALUE is generated if x < -b or if y < -b, where b is the border width of the texture array. GL_INVALID_VALUE is generated if xoffset < -b, (xoffset + width) > (w - b), yoffset < -b, (yoffset + height) > (h - b), zoffset < -b, or (zoffset + depth) > (d - b). Where w is the GL_TEXTURE_WIDTH, h is the GL_TEXTURE_HEIGHT, d is the GL_TEXTURE_DEPTH_EXT, and b is the GL_TEXTURE_BORDER of the texture image being modified. Note that w, h, and d include twice the border width. GL_INVALID_OPERATION is generated if glCopyTexSubImage3DEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_3D_EXT. Related Information The glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. 80 OpenGL 2.1 Reference Manual glCullFace Subroutine Purpose Specifies whether frontfacing or backfacing facets may be culled. Library OpenGL C bindings library: libGL.a C Syntax void glCullFace(GLenum mode) Parameters mode Specifies whether frontfacint or backfacing facets are candidates for culling. Symbolic constants GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK are accepted. The initial value is GL_BACK. Description The glCullFace subroutine specifies whether frontfacing or backfacing facets are culled (as specified by the mode parameter) when facet culling is enabled. Facet culling is enabled and disabled using the glEnable and glDisable subroutines with the argument GL_CULL_FACE. Facets include triangles, quadrilaterals, polygons, and rectangles. The glFrontFace subroutine specifies which of the clockwise and counterclockwise facets are frontfacing and backfacing. Notes If mode is GL_FRONT_AND_BACK, no facets are drawn, but other primitives such as points and lines are drawn. Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_OPERATION is generated if glCullFace is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsEnabled with argument GL_CULL_FACE. glGet with argument GL_CULL_FACE_MODE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glEnable or glDisable subroutine, glFrontFace subroutine. Chapter 1. OpenGL Subroutines 81 glDeleteLists Subroutine Purpose Deletes a contiguous group of display lists. Library OpenGL C bindings library: libGL.a C Syntax void glDeleteLists(GLunint GLsizei Range) List, Description The glDeleteLists subroutine causes a contiguous group of display lists to be deleted. The List parameter is the name of the first display list to be deleted, and the Range parameter is the number of display lists to be deleted. All display lists d with List <= d <= List + Range - 1 are deleted. All storage locations allocated to the specified display lists are freed, and the names are available for reuse at a later time. Names within the range that do not have an associated display list are ignored. If Range is 0 (zero), nothing happens. Parameters List Range Specifies the integer name of the first display list to delete. Specifies the number of display lists to delete. Errors GL_INVALID_VALUE GL_INVALID_OPERATION Range is negative. The glDeleteLists subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallList subroutine, glCallLists subroutine, glGenLists subroutine, glIsList subroutine, glNewList subroutine. glDeleteTextures Subroutine Purpose Deletes named textures. Library OpenGL C bindings library: libGL.a 82 OpenGL 2.1 Reference Manual C Syntax void glDeleteTextures(GLsizei const GLuint *textures) n, Parameters n textures Specifies the number of textures to be deleted Specifies an array of textures to be deleted. Description The glDeleteTextures subroutine deletes n textures named by the elements of the array textures. After a texture is deleted, it has no contents or dimensionality, and its name is free for reuse (for example by glGenTextures). If a texture that is currently bound is deleted, the binding reverts to 0 (the default texture). The glDeleteTextures subroutine silently ignores zeros and names that do not correspond to existing textures. Notes The glDeleteTextures subroutine is available only if the GL version is 1.1 or greater. The glDeleteTextures subroutine is not included in display lists. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_OPERATION is generated if glDeleteTextures is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsTexture Related Information The glAreTexturesResident subroutine, glBindTexture subroutine, glGenTextures subroutine, glGet subroutine, glGetTexParameter subroutine, glPrioritizeTextures subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexParameter subroutine. glDeleteTexturesEXT Subroutine Purpose Deletes named textures. Library OpenGL and OpenGL C bindings library: libGL.a C Syntax void glDeleteTexturesEXT(GLsizei const GLuint *textures) n, Chapter 1. OpenGL Subroutines 83 Description glDeleteTexturesEXT deletes n textures named by the elements of the array textures. After a texture is deleted, it has no contents or dimensionality, and its name is free for reuse (by glGenTexturesEXT, for example). If a texture that is currently bound is deleted, the binding reverts to zero (the default texture). glDeleteTexturesEXT silently ignores zeros and names that do not correspond to existing textures. glDeleteTexturesEXT is not included in display lists. Parameters n textures The number of textures to be deleted. An array in which each element is the name of a texture to be deleted. Notes glDeleteTexturesEXT is part of the EXT_texture_object extension, not part of the core GL command set. If GL_EXT_texture_object is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_texture_object is supported by the connection. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_OPERATION is generated if glDeleteTexturesEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsTextureEXT File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBindTextureEXT subroutine, glGenTexturesEXT subroutine, glGet subroutine, glGetTexParameter subroutine, glTexParameter subroutine, glTexSubImage1D subroutine, glTexSubImage2D subroutine, glTexSubImage3DEXT subroutine. glDepthFunc Subroutine Purpose Specifies the function used for depth buffer comparisons. Library OpenGL C bindings library: libGL.a C Syntax void glDepthFunc(GLenum 84 function) OpenGL 2.1 Reference Manual Description The glDepthFunc subroutine specifies the function used to compare each incoming pixel z value with the z value present in the depth buffer. The comparison is performed only if depth testing is enabled. (See glEnable and glDisable of GL_DEPTH_TEST.) The function parameter specifies the conditions under which the pixel will be drawn. The comparison functions are as follows: GL_NEVER GL_LESS GL_EQUAL GL_LEQUAL GL_GREATER GL_NOTEQUAL GL_GEQUAL GL_ALWAYS Never passes. Passes if the incoming Passes if the incoming Passes if the incoming Passes if the incoming Passes if the incoming Passes if the incoming Always passes. z z z z z z value value value value value value is is is is is is less than the stored z value. equal to the stored z value. less than or equal to the stored z value. greater than the stored z value. not equal to the stored z value. greater than or equal to the stored z value. The default value of function is GL_LESS. Initially, depth testing is disabled. Parameters function Specifies the depth comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, and GL_ALWAYS are accepted. The default function is GL_LESS. Errors GL_INVALID_ENUM GL_INVALID_OPERATION function is not an accepted value. The glDepthFunc subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glDepthFunc subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_DEPTH_FUNC glIsEnabled with argument GL_DEPTH_TEST. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glDepthRange subroutine, glEnable or glDisable subroutine, glGet subroutine, glPolygonOffset subroutine, glPolygonOffsetEXT subroutine. Chapter 1. OpenGL Subroutines 85 glDepthMask Subroutine Purpose Enables or disables writing into the depth buffer. Library OpenGL C bindings library: libGL.a C Syntax void glDepthMask(GLboolean Flag) Description The glDepthMask subroutine specifies whether the depth buffer is enabled for writing. If the Flag parameter is zero (0), depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled. Parameters Flag Specifies whether the depth buffer is enabled for writing. If Flag is 0, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled. Errors GL_INVALID_OPERATION The glDepthMask subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glDepthMask subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_DEPTH_WRITEMASK. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColorMask subroutine, glDepthFunc subroutine, glDepthRange subroutine, glIndexMask subroutine, glStencilMask subroutine. glDepthRange Subroutine Purpose Specifies the mapping of z values from normalized device coordinates to window coordinates. Library OpenGL C bindings library: libGL.a 86 OpenGL 2.1 Reference Manual C Syntax void glDepthRange(GLclampd GLclampd far) near, Description After clipping and division by w, z coordinates range from -1.0 to 1.0, corresponding to the near and far clipping planes. The glDepthRange subroutine specifies a linear mapping of the normalized z coordinates in this range to window z coordinates. Regardless of the actual depth buffer implementation, window coordinate depth values are treated as though they range from 0.0 through 1.0 (like color components). Thus, the values accepted by glDepthRange are both clamped to this range before they are accepted. The default mapping of 0,1 maps the near plane to 0 (zero) and the far plane to 1 (one). With this mapping, the depth buffer range is fully utilized. Parameters near far Specifies the mapping of the near clipping plane to window coordinates. The default value is 0. Specifies the mapping of the far clipping plane to window coordinates. The default value is 1. Notes It is not necessary that near be less than far. Reverse mappings such as 1,0 are acceptable. Errors GL_INVALID_OPERATION The glDepthRange subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glDepthRange subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_DEPTH_RANGE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glDepthFunc subroutine, glPolygonOffset subroutine, glPolygonOffsetEXT subroutine, glViewport subroutine. glDrawArrays Subroutine Purpose Renders primitives from array data. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 87 C Syntax void glDrawArrays(GLenum GLint first, GLsizei count) mode, Description The glDrawArrays subroutine lets you specify multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flage, or color, you can prespecify separate arrays of vertexes, normals, and colors and use them to construct a sequence of primitives with a single call to glDrawArrays. When glDrawArrays is called, it uses count sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element first. The mode parameter specifies what kind of primitives are constructed, and how the array elements construct these primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated. Vertex attributes that are modified by glDrawArrays have an unspecified value after glDrawArrays returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawArrays executes. Attributes that are not modified remain well defined. Parameters mode Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Specifies the starting index in the enabled arrays. Specifies the number of indices to be rendered. first count Notes The glDrawArrays subroutine is available only if the GL version is 1.1 or greater. The glDrawArrays subroutine is included in display lists. If glDrawArrays is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_VALUE is generated if count is negative. GL_INVALID_OPERATION is generated if glDrawArrays is executed between the execution of glBegin and the corresponding glEnd. Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glNormalPointer subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. 88 OpenGL 2.1 Reference Manual glDrawArraysEXT Subroutine Purpose Renders primitives from array data. Library OpenGL C bindings library: libGL.a C Syntax void glDrawArraysEXT(GLenum GLint first, GLsizei count) mode, Description glDrawArraysEXT makes it possible to specify multiple geometric primitives with very few subroutine calls. Instead of calling an OpenGL procedure to pass each individual vertex, normal, or color, separate arrays of vertexes, normals, and colors can be prespecified, and used to define a sequence of primitives (all of the same type) with a single call to glDrawArraysEXT. When glDrawArraysEXT is called, count sequential elements from each enabled array are used to construct a sequence of geometric primitives, beginning with element first. mode specifies what kind of primitives are constructed, and how the array elements are used to construct these primitives. If GL_VERTEX_ARRAY_EXT is not enabled, no geometric primitives are generated. Vertex attributes that are modified by glDrawArraysEXT have an unspecified value after glDrawArraysEXT returns. For example, if GL_COLOR_ARRAY_EXT is enabled, the value of the current color is undefined after glDrawArraysEXT executes. Attributes that aren’t modified remain well defined. Operation of glDrawArraysEXT is atomic with respect to error generation. If an error is generated, no other operations take place. Parameters mode first count Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Specifies the starting index in the enabled arrays. Specifies the number of indices which should be rendered. Notes glDrawArraysEXT may be included in display lists. If glDrawArraysEXT is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Static array data may be read and cached by the implementation at any time. If static array elements are modified and the arrays are not respecified, the results of any subsequent calls to glDrawArraysEXT are undefined. Although it is not an error to respecify an array between the execution of glBegin and the corresponding execution of glEnd, the result of such respecification is undefined. Chapter 1. OpenGL Subroutines 89 glDrawArraysEXT is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_VALUE is generated if count is negative. GL_INVALID_OPERATION is generated if glDrawArraysEXT is called between the execution of glBegin and the corresponding execution of glEnd. File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElementEXT subroutine, glColorPointerEXT subroutine, glEdgeFlagPointerEXT subroutine, glGetPointervEXT subroutine, glIndexPointerEXT subroutine, glNormalPointerEXT subroutine, glTexCoordPointerEXT subroutine, glVertexPointerEXT subroutine. glDrawBuffer Subroutine Purpose Specifies which color buffers are to be used for drawing. Library OpenGL C bindings library: libGL.a C Syntax void glDrawBuffer(GLenum Mode) Description When colors are written to the frame buffer, they are written into the color buffers specified by the glDrawBuffer subroutine. The specifications are: GL_NONE GL_FRONT_LEFT GL_FRONT_RIGHT GL_BACK_LEFT GL_BACK_RIGHT GL_FRONT GL_BACK GL_LEFT GL_RIGHT 90 OpenGL 2.1 Reference Manual No color buffers are written. Only the front left color buffer is written. Only the front right color buffer is written. Only the back left color buffer is written. Only the back right color buffer is written. Only the front left and front right color buffers are written. If there is no front right color buffer, only the front left color buffer is written. Only the back left and back right color buffers are written. If there is no back right color buffer, only the back left color buffer is written. Only the front left and back left color buffers are written. If there is no back left color buffer, only the front left color buffer is written. Only the front right and back right color buffers are written. If there is no back right color buffer, only the front right color buffer is written. GL_FRONT_AND_BACK GL_AUXi All the front and the back color buffers (front left, front right, back left, back right) are written. If there are no back color buffers, only the front left and front right color buffers are written. If there are no right color buffers, only the front left and back left color buffers are written. If there are no right or back color buffers, only the front left color buffer is written. Only auxiliary color buffer i is written. If more than one color buffer is selected for drawing, blending or logical operations are computed and applied independently for each color buffer and may produce different results in each buffer. Monoscopic contexts include only left buffers, while stereoscopic contexts include both left and right buffers. Likewise, single-buffered contexts include only front buffers, while double-buffered contexts include both front and back buffers. The context is selected at GL initialization. Parameters Mode Specifies up to four color buffers to be drawn into. Symbolic constants GL_NONE, GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT, GL_FRONT_AND_BACK, and GL_AUXi, where i is between 0 and GL_AUX_BUFFERS - 1, are accepted. (GL_AUX_BUFFERS is not the upper limit; use glGet to query the number of available aux buffers.) The default value is GL_FRONT for single buffered contexts, and GL_BACK for double buffered contexts. Notes It is always the case that GL_AUXi = GL_AUX0 + i. Errors GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_OPERATION Mode is not an accepted value. None of the buffers indicated by Mode exists. The glDrawBuffer subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glDrawBuffer subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_DRAW_BUFFER glGet with argument GL_AUX_BUFFERS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glBlendFunc subroutine, glColorMask subroutine, glIndexMask subroutine, glLogicOp subroutine, glReadBuffer subroutine. Chapter 1. OpenGL Subroutines 91 glDrawElements Subroutine Purpose Renders primitives from array data. Library OpenGL C bindings library: libGL.a C Syntax void glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) Description The glDrawElements subroutine lets you specify multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flage, or color, you can prespecify separate arrays of vertexes, normals, and so on and use them to construct a sequence of primitives with a single call to glDrawElements. When glDrawElements is called, it uses count sequential elements from an enabled array, starting at indices to construct a sequence of geometric primitives. mode specifies what kind of primitives are constructed and how the array elements construct these primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated. Vertex attributes that are modified by glDrawElements have an unspecified value after glDrawElements returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawElements executes. Attributes that are not modified maintain their previous values. Notes The glDrawElements subroutine is available only if the GL version is 1.1 or greater. The glDrawElements subroutine is included in display lists. If glDrawElements is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Parameters mode count type indices Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Specifies the number of elements to be rendered. Specifies the type of the values in indices. Must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. Specifies a pointer to the location where the indices are stored. Errors GL_INVALID_ENUM is generated ifmode is not an accepted value. GL_INVALID_VALUE is generated if count is negative. 92 OpenGL 2.1 Reference Manual GL_INVALID_OPERATION is generated if glDrawElements is executed between the execution of glBegin and the corresponding glEnd. Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glEdgeFlagPointer subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glNormalPointer subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glDrawPixels Subroutine Purpose Writes a block of pixels to the frame buffer. Library OpenGL C bindings library: libGL.a C Syntax void glDrawPixels(GLsizei Width, GLsizei Height, GLenum Format, GLenum Type, const GLvoid * Pixels) Description The glDrawPixels subroutine reads pixel data from memory and writes it into the frame buffer relative to the current raster position. Use glRasterPos to set the current raster position, and use glGet with argument GL_CURRENT_RASTER_POSITION to query the raster position. A number of parameters define the encoding of pixel data in memory and control the processing of the pixel data before it is placed in the frame buffer. These parameters are set with four subroutines: glPixelStore, glPixelTransfer, glPixelMap, and glPixelZoom. This article describes the effects on glDrawPixels of many, but not all, of the parameters specified by these four subroutines. Data is read from the Pixels parameter as a sequence of signed or unsigned bytes, signed or unsigned shorts, signed or unsigned integers, or single-precision floating-point values, depending on Type. Each of these bytes, shorts, integers, or floating-point values is interpreted as one color or depth component, or one index, depending on Format. Indices are always treated individually. Color components are treated as groups of one, two, three, or four values, again based on Format. Both individual indices and groups of components are referred to as pixels. If Type is GL_BITMAP, the data must be unsigned bytes, and Format must be either GL_COLOR_INDEX or GL_STENCIL_INDEX. Each unsigned byte is treated as eight 1-bit pixels, with bit ordering determined by GL_UNPACK_LSB_FIRST. (See glPixelStore.) Width multiplied by Height pixels are read from memory, starting at location Pixels. By default these pixels are taken from adjacent memory locations, except that after every Width pixels are read, the read pointer is advanced to the next 4-byte boundary. The 4-byte row alignment is specified by glPixelStore with argument GL_UNPACK_ALIGNMENT, and it can be set to 1, 2, 4, or 8 bytes. Other pixel store parameters specify different read pointer advancements, both before the first pixel is read, and after all Width pixels are read. Refer to the glPixelStore subroutine for details on these options. The Width multiplied by Height pixels that are read from memory are each operated on in the same way, based on the values of several parameters specified by glPixelTransfer and glPixelMap. The details of these operations, as well as the target buffer into which the pixels will be drawn, are specific to the format Chapter 1. OpenGL Subroutines 93 of the pixels, as specified by Format. Format can assume one of the following 18 symbolic values: GL_COLOR_INDEX Each pixel is a single value, a color index. It is converted to fixed point, with an unspecified number of bits to the right of the binary point, regardless of the memory data type. Floating-point values convert to true fixed-point values. Signed and unsigned integer data is converted with all fraction bits set to 0 (zero). Bitmap data converts to either 0.0 or 1.0. Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, 0 bits fill otherwise unspecified bit locations in the result. If the GL is in red, green, blue, alpha (RGBA) mode, the resulting index is converted to an RGBA pixel using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables. If the GL is in color index mode and GL_MAP_COLOR is True, the index is replaced with the value that it references in the lookup table GL_PIXEL_MAP_I_TO_I. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in a color index buffer. GL_STENCIL_INDEX The resulting indices or RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a single value, a stencil index. It is converted to fixed point, with an unspecified number of bits to the right of the binary point, regardless of the memory data type. Floating-point values convert to true fixed-point values. Signed and unsigned integer data is converted with all fraction bits set to 0. Bitmap data converts to either 0.0 or 1.0. Each fixed-point index is then shifted left by GL_INDEX_SHIFT bits and added to GL_INDEX_OFFSET. If GL_INDEX_SHIFT is negative, the shift is to the right. In either case, 0 bits fill otherwise unspecified bit locations in the result. If GL_MAP_STENCIL is True, the index is replaced with the value that it references in the lookup table GL_PIXEL_MAP_S_TO_S. Whether the lookup replacement of the index is done or not, the integer part of the index is then ANDed with 2b -1, where b is the number of bits in the stencil buffer. The resulting stencil indices are then written to the stencil buffer such that the nth index is written to location xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. Only the pixel ownership test, the scissor test, and the stencil writemask affect these write operations. 94 OpenGL 2.1 Reference Manual GL_DEPTH_COMPONENT GL_RGBA Each pixel is a single depth component. Floating-point data is converted directly to an internal floating-point format with unspecified precision. Signed integer data is mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point depth value is then multiplied by GL_DEPTH_SCALE and added to GL_DEPTH_BIAS. The result is clamped to the range [0,1]. The resulting depth components are then converted to fragments by attaching the current raster position color or color index and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a four-component group, red first, followed by green, followed by blue, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data are mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively. The resulting RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Chapter 1. OpenGL Subroutines 95 GL_BGRA Each pixel is a four-component group, blue first, followed by green, followed by red, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data are mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is BLUE, GREEN, RED, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is B, G, R, or A, respectively. GL_ABGR_EXT The resulting BGRA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a four-component group: for GL_RGBA, the red component is first, followed by green, followed by blue, followed by alpha: for GL_BGRA, the blue component is first, followed by green, followed by red, followed by alpha: for GL_ABGR_EXT the order is alpha, blue, green, and then red. Floating-point values are converted directly to an internal floatingpoint format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and zero maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is true, each color component is scaled by the size of lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively. The resulting RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod width yn = yr + | GL_RED 96 OpenGL 2.1 Reference Manual n bwidthc where (xr,yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a single red component. This component is converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then it is converted to an RGBA pixel with green and blue set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been sent in as an RGBA pixel. GL_GREEN GL_BLUE GL_ALPHA GL_RGB GL_BGR GL_LUMINANCE GL_LUMINANCE_ALPHA GL_422_EXT Each pixel is a single green component. This component is converted to the internal floating-point format in the same way as the green component of an RGBA pixel is, then it is converted to an RGBA pixel with red and blue set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been sent in as an RGBA pixel. Each pixel is a single blue component. This component is converted to the internal floating-point format in the same way as the blue component of an RGBA pixel is, then it is converted to an RGBA pixel with red and green set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been sent in as an RGBA pixel. Each pixel is a single alpha component. This component is converted to the internal floating-point format in the same way as the alpha component of an RGBA pixel is, then it is converted to an RGBA pixel with red, green, and blue set to 0.0. After this conversion, the pixel is treated just as if it had been sent in as an RGBA pixel. Each pixel is a three-component group, red first, followed by green, followed by blue. Each component is converted to the internal floating-point format in the same way as the red, green, and blue components of an RGBA pixel are. The color triple is converted to an RGBA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been sent in as an RGBA pixel. Each pixel is a three-component group, blue first, followed by green, followed by red. Each component is converted to the internal floating-point format in the same way as the blue, green, and red components of an BGRA pixel are. The color triple is converted to an BGRA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been sent in as an BGRA pixel. Each pixel is a single luminance component. This component is converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then it is converted to an RGBA pixel with red, green, and blue set to the converted luminance value, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been sent in as an RGBA pixel. Each pixel is a two-component group, luminance first, followed by alpha. The two components are converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then they are converted to an RGBA pixel with red, green, and blue set to the converted luminance value, and alpha set to the converted alpha value. After this conversion, the pixel is treated just as if it had been sent in as an RGBA pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. Chapter 1. OpenGL Subroutines 97 GL_422_REV_EXT GL_422_AVERAGE_EXT GL_422_REV_AVERAGE_EXT This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_REV_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this convers ion, the pixel is treated just as if it had been sent in as an RGB pixel. The following table summarizes the meaning of the valid constants for the Type parameter: Type GL_UNSIGNED_BYTE GL_BYTE GL_BITMAP GL_UNSIGNED_SHORT GL_SHORT GL_UNSIGNED_INT GL_INT GL_FLOAT GL_UNSIGNED_BYTE_3_3_2 GL_UNSIGNED_BYTE_2_3_3_REV GL_UNSIGNED_SHORT_5_6_5 98 OpenGL 2.1 Reference Manual Corresponding Type Unsigned 8-bit integer Signed 8-bit integer Single bits in unsigned 8-bit integers Unsigned 16-bit integer Signed 16-bit integer Unsigned 32-bit integer 32-bit integer Single-precision floating-point Unsigned 8-bit integer Unsigned 8-bit integer Unsigned 16-bit integer GL_UNSIGNED_SHORT_5_6_5_REV GL_UNSIGNED_SHORT_4_4_4_4 GL_UNSIGNED_SHORT_4_4_4_4_REV GL_UNSIGNED_SHORT_5_5_5_1 GL_UNSIGNED_SHORT_1_5_5_5_REV GL_UNSIGNED_INT_8_8_8_8 GL_UNSIGNED_INT_8_8_8_8_REV GL_UNSIGNED_INT_10_10_10_2 GL_UNSIGNED_INT_2_10_10_10_REV Unsigned Unsigned Unsigned Unsigned Unsigned Unsigned Unsigned Unsigned Unsigned 16-bit 16-bit 16-bit 16-bit 16-bit 32-bit 32-bit 32-bit 32-bit integer integer integer integer integer integer integer integer integer The rasterization described thus far assumed pixel zoom factors of 1.0. If glPixelZoom is used to change the x and y pixel zoom factors, pixels are converted to fragments as follows. If (xr, yr) is the current raster position, and a given pixel is in the nth column and mth row of the pixel rectangle, fragments are generated for pixels whose centers are in the rectangle with corners at (xr + zoomx n, yr + zoomy m) and (xr + zoomx (n + 1), yr + zoomy (m + 1 )), where zoomx is the value of GL_ZOOM_X and zoomy is the value of GL_ZOOM_Y. Parameters Width Height Format Type Pixels Specifies the width of the pixel rectangle that will be written into the frame buffer. Specifies the height of the pixel rectangle that will be written into the frame buffer. Specifies the format of the pixel data. Symbolic constants GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, GL_ABGR_EXT, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, and GL_422_REV_AVERAGE_EXT are accepted. Specifies the data type for Pixels. Symbolic constants GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV, are accepted. Specifies a pointer to the pixel data. Notes Format of GL_ABGR_EXT is part of the _extname (EXT_abgr) extension, not part of the core GL command set. Packed pixel types and BGR/BGRA formats are only supported in OpenGL 1.2 or later. Errors GL_INVALID_VALUE GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_OPERATION Either Width or Height is negative. Format or Type is not one of the accepted values. Format is GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_AGBR_EXT, GL_LUMINANCE, GL_LUMINANCE_ALPHA, and the GL is in color index mode. Type is GL_BITMAP and Format is not either GL_COLOR_INDEX or GL_STENCIL_INDEX. Format is GL_STENCIL_INDEX and there is no stencil buffer. The glDrawPixels subroutine is called between a call to glBegin and the corresponding call to glEnd. Chapter 1. OpenGL Subroutines 99 Associated Gets Associated gets for the glDrawPixels subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_CURRENT_RASTER_POSITION glGet with argument GL_CURRENT_RASTER_POSITION_VALID. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glAlphaFunc subroutine, glBegin or glEnd subroutine, glBlendFunc subroutine, glCopyPixels subroutine, glDepthFunc subroutine, glLogicOp subroutine, glPixelMap subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glPixelZoom subroutine, glRasterPos subroutine, glReadPixels subroutine, glScissor subroutine, glStencilFunc subroutine. glDrawRangeElements Subroutine Purpose Renders primitives from array data. This subrotuine is only supported on OpenGL 1.2 and later. Library OpenGL C bindings library: libGL.a C Syntax void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) Description The glDrawRangeElements subroutine lets you specify multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flage, or color, you can prespecify separate arrays of vertexes, normals, and so on and use them to construct a sequence of primitives with a single call to glDrawRangeElements. When glDrawRangeElements is called, it uses count sequential elements from indices to construct a sequence of geometric primitives. GLuint start and GLuint end specify the values between which all values in the array indices must lie. GLenum mode specifies what kind of primitives are constructed and how the array elements construct these primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated. The recommended maximum amounts of vertex and index data can be determined by calling GetIntegerv with the symbolic constants MAX_ELEMENTS_VERTICES and MAX_ELEMENTS_INDICES. If end-start+1 is greater than the value of MAX_ELEMENTS_VERTICES,or if count is greater than the value 100 OpenGL 2.1 Reference Manual of MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices in the range [start,end] be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be achieved with an optimal index set. Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glDrawRangeElements executes. Attributes that are not modified remain well defined. Parameters mode start end count type indices Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Specifies the start value in indices. Must be less than the end value in indices. Specifies the end value in indices. Must be greater than the start value in indices. Specifies the number of elements to be rendered. Specifies the type of the values in indices. Must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. Specifies a pointer to the location where the indices are stored. Notes The glDrawRangeElements subroutine is available only if the GL version is 1.1 or greater. The glDrawRangeElements subroutine is included in display lists. If glDrawRangeElements is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_VALUE is generated if count is negative or the end value is less than the start value. GL_INVALID_OPERATION is generated if glDrawRangeElements is executed between the execution of glBegin and the corresponding glEnd. Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glEdgeFlagPointer subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glNormalPointer subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glEdgeFlag Subroutine Purpose Marks edges as either boundary or nonboundary. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 101 C Syntax void glEdgeFlag(GLboolean Flag) void glEdgeFlagv(const GLboolean *Flagv) Description Each vertex of a polygon, separate triangle, or separate quadrilateral specified between glBegin and glEnd is marked as the start of either a boundary or nonboundary edge. If the current edge flag is True when the vertex is specified, the vertex is marked as the start of a boundary edge. Otherwise, the vertex is marked as the start of a nonboundary edge. glEdgeFlag sets the edge flag to True if the Flag parameter is nonzero; otherwise, the edge flag is set to False. The vertices of connected triangles and connected quadrilaterals are always marked as a boundary, regardless of the value of the edge flag. Boundary and nonboundary edge flags on vertices are significant only if GL_POLYGON_MODE is set to GL_POINT or GL_LINE. See glPolygonMode. Initially, the edge flag bit is True. Parameters Flag Flagv Specifies the current edge flag value, either True or False. Specifies a pointer to an array that contains a single Boolean element (either True or False). Replaces the current edge flag value. Notes The current edge flag can be updated at any time. In particular, glEdgeFlag can be called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glEdgeFlag subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_EDGE_FLAG. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin subroutine, glEdgeFlagPointer subroutine, glEdgeFlagPointerEXT subroutine, glEnd subroutine, glPolygonMode subroutine. glEdgeFlagPointer Subroutine Purpose Defines an array of edge flags. 102 OpenGL 2.1 Reference Manual Library OpenGL C bindings library: libGL.a C Syntax void glEdgeFlagPointer( GLsizei const GLvoid * pointer) stride, Description The glEdgeFlagPointer subroutine specifies the location and data format of an array of Boolean edge flags to use when rendering. The stride parameter gives the byte stride from one edge flag to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single array storage may be more efficient on some implementations; see glInterleavedArrays.) When an edge flag array is specified, stride and pointer are saved as client side state. To enable and disable the edge flag array, call glEnableClientState and glDisableClientState with the argument GL_EDGE_FLAG_ARRAY. If enabled, the edge flag array is used when glDrawArrays, glDrawElements or glArrayElement is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Edge Flag array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters stride pointer Specifies the byte offset between consecutive edge flags. If stride is zero (the initial value), the edge flags are understood to be tightly packed in the array. The initial value is 0. Specifies a pointer to the first edge flag in the array. The initial value is 0 (NULL pointer). Notes The glEdgeFlagPointer subroutine is available only if the GL version is 1.1 or greater. The edge flag array is initially disabled and it won’t be accessed when glArrayElement, glDrawElements, or glDrawArrays is called. Execution of glEdgeFlagPointer is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glEdgeFlagPointer subroutine is typically implemented on the client side with no protocol. Since the edge flag array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. The glEdgeFlagPointer subroutine is not included in display lists. Error Codes GL_INVALID_ENUM is generated if stride is negative. Chapter 1. OpenGL Subroutines 103 Associated Gets glIsEnabled with argument GL_EDGE_FLAG_ARRAY glGet with argument GL_EDGE_FLAG_ARRAY_STRIDE glGetPointerv with argument GL_EDGE_FLAG_ARRAY_POINTER Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointerListIBM subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glEdgeFlagPointerEXT Subroutine Purpose Defines an array of edge flags. Library OpenGL C bindings library: libGL.a C Syntax void glEdgeFlagPointerEXT(GLsizei GLsizei count, const GLboolean *pointer) stride, Description glEdgeFlagPointerEXT specifies the location and data format of an array of boolean edge flags to use when rendering. stride gives the byte stride from one edge flag to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When an edge flag array is specified, stride, count and pointer are saved as client-side state, and static array elements may be cached by the implementation. The edge flag array is enabled and disabled using glEnable and glDisable with the argument GL_EDGE_FLAG_ARRAY_EXT. If enabled, the edge flag array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Edge Flag array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. 104 OpenGL 2.1 Reference Manual Parameters stride count pointer Specifies the byte offset between consecutive edge flags. If stride is zero the edge flags are understood to be tightly packed in the array. Specifies the number of edge flags, counting from the first, that are static. Specifies a pointer to the first edge flag in the array. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the edge flag array is disabled and it won’t be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although, it is not an error to call glEdgeFlagPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glEdgeFlagPointerEXT will typically be implemented on the client side with no protocol. Since the edge flag array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glEdgeFlagPointerEXT commands are not entered into display lists. glEdgeFlagPointerEXT is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. Errors GL_INVALID_ENUM is generated if stride or count is negative. Associated Gets glIsEnabled with argument GL_EDGE_FLAG_ARRAY_EXT . glGet with argument GL_EDGE_FLAG_ARRAY_STRIDE_EXT. glGet with argument GL_EDGE_FLAG_ARRAY_COUNT_EXT. glGetPointervEXT with argument GL_EDGE_FLAG_ARRAY_POINTER_EXT. File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElementEXT subroutine, glColorPointerEXT subroutine, glDrawArraysEXT subroutine, glGetPointervEXT subroutine, glIndexPointerEXT subroutine, glNormalPointerEXT subroutine, glTexCoordPointerEXT subroutine, glVertexPointerEXT subroutine. Chapter 1. OpenGL Subroutines 105 glEdgeFlagPointerListIBM Subroutine Purpose Defines a list of edge flag arrays. Library OpenGL C bindings library: libGL.a C Syntax void glEdgeFlagPointerListIBM ( GLint const GLboolean ** pointer, GLint ptrstride) stride, Description The glEdgeFlagPointerListIBM subroutine specifies the location and data format of a list of arrays of edge flags to use when rendering. The stride parameter gives the byte stride from one edge flag to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). The ptrstride parameter specifies the byte stride from one pointer to the next in the pointer array. When an edge flag array is specified, stride, pointer and ptrstride are saved as client side state. A stride value of 0 does not specify a ″tightly packed″ array as it does in glEdgeFlagPointer. Instead, it causes the first array element of each array to be used for each vertex. Also, a negative value can be used for stride, which allows the user to move through each array in reverse order. To enable and disable the edge flag arrays, call glEnableClientState and glDisableClientState with the argument GL_EDGE_FLAG_ARRAY. The edge flag array is initially disabled. When enabled, the edge flag arrays are used when glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glDrawArrays, glDrawElements or glArrayElement is called. The last three calls in this list will only use the first array (the one pointed at by pointer[0]). See the descriptions of these routines for more information on their use. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Edge Flag array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters stride pointer ptrstride Specifies the byte offset between consecutive edge flags. The initial value is 0. Specifies a list of edge flag arrays. The initial value is 0 (NULL pointer). Specifies the byte stride between successive pointers in the pointer array. The initial value is 0. Notes The glEdgeFlagPointerListIBM subroutine is available only if the GL_IBM_vertex_array_lists extension is supported. 106 OpenGL 2.1 Reference Manual Execution of glEdgeFlagPointerListIBM is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glEdgeFlagPointerListIBM subroutine is typically implemented on the client side. Since the edge flag array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When a glEdgeFlagPointerListIBM call is encountered while compiling a display list, the information it contains does NOT contribute to the display list, but is used to update the immediate context instead. The glEdgeFlagPointer call and the glEdgeFlagPointerListIBM call share the same state variables. A glEdgeFlagPointer call will reset the edge flag list state to indicate that there is only one edge flag list, so that any and all lists specified by a previous glEdgeFlagPointerListIBM call will be lost, not just the first list that it specified. Error Codes None. Associated Gets glIsEnabled with argument GL_EDGE_FLAG_ARRAY. glGetPointerv with argument GL_EDGE_FLAG_ARRAY_LIST_IBM. glGet with argument GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM. glGet with argument GL_EDGE_FLAG_ARRAY_STRIDE. Related Information The glArrayElement subroutine, glEdgeFlagPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glMultiDrawArraysEXT subroutine, glMultiDrawElementsEXT subroutine, glMultiModeDrawArraysIBM subroutine, glMultiModeDrawElementsIBM subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glEnable or glDisable Subroutine Purpose Enables or disables a GL capability. Library OpenGL C bindings library: libGL.a C Syntax void glEnable(GLenum capability) void glDisable(GLenum capability) Description glEnable and glDisable enable and disable various capabilities. Use glIsEnable or glGet to determine the current setting of any capability. Both glEnable and glDisable take a single argument, capability, which may assume one of the following values: Chapter 1. OpenGL Subroutines 107 GL_ALPHA_TEST GL_AUTO_NORMAL GL_BLEND GL_CLIP_PLANEi GL_COLOR_ARRAY_EXT GL_COLOR_LOGIC_OP GL_COLOR_MATERIAL GL_COLOR_SUM_EXT GL_CULL_FACE GL_CULL_VERTEX_IBM GL_DEPTH_TEST GL_DITHER GL_EDGE_FLAG_ARRAY_EXT 108 OpenGL 2.1 Reference Manual If enabled, do alpha testing. (See glAlphaFunc.) If enabled, compute surface normal vectors analytically when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 is used to generate vertices. (See glMap2.) If enabled, blend the incoming red, green, blue, alpha (RGBA) color values with the values in the color buffers. (See glBlendFunc.) If enabled, clip geometry against user-defined clipping plane i. (See glClipPlane.) If enabled, colors are taken from the color array when glArrayElementEXT or glDrawArraysEXT is called. (See glColorPointerEXT, glArrayElementEXT and glDrawArraysEXT.) If enabled, apply the currently selected logical operation to the incoming color and color buffer values. The initial value is GL_FALSE. (See glLogicOp.) If enabled, have one or more material parameters track the current color. (See glColorMaterial.) If enabled, user may specify the RGB components of the secondary color used in the Color Sum stage, instead of using the default (0,0,0,0) color. This applies only in RGBA mode and when LIGHTING is disabled. (See glSecondaryColorEXT.) If enabled, cull polygons based on their winding in window coordinates. (See glCullFace.) If enabled, cull polygons based on their vertex normals. When vertex culling is enabled, vertices are classified as front or back facing according to the sign of the dot product between the normal at the vertex and an eye direction vector from the vertex toward the eye position. When (normal dot eye_direction) <= 0 the vertex is classified as back facing. When (normal dot eye_direction) > 0 the vertex is classified as front facing. Vertices are culled when the face orientation determined by the dot product is the same as the face specified by CullFace. When all of the vertices of a polygon are culled, then the polygon may be culled. Unlike GL_CULL_VERTEX_EXT, vertex culling using GL_CULL_VERTEX_IBM does not necessarily result in polygons being culled even if all of the vertices of the polygon are culled. The eye direction is determined by transforming the column vector (0, 0, 1) by the upper leftmost 3x3 matrix taken from the inverse of the modelview matrix. The eye direction is undefined if the modelview matrix is singular or nearly singular. This operation in effect projects the z axis in eye coordinates back into object space. If the projection matrix or DepthRange settings cause the z axis in window coordinates to be misaligned with the z axis in eye coordinates, this extension should not be used. Vertex culling is performed independently of face culling. Polygons on the silhouettes of objects may have both front and back facing vertices. Since polygons are culled only if all of their vertices are culled and are not necessarily culled by GL_CULL_VERTEX_IBM even in that case, face culling may have to be used in addition to vertex culling in order to correctly cull silhouette polygons. If enabled, do depth comparisons and update the depth buffer. (See glDepthFunc and glDepthRange.) If enabled, dither color components or indices before they are written to the color buffer. If enabled, edge flags are taken from the edge flags array when glArrayElementEXT or glDrawArraysEXT is called. (See glEdgeFlagPointerEXT, glArrayElementEXT and glDrawArraysEXT.) GL_FOG GL_INDEX_ARRAY_EXT GL_LIGHTi GL_LIGHTING GL_LINE_SMOOTH GL_LINE_STIPPLE GL_LOGIC_OP GL_MAP1_COLOR_4 GL_MAP1_INDEX GL_MAP1_NORMAL GL_MAP1_TEXTURE_COORD_1 GL_MAP1_TEXTURE_COORD_2 GL_MAP1_TEXTURE_COORD_3 GL_MAP1_TEXTURE_COORD_4 GL_MAP1_VERTEX_3 GL_MAP1_VERTEX_4 GL_MAP2_COLOR_4 GL_MAP2_INDEX GL_MAP2_NORMAL GL_MAP2_TEXTURE_COORD_1 GL_MAP2_TEXTURE_COORD_2 GL_MAP2_TEXTURE_COORD_3 GL_MAP2_TEXTURE_COORD_4 If enabled, blend a fog color into the post-texturing color. (See glFog.) If enabled, color indexes are taken from the color index array when glArrayElementEXT or glDrawArraysEXT is called. (See glIndexPointerEXT, glArrayElementEXT and glDrawArraysEXT.) If enabled, include light i in the evaluation of the lighting equation. (See glLightModel and glLight.) If enabled, use the current lighting parameters to compute the vertex color or index. Otherwise, simply associate the current color or index with each vertex. (See glMaterial, glLightModel, and glLight.) If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. (See glLineWidth.) If enabled, use the current line stipple pattern when drawing lines. (See glLineStipple.) If enabled, apply the currently selected logical operation to the incoming and color buffer indices. (See glLogicOp.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate RGBA values. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate color indices. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate normals. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s texture coordinates. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s and t texture coordinates. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s, t, and r texture coordinates. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s, t, r, and q texture coordinates. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate will generate x, y, and z vertex coordinates. (See glMap1.) If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate homogeneous x, y, z, and w vertex coordinates. (See glMap1.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate RGBA values. (See glMap2.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate color indices. (See glMap2.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate normals. (See glMap2.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s texture coordinates. (See glMap2.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s and t texture coordinates. (See glMap2.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s, t, and r texture coordinates. (See glMap2.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s, t, r, and q texture coordinates. (See glMap2.) Chapter 1. OpenGL Subroutines 109 GL_MAP2_VERTEX_3 GL_MAP2_VERTEX_4 GL_NORMAL_ARRAY_EXT GL_NORMALIZE GL_OCCLUSION_CULLING_HP GL_POLYGON_OFFSET_EXT GL_POLYGON_OFFSET_FILL GL_POLYGON_OFFSET_LINE GL_POLYGON_OFFSET_POINT GL_POINT_SMOOTH GL_POLYGON_SMOOTH GL_POLYGON_STIPPLE GL_RESCALE_NORMAL GL_RESCALE_NORMAL_EXT GL_SCISSOR_TEST 110 OpenGL 2.1 Reference Manual If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate will generate x, y, and z vertex coordinates. (See glMap2.) If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate homogeneous x, y, z, and w vertex coordinates. (See glMap2.) If enabled, normals are taken from the normal array when glArrayElementEXT or glDrawArraysEXT is called. (See glNormalPointerEXT, glArrayElementEXT and glDrawArraysEXT.) If enabled, normal vectors specified with glNormal are scaled to unit length after transformation. (See glNormal.) If enabled, the occlusion testing described within extension HP_occlusion_test is performed. This extension allows an application to render some geometry and, at the completion of the rendering, to determine if any of the geometry could or did modify the depth buffer (in other words, a depth buffer test succeeded). (See glGet with parameter GL_OCCLUSION_TEST_RESULT_HP). Occlusion culling operates independently of the current rendering state (in other words, when occlusion culling is enabled, fragments are generated and the depth and/or color buffer may be updated). To prevent updating the depth/color buffers, the application must disable updates to these buffers. As a side effect of calling glGet with parameter GL_OCCLUSION_TEST_RESULT_HP, the internal result state is cleared, and it is reset for a new bounding box test. If enabled, an offset is added to z values of a polygon’s fragments before the depth comparison is performed. (See glPolygonOffsetEXT.) If enabled, and if the polygon is rendered in GL_FILL mode, an offset is added to z values of a polygon’s fragments before the depth comparison is performed. The initial value is GL_FALSE. (See glPolygonOffset.) If enabled, and if the polygon is rendered in GL_LINE mode, an offset is added to z values of a polygon’s fragments before the depth comparison is performed. The initial value is GL_FALSE. (See glPolygonOffset.) If enabled, an offset is added to z values of a polygon’s fragments before the depth comparison is performed, if the polygon is rendered in GL_POINT mode. The initial value is GL_FALSE. (See glPolygonOffset.) If enabled, draw points with proper filtering. Otherwise, draw aliased points. (See glPointSize.) If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. (See glPolygonMode.) If enabled, use the current polygon stipple pattern when rendering polygons. (See glPolygonStipple.) If normal rescaling is enabled, a new operation is added to the transformation of the normal vector into eye coordinates. The normal vector is rescaled after it is multiplied by the inverse modelview matrix and before it is normalized. If normal rescaling is enabled, a new operation is added to the transformation of the normal vector into eye coordinates. The normal vector is rescaled after it is multiplied by the inverse modelview matrix and before it is normalized. If enabled, discard fragments that are outside the scissor rectangle. (See glScissor.) GL_STENCIL_TEST GL_TEXTURE_1D GL_TEXTURE_2D GL_TEXTURE_3D GL_TEXTURE_3D_EXT GL_TEXTURE_COLOR_TABLE_EXT GL_TEXTURE_COORD_ARRAY_EXT GL_TEXTURE_GEN_Q GL_TEXTURE_GEN_R GL_TEXTURE_GEN_S GL_TEXTURE_GEN_T GL_UPDATE_CLIP_VOLUME_HINT GL_VERTEX_ARRAY_EXT If enabled, do stencil testing and update the stencil buffer. (See glStencilFunc and glStencilOp.) If enabled, one-dimensional texturing is performed (unless two-dimensional texturing is also enabled). (See glTexImage1D.) If enabled, two-dimensional texturing is performed. (See glTexImage2D.) If enabled, three-dimensional texturing is performed. (See glTexImage3D.) If enabled, three-dimensional texture mapping is performed. (See glTexImage3DEXT.) If enabled, a color lookup table is added to the texture mechanism. (See glColorTable.) If enabled, texture coordinates are taken from the texture coordinates array when glArrayElementEXT or glDrawArraysEXT is called. (See glTexCoordPointerEXT, glArrayElementEXT and glDrawArraysEXT.) If enabled, the q texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise the current q texture coordinate is used. (See glTexGen.) If enabled, the r texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise the current r texture coordinate is used. (See glTexGen.) If enabled, the s texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise the current s texture coordinate is used. (See glTexGen.) If enabled, the t texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current t texture coordinate is used. (See glTexGen.) If enabled, calls to ClipBoundingBoxIBM, ClipBoundingSphereIBM, and ClipBoundingVerticesIBM will result in updates to the VOLUME_CLIPPING_HINT_EXT state. A result of REJECT_IBM causes the hint to be set to DONT_CARE. A result of CLIP_IBM causes the hint to be set to NICEST. A result of ACCEPT_IBM causes the hint to be set to FASTEST. If the EXT_clip_volume_hint extension is not supported, then the UPDATE_CLIP_VOLUME_HINT enable state has no effect. (See glClipBoundingBoxIBM, glClipBoundingSphereIBM, or glClipBoundingVerticesIBM, ) If enabled, vertexes are taken from the vertex array when glArrayElementEXT or glDrawArraysEXT is called. (See glVertexPointerEXT, glArrayElementEXT and glDrawArraysEXT.) Parameters capability Specifies a symbolic constant indicating a GL capability. Initially, all are disabled except GL_DITHER. Errors GL_INVALID_ENUM GL_INVALID_OPERATION capability is not an accepted value. The glEnable subroutine is called between a call to glBegin and the corresponding call to glEnd. Chapter 1. OpenGL Subroutines 111 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glAlphaFunc subroutine, glArrayElementEXT subroutine, glBegin or glEnd subroutine, glBlendFunc subroutine, glClipPlane subroutine, glColorMaterial subroutine, glColorPointerEXT subroutine, glCullFace subroutine, glDepthFunc subroutine, glDepthRange subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glFog subroutine, glIndexPointerEXT subroutine, glIsEnabled subroutine, glLight subroutine, glLightModel subroutine, glLineStipple subroutine, glLineWidth subroutine, and the glLogicOp subroutine. The glMap1 subroutine, glMap2 subroutine, glMaterial subroutine, glNormal subroutine, glNormalPointerEXT subroutine, glPointSize subroutine, glPolygonMode subroutine, glPolygonOffset subroutine, glPolygonOffsetEXT subroutine, glPolygonStipple subroutine, glScissor subroutine, glTexCoordPointerEXT subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexImage2D subroutine, and the glTexImage3DEXT subroutine. glEnableClientState or glDisableClientState Subroutine Purpose Enables or disables an array. Library OpenGL C bindings library: libGL.a C Syntax void glEnableClientState(GLenum void glDisableClientState(GLenum array) array) Description The glEnableClientState subroutine lets you enable individual arrays, and glDisableClientState lets you disable individual arrays. Parameters array Specifies the array to enable or disable. Symbolic constraints GL_EDGE_FLAG_ARRAY, GL_TEXTURE_COORD_ARRAY, GL_COLOR_ARRAY, GL_INDEX_ARRAY, GL_NORMAL_ARRAY, GL_VERTEX_ARRAY, GL_FOG_COORDINATE_ARRAY_EXT, and GL_SECONDARY_COLOR_ARRAY_EXT are accepted (for glEnableClientState). Notes The glEnableClientState and glDisableClientState subroutines are available only if the GL version is 1.1 or greater. Errors GL_INVALID_ENUM is generated if array is not an accepted value. 112 OpenGL 2.1 Reference Manual The glEnableClientState subroutine is not allowed between the execution of glBegin and the corresponding glEnd, but an error may or may not be generated. If no error is generated then the behavior is undefined. Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glFogCoordEXT subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glNormalPointer subroutine, glSecondaryColorEXT subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glEvalCoord Subroutine Purpose Evaluates enabled one-dimensional (1D) and two-dimensional (2D) maps. Library OpenGL C bindings library: libGL.a C Syntax glEvalCoord1d void glEvalCoord1d(GLdouble void glEvalCoord1f(GLfloat void glEvalCoord2d(GLdouble GLdouble v) void glEvalCoord2f(GLfloat GLfloat v) u) u) u, u, glEvalCoord1dv void glEvalCoord1dv(const GLdouble * u) void glEvalCoord1fv(const GLfloat * u) void glEvalCoord2dv(const GLdouble * u) void glEvalCoord2fv(const GLfloat * u) Description The glEvalCoord1 subroutine evaluates enabled 1D maps at argument u. The glEvalCoord2 subroutine does the same for 2D maps using two domain values, u and v. Maps are defined with glMap1 and glMap2, and enabled and disabled with glEnable and glDisable. When one of the glEvalCoord subroutines is issued, all currently enabled maps of the indicated dimension are evaluated. Then, for each enabled map, it is as if the corresponding GL subroutine was issued with the computed value. That is, if GL_MAP1_INDEX or GL_MAP2_INDEX is enabled, a glIndex subroutine is simulated. If GL_MAP1_COLOR_4 or GL_MAP2_COLOR_4 is enabled, a glColor subroutine is simulated. If GL_MAP1_NORMAL or GL_MAP2_NORMAL is enabled, a normal vector is produced, and if any of GL_MAP1_TEXTURE_COORD_1, GL_MAP1_TEXTURE_COORD_2, GL_MAP1_TEXTURE_COORD_3, GL_MAP1_TEXTURE_COORD_4, GL_MAP2_TEXTURE_COORD_1, Chapter 1. OpenGL Subroutines 113 GL_MAP2_TEXTURE_COORD_2, GL_MAP2_TEXTURE_COORD_3, or GL_MAP2_TEXTURE_COORD_4 is enabled, an appropriate glTexCoord subroutine is simulated. The GL uses evaluated values instead of current values for those evaluations that are enabled, and current values otherwise, for color, color index, normal, and texture coordinates. However, the evaluated values do not update the current values. Thus if glVertex subroutines are interspersed with glEvalCoord subroutines, the color, normal, and texture coordinates associated with the glVertex subroutines will not be affected by the values generated by the glEvalCoord subroutines, but rather only by the most recent glColor, glIndex, glNormal, and glTexCoord subroutines. No subroutines are issued for maps that are not enabled. If more than one texture evaluation is enabled for a particular dimension (for example, GL_MAP2_TEXTURE_COORD_1 and GL_MAP2_TEXTURE_COORD_2), only the evaluation of the map that produces the larger number of coordinates (in this case, GL_MAP2_TEXTURE_COORD_2) is carried out. GL_MAP1_VERTEX_4 overrides GL_MAP1_VERTEX_3, and GL_MAP2_VERTEX_4 overrides GL_MAP2_VERTEX_3 in the same manner. If neither a three-component nor a four-component vertex map is enabled for the specified dimension, the glEvalCoord subroutine is ignored. If automatic normal generation is enabled by calling glEnable with argument GL_AUTO_NORMAL, glEvalCoord2 generates surface normals analytically, regardless of the contents or enabling of the GL_MAP2_NORMAL map. Let: m = (delta p / delta u) (delta p / delta v) Then the generated normal n is n = m/||m|| If automatic normal generation is disabled, the corresponding normal map GL_MAP2_NORMAL, if enabled, is used to produce a normal. If neither automatic normal generation nor a normal map is enabled, no normal is generated for glEvalCoord2 subroutines. Parameters glEvalCoord1d u v Specifies a value that is the domain coordinate u to the basis function defined in a previous glMap1 or glMap2 subroutine. Specifies a value that is the domain coordinate v to the basis function defined in a previous glMap2 subroutine. This argument is not present in an glEvalCoord1 subroutine. glEvalCoord1dv u Specifies a pointer to an array containing either one or two domain coordinates. The first coordinate is u. The second coordinate is v, and is present only in glEvalCoord2 versions. Associated Gets Associated gets for the glEvalCoord subroutine are as follows. (See the glGet subroutine for more information.) glIsEnabled with argument GL_MAP1_VERTEX_3. glIsEnabled with argument GL_MAP1_VERTEX_4. glIsEnabled with argument GL_MAP1_INDEX. 114 OpenGL 2.1 Reference Manual glIsEnabled with argument GL_MAP1_COLOR_4. glIsEnabled with argument GL_MAP1_NORMAL. glIsEnabled with argument GL_MAP1_TEXTURE_COORD_1. glIsEnabled with argument GL_MAP1_TEXTURE_COORD_2. glIsEnabled with argument GL_MAP1_TEXTURE_COORD_3. glIsEnabled with argument GL_MAP1_TEXTURE_COORD_4. glIsEnabled with argument GL_MAP2_VERTEX_3. glIsEnabled with argument GL_MAP2_VERTEX_4. glIsEnabled with argument GL_MAP2_INDEX. glIsEnabled with argument GL_MAP2_COLOR_4. glIsEnabled with argument GL_MAP2_NORMAL. glIsEnabled with argument GL_MAP2_TEXTURE_COORD_1. glIsEnabled with argument GL_MAP2_TEXTURE_COORD_2. glIsEnabled with argument GL_MAP2_TEXTURE_COORD_3. glIsEnabled with argument GL_MAP2_TEXTURE_COORD_4. glIsEnabled with argument GL_AUTO_NORMAL. glGetMap. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColor subroutine, glEnable or Disable subroutine, glEvalMesh subroutine, glEvalPoint subroutine, glIndex subroutine, glMap1 subroutine, glMap2 subroutine, glMapGrid subroutine, glNormal subroutine, glTexCoord subroutine, glVertex subroutine. glEvalMesh Subroutine Purpose Computes a one-dimensional (1D) or two-dimensional (2D) grid of points or lines. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 115 C Syntax void glEvalMesh1(GLenum GLint i1, GLint i2) Mode, void glEvalMesh2(GLenum GLint i1, GLint i2, GLint j1, GLint j2) Mode, Description The glMapGrid and glEvalMesh subroutines are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. The glEvalMesh subroutine steps through the integer domain of a 1D or 2D grid whose range is the domain of the evaluation maps specified by glMap1 and glMap2. The Mode parameter determines whether the resulting vertices are connected as points, lines, or filled polygons. In the 1D case, glEvalMesh1, the mesh is generated as if the following code fragment was executed: glBegin(Type); for (i = i1; i <= i2; i += 1) glEvalCoord1(i (DELTA u) + u1) glEnd(); where DELTA u = (u2 - u1 )/n and n, u1, and u2 are the arguments to the most recent glMapGrid1 subroutine. Type is GL_POINTS if Mode is GL_POINT, or GL_LINES if Mode is GL_LINE. The one absolute numeric requirement is that if i = n, the value computed from i (DELTA u) + u1 is exactly u2. In the 2D case, glEvalMesh2, DELTA u = (u2 - u1)/n and DELTA v = (v2 - v1)/m, where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2 subroutine. Then, if Mode is GL_FILL, the glEvalMesh2 subroutine is equivalent to: for (j = j1; j < j2; j += 1) { glBegin(GL_QUAD_STRIP) for (i= i1; i <= i2; i += 1) { glEvalCoord2(i (DELTA u) + u1, j (DELTA v) + v1); glEvalCoord2(i (DELTA u) + u1, (j+1) (DELTA v) + v1); } glEnd(); } If Mode is GL_LINE, a call to glEvalMesh2 is equivalent to: for (j = j1; j <= j2; j += 1) { glBegin(GL_LINE_STRIP) for (i = i1; i <= i2; i += 1) glEvalCoord2(i DELTA u + u1, j (DELTA v) + v1); glEnd(); } for (i = i1; i <= i2; i += 1) { glBegin(GL_LINE_STRIP); for (j = j1; j <= j1; j += 1) glEvalCoord2(i (DELTA u + u1, j (DELTA v) + v1); glEnd(); } And finally, if Mode is GL_POINT, a call to glEvalMesh2 is equivalent to: 116 OpenGL 2.1 Reference Manual glBegin(GL_POINTS); for (j = j1; j <= j2; j += 1) { for (i = i1; i <= i2; i += 1) { glEvalCoord2(i (DELTA u) + u1, j (DELTA v) + v1): } } glEnd(); In all three cases, the only absolute numeric requirements are that if i = n, the value computed from i (DELTA u) + u1 is exactly u2, and if j = m, the value computed from j (DELTA v) + v1 is exactly v2. Parameters glEvalMesh1 Mode i1 i2 Specifies whether to compute a 1D mesh of points or lines. Symbolic constants GL_POINT and GL_LINE are accepted. Specifies the first integer values for grid domain variable i. Specifies the last integer values for grid domain variable i. glEvalMesh2 Mode i1 i2 j1 j2 Specifies whether to compute a 2D mesh of points, lines, or polygons. Symbolic constants GL_POINT, GL_LINE, and GL_FILL are accepted. Specifies the first integer values for grid domain variable i. Specifies the last integer values for grid domain variable i. Specifies the first integer values for grid domain variable j. Specifies the last integer values for grid domain variable j. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Indicates that Mode is not an accepted value. Indicates that glEvalMesh is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glEvalMesh subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MAP1_GRID_DOMAIN glGet with argument GL_MAP2_GRID_DOMAIN glGet with argument GL_MAP1_GRID_SEGMENTS glGet with argument GL_MAP2_GRID_SEGMENTS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Chapter 1. OpenGL Subroutines 117 Related Information The glBegin or glEnd subroutine, glEvalCoord subroutine, glEvalPoint subroutine, glMap1 subroutine, glMap2 subroutine, glMapGrid subroutine. glEvalPoint Subroutine Purpose Generates and evaluates a single point in a mesh. Library OpenGL C bindings library: libGL.a C Syntax void glEvalPoint1(GLint i) void glEvalPoint2(GLint GLint j) i, Description The glMapGrid and glEvalMesh subroutines are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. glEvalPoint can be used to evaluate a single grid point in the same grid space that is traversed by glEvalMesh. Calling glEvalPoint1 is equivalent to calling EvalCoord1(i (DELTA u) + u1); where DELTA u = (u2 - u1)/n and n, u1, and u2 are the arguments to the most recent glMapGrid1 subroutine. The one absolute numeric requirement is that if i = n, the value computed from i (DELTA u) + u1 is exactly u2. In the two-dimensional case, glEvalPoint2, let DELTA u = (u2 - u1 )/n DELTA v = (v2 - v1 )/m where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2 subroutine. Then the glEvalPoint2 subroutine is equivalent to calling: EvalCoord2(i (DELTA u) + u1, j (DELTA v) + v1) The only absolute numeric requirements are that if i = n, the value computed from i (DELTA u) + u1 is exactly u2, and if j = m, the value computed from j (DELTA v) + v1 is exactly v2. Parameters i j Specifies the integer value for grid domain variable i. Specifies the integer value for grid domain variable j. (This parameter applies to glEvalPoint2 only.) Associated Gets Associated gets for the glEvalPoint subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MAP1_GRID_DOMAIN. 118 OpenGL 2.1 Reference Manual glGet with argument GL_MAP2_GRID_DOMAIN. glGet with argument GL_MAP1_GRID_SEGMENTS. glGet with argument GL_MAP2_GRID_SEGMENTS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glEvalCoord subroutine, glEvalMesh subroutine, glMap1 subroutine, glMap2 subroutine, glMapGrid subroutine. glFeedbackBuffer Subroutine Purpose Controls the feedback mode. Library OpenGL C bindings library: libGL.a C Syntax void glFeedbackBuffer(GLsizei GLenum Type, GLfloat * Buffer) Size, Description The glFeedbackBuffer subroutine controls feedback. Feedback, like selection, is a GL mode. The mode is selected by calling glRenderMode with GL_FEEDBACK. When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using the GL. The glFeedbackBuffer subroutine has three arguments: v Buffer is a pointer to an array of floating point values into which feedback information is placed. v Size indicates the size of the array. v Type is a symbolic constant describing the information that is fed back for each vertex. The glFeedbackBuffer subroutine must be issued before feedback mode is enabled (by calling glRenderMode with argument GL_FEEDBACK). Setting GL_FEEDBACK without establishing the feedback buffer, or calling glFeedbackBuffer while the GL is in feedback mode, results in an error. The GL is taken out of feedback mode by calling glRenderMode with a parameter value other than GL_FEEDBACK. When this is done while the GL is in feedback mode, glRenderMode returns the number of entries placed in the feedback array. The returned value never exceeds Size. If the feedback data requires more room than is available in Buffer, glRenderMode returns a negative value. While in feedback mode, each primitive that would be rasterized generates a block of values that get copied into the feedback array. If doing so would cause the number of entries to exceed the maximum, the block is partially written so as to fill the array (if there is any room left at all), and an overflow flag is set. Chapter 1. OpenGL Subroutines 119 Each block begins with a code indicating the primitive type, followed by values that describe the primitive’s vertices and associated data. Entries are also written for bitmaps and pixel rectangles. Feedback occurs after polygon culling and glPolyMode interpretation of polygons has taken place, so polygons that are culled are not returned in the feedback buffer. It can also occur after polygons with more than three edges are broken up into triangles, if the GL implementation renders polygons by performing this decomposition. The glPassThrough subroutine can be used to insert a marker into the feedback buffer. (See glPassThrough.) Following is the grammar for the blocks of values written into the feedback buffer. Each primitive is indicated with a unique identifying value followed by some number of vertices. Polygon entries include an integer value indicating how many vertices follow. A vertex is fed back as some number of floating-point values, as determined by Type. Colors are fed back as four values in red, green, blue, alpha (RGBA) mode and one value in color index mode. feedbackList feedbackItem point lineSegment polygon polySpec bitmap pixelRectangle passThru vertex 2d 3d 3dColor 3dColorTexture 4dColorTexture color rgba index tex -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> feedbackItem feedbackList | feedbackItem point | lineSegment | polygon | bitmap | pixelRectangle | passThru GL_POINT_TOKEN vertex GL_LINE_TOKEN vertex vertex | GL_LINE_RESET_TOKEN vertex vertex GL_POLYGON_TOKEN n polySpec polySpec vertex | vertex vertex vertex GL_BITMAP_TOKEN vertex GL_DRAW_PIXEL_TOKEN vertex | GL_COPY_PIXEL_TOKEN vertex GL_PASS_THROUGH_TOKEN value 2d | 3d | 3dColor | 3dColorTexture | 4dColorTexture value value value value value value value value color value value value color tex value value value value color tex rgba | index value value value value value value value value value where value is a floating-point number, and n is a floating-point integer giving the number of vertices in the polygon. GL_POINT_TOKEN, GL_LINE_TOKEN, GL_LINE_RESET_TOKEN, GL_POLYGON_TOKEN, GL_BITMAP_TOKEN, GL_DRAW_PIXEL_TOKEN, GL_COPY_PIXEL_TOKEN and GL_PASS_THROUGH_TOKEN are symbolic floating-point constants. GL_LINE_RESET_TOKEN is returned whenever the line stipple pattern is reset. The data returned as a vertex depends on the feedback Type. The following table gives the correspondence between Type and the number of values per vertex. The variable k is 1 in color index mode and 4 in RGBA mode. Type Coordinates GL_2D x, y 2 GL_3D x, y, z 3 GL_3D_COLOR x, y, z k GL_3D_COLOR_TEXTURE x, y, z k 4 7+k GL_4D_COLOR_TEXTURE x, y, z, w k 4 8+k 120 OpenGL 2.1 Reference Manual Color Texture Total Number of Values 3+k Feedback vertex coordinates are in window coordinates, except w, which is in clip coordinates. Feedback colors are lighted, if lighting is enabled. Feedback texture coordinates are generated, if texture coordinate generation is enabled. They are always transformed by the texture matrix. Parameters Size Type Buffer Specifies the maximum number of values that can be written into Buffer. Specifies a symbolic constant that describes the information that is returned for each vertex. GL_2D, GL_3D, GL_3D_COLOR, GL_3D_COLOR_TEXTURE, and GL_4D_COLOR_TEXTURE are accepted. Returns the feedback data. Notes The glFeedbackBuffer subroutine, when used in a display list, is not compiled into the display list but rather is executed immediately. Errors GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_OPERATION GL_INVALID_OPERATION Type is not an accepted value. Size is negative. The glFeedbackBuffer subroutine is called while the render mode is GL_FEEDBACK, or glRenderMode is called with argument GL_FEEDBACK before glFeedbackBuffer is called at least once. The glFeedbackBuffer subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glFeedbackBuffer subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_RENDER_MODE. glGetPointerv with argument GL_FEEDBACK_BUFFER_POINTER. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glGetPointerv subroutine, glLineStipple subroutine, glPassThrough subroutine, glPolygonMode subroutine, glRenderMode subroutine, glSelectBuffer subroutine. glFinish Subroutine Purpose Blocks until all GL execution is complete. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 121 C Syntax void glFinish( void ) Description The glFinish subroutine does not return until the effects of all previously called GL subroutines are complete. Such effects include all changes to the GL state, all changes to the connection state, and all changes to the frame buffer contents. Notes The glFinish subroutine requires a round-trip to the server. Errors GL_INVALID_OPERATION The glFinish subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFlush subroutine, glWaitGL subroutine, glWaitX subroutine. glFlush Subroutine Purpose Forces the running of GL subroutines in finite time. Library OpenGL C bindings library: libGL.a C Syntax void glFlush( void ) Description Different GL implementations buffer subroutines in several different locations, including network buffers and the graphics accelerator itself. The glFlush subroutine empties all of these buffers, causing all issued subroutines to be executed as quickly as they are accepted by the actual rendering engine. Though this execution cannot be completed in any particular time period, it does complete in finite time. Because any GL program might be executed over a network, or on an accelerator that buffers subroutines, all programs should call glFlush whenever they must have all of their previously issued subroutines completed. For example, call glFlush before waiting for user input that depends on the generated image. Notes The glFlush subroutine can return at any time. It does not wait until the execution of all previously issued OpenGL commands is complete. 122 OpenGL 2.1 Reference Manual Errors GL_INVALID_OPERATION The glFlush subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFinish subroutine. glFog Subroutine Purpose Specifies fog parameters. Library OpenGL C bindings library: libGL.a C Syntax void glFogf(GLenum ParameterName, GLfloat ParameterValue) void glFogi(GLenum ParameterName, GLint ParameterValue) void glFogfv(GLenum ParameterName, const GLfloat * ParameterValues) void glFogiv(GLenum ParameterName, const GLint * ParameterValues) Description The glFog subroutine is enabled and disabled with glEnable and glDisable using the argument GL_FOG. While enabled, fog affects rasterized geometry, bitmaps, and pixel blocks, but not buffer clear operations. The glFog subroutine assigns the value or values in ParameterValues to the fog parameter specified by ParameterName. The accepted values for ParameterName are: GL_FOG_MODE GL_FOG_DENSITY ParameterValues is a single integer or floating-point value that specifies the equation to be used to compute the fog blend factor, f. Three symbolic constants are accepted: GL_LINEAR, GL_EXP, and GL_EXP2. The equations corresponding to these symbolic constants are defined in the following sections. The default fog mode is GL_EXP. ParameterValues is a single integer or floating-point value that specifies Density, the fog density used in both exponential fog equations. Only nonnegative densities are accepted. The default fog density is 1.0. Chapter 1. OpenGL Subroutines 123 GL_FOG_START GL_FOG_END GL_FOG_INDEX GL_FOG_COLOR GL_FOG_COORDINATE_SOURCE_EXT ParameterValues is a single integer or floating-point value that specifies Start, the near distance used in the linear fog equation. The default near distance is 0.0. ParameterValues is a single integer or floating-point value that specifies End, the far distance used in the linear fog equation. The default far distance is 1.0. ParameterValues is a single integer or floating-point value that specifies if, the fog color index. The default fog index is 0.0. ParameterValues contains four integer or floating-point values that specify Cf, the fog color. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. After conversion, all color components are clamped to the range [0,1]. The default fog color is (0,0,0,0). ParameterValues is a single integer or floating point value that specifies the source for the fog coordinates. Two symbolic constants are accepted: GL_FOG_COORDINATE_EXT and GL_FRAGMENT_DEPTH_EXT. Their use is described below. The default fog coordinate source is GL_FRAGMENT_DEPTH_EXT. Fog blends a fog color with each rasterized pixel fragment’s post-texturing color using a blending factor f. Factor f is computed in one of three ways, depending on the fog mode, using one of two values, depending on the fog coordinate source. If the fog coordinate source is GL_FOG_COORDINATE_EXT then z in the equations below comes from the current fog coordinate. Otherwise, it comes from the fragment’s distance from the origin in eye coordinates. The equation for GL_LINEAR fog is: f = end – z end – start Figure 1. Equation for GL_LINEAR Fog. This figure shows that f is equal to end–z / end–start. The equation for GL_EXP fog is: . f = e (–density z) Figure 2. Equation for GL_EXP Fog. This figure shows that f is equal to e(-density*z). The equation for GL_EXP2 fog is: 124 OpenGL 2.1 Reference Manual . 2 f = e (–density z) Figure 3. Equation for GL_EXP2 Fog. This figure shows that f is equal to e(-density*z) to the power of two. Regardless of the fog mode, f is clamped to the range [0,1] after it is computed. Then, if the GL is in red, green, blue, alpha (RGBA) color mode, the fragment’s color, Cr, is replaced by the following: Cr prime = fCr + (1 - f) Cf In color index mode, the fragment’s color index, ir, is replaced by the following: ir prime = ir + (1 - f) if Parameters glFogf and glFogi ParameterName ParameterValue Specifies a single-valued fog parameter. GL_FOG_DENSITY, GL_FOG_END, GL_FOG_INDEX, GL_FOG_MODE, GL_FOG_START, and GL_FOG_COORDINATE_SOURCE_EXT are accepted. Specifies the value to which ParameterName is set. glFogfv and glFogiv ParameterName ParameterValues Specifies a fog parameter. GL_FOG_COLOR, GL_FOG_DENSITY, GL_FOG_END, GL_FOG_INDEX, GL_FOG_MODE, GL_FOG_START, and GL_FOG_COORDINATE_SOURCE_EXT are accepted. Specifies the value or values to be assigned to ParameterName. GL_FOG_COLOR requires an array of four values. All other parameters accept an array containing only a single value. Errors GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_VALUE GL_INVALID_ENUM ParameterName is not an accepted value. The glFog subroutine is called between a call to glBegin and the corresponding call to glEnd. ParameterName is GL_FOG_DENSITY and ParameterValues is negative. ParameterName is GL_FOG_COORDINATE_SOURCE_EXT and ParameterValues is not one of the two permitted values. Associated Gets Associated gets for the glFog subroutine are as follows. (See the glGet subroutine for more information.) glIsEnabled with argument GL_FOG. glGet with argument GL_FOG_COLOR. glGet with argument GL_FOG_INDEX. glGet with argument GL_FOG_DENSITY. Chapter 1. OpenGL Subroutines 125 glGet with argument GL_FOG_START. glGet with argument GL_FOG_END. glGet with argument GL_FOG_MODE. glGet with argument GL_CURRENT_FOG_COORDINATE_EXT. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable or glDisable subroutine. glFogCoordEXT Subroutine Purpose Specifies a Fog Coordinate. Library OpenGL C bindings library: (libGL.a) C Syntax void void void void glFogCoordfEXT(GLfloat coord) glFogCoorddEXT(GLdouble coord) glFogCoordfvEXT(GLfloat *Variable) glFogCoorddvEXT(GLdouble *Variable) Description This extension allows specifying an explicit per-vertex fog coord to be used in fog computations, rather than using a fragment depth-based fog equation. Parameters coord Variable specifies the fog coordinate, which is used in computing the fogging effect, as described in glFog. This coordinate is used in place of the distance in eye coordinates from the origin to the fragment being fogged. specifies a pointer to a one-element array containing a fog coordinate. Files /usr/include/GL/gl.h 126 OpenGL 2.1 Reference Manual Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFog subroutine, the glFogCoordPointerEXT subroutine, the glFogCoordPointerListIBM subroutine. glFogCoordPointerEXT Subroutine Purpose Specifies an array of fog coordinates. Library OpenGL C bindings library: (libGL.a) C Syntax void glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *pointer) Description The glFogCoordPointerEXT extension specifies the location and data format of an array of fog coordinates to use when rendering. The type parameter specifies the data type of each fog coordinate, and stride gives the byte stride from one coordinate to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). When a fog coordinate array is specified, type, stride, and pointer are saved as client side state. To enable and disable the fog coordinate array, call glEnableClientState and glDisableClientState with the argument GL_FOG_COORDINATE_ARRAY_EXT. If enabled, the fog coordinate array is used when glDrawArrays, glDrawElements or glArrayElement is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Fog Coord array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type stride pointer specifies the data type of each fog coordinate in the array. Symbolic constants GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. specifies the byte offset between consecutive fog coordinates. If stride is zero (the initial value), the coordinates are understood to be tightly packed in the array. The initial value is 0. specifies a pointer to the first component of the first fog coordinate in the array. The initial value is 0 (NULL pointer). Chapter 1. OpenGL Subroutines 127 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElement subroutine, the glColorPointer subroutine, the glDrawArrays subroutine, the glDrawElements subroutine, the glEdgeFlagPointer subroutine, the glEnable subroutine, the glFogCoordPointerListIBM subroutine, the glGetPointerv subroutine, the glIndexPointer subroutine, the glInterleavedArrays subroutine, the glNormalPointer subroutine, the glPushClientAttrib or glPopClientAttrib subroutine, the glTexCoordPointer subroutine, the glVertexPointer subroutine. glFogCoordPointerListIBM Subroutine Purpose Defines a list of arrays of fog coordinates. Library OpenGL C bindings library: (libGL.a) C Syntax void glFogCoordPointerListIBM ( GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride) Description The glFogCoordPointerListIBM subroutine specifies the location and data format of a list of arrays of fog coordinates to use when rendering. The type parameter specifies the data type of each fog coordinate. The stride parameter gives the byte stride from one coordinate to the next, allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). The ptrstride parameter specifies the byte stride from one pointer to the next in the pointer array. When a fog coordinate array is specified, type, stride, pointer and ptrstride are saved as client side state. A stride value of 0 does not specify a ″tightly packed″ array as it does in glFogCoordPointer. Instead, it causes the first array element of each array to be used for each vertex. Also, a negative value can be used for stride, which allows the user to move through each array in reverse order. To enable and disable the fog coordinate arrays, call glEnableClientState and glDisableClientState with the argument GL_COLOR_ARRAY. The fog coordinate array is initially disabled. When enabled, the fog coordinate arrays are used when glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glDrawArrays, glDrawElements or glArrayElement is called. The last three calls in this list will only use the first array (the one pointed at by pointer[0]). See the descriptions of these routines for more information on their use. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. 128 OpenGL 2.1 Reference Manual If enabled, the Fog Coord array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type stride pointer ptrstride specifies the data type of each fog coordinate in the arrays. Symbolic constants GL_FLOAT or GL_DOUBLE are accepted. The initial value is GL_FLOAT. specifies the byte offset between consecutive fog coordinates. The initial value is 0. specifies a list of fog coordinate arrays. The initial value is 0 (NULL pointer). specifies the byte stride between successive pointers in the pointer array. The initial value is 0. Notes The glFogCoordPointerListIBM subroutine is available only if the GL_IBM_vertex_array_lists extension is supported. Execution of glFogCoordPointerListIBM is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glFogCoordPointerListIBM subroutine is typically implemented on the client side. Since the fog coordinate array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When a glFogCoordPointerListIBM call is encountered while compiling a display list, the information it contains does NOT contribute to the display list, but is used to update the immediate context instead. The glFogCoordPointerEXT call and the glFogCoordPointerListIBM call share the same state variables. A glFogCoordPointerEXT call will reset the fog coordinate list state to indicate that there is only one fog coordinate list, so that any and all lists specified by a previous glFogCoordPointerListIBM call will be lost, not just the first list that it specified. Error Codes GL_INVALID_ENUM is generated if type is not an accepted value. Associated Gets Associated gets for the glFogCoordPointerListIBM subroutine are as follows. (See the glGet subroutine for more information.) glIsEnabled with argument GL_FOG_COORDINATE_ARRAY_EXT. glGetPointerv with argument GL_FOG_COORDINATE_ARRAY_POINTER_EXT. glGet with arguement GL_CURRENT_FOG_COORDINATE. glGet with arguement GL_FOG_COORDINATE_ARRAY_TYPE_EXT. glGet with arguement GL_FOG_COORDINATE_ARRAY_STRIDE_EXT. Chapter 1. OpenGL Subroutines 129 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElement subroutine, the glColorPointer subroutine, the glDrawArrays subroutine, the glDrawElements subroutine, the glEdgeFlagPointer subroutine, the glEnable subroutine, the glFogCoordPointerEXT subroutine, the glGetPointerv subroutine, the glIndexPointer subroutine, the glInterleavedArrays subroutine, the glMultiDrawArraysEXT subroutine, the glMultiDrawElementsEXT subroutine, the glMultiModeDrawArraysIBM subroutine, the glMultiModeDrawElementsIBM subroutine, the glNormalPointer subroutine, the glPushClientAttrib or glPopClientAttrib subroutine, the glTexCoordPointer subroutine, the glVertexPointer subroutine. glFrontFace Subroutine Purpose Defines frontfacing and backfacing polygons. Library OpenGL C bindings library: libGL.a C Syntax void glFrontFace(GLenum Mode) Description In a scene composed entirely of opaque closed surfaces, backfacing polygons are never visible. Eliminating these invisible polygons speeds up the rendering of the image. Backface elimination is enabled and disabled with glEnable and glDisable using argument GL_CULL_FACE. The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon’s winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. The glFrontFace subroutine specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be frontfacing. Passing GL_CCW to the Mode parameter selects counterclockwise polygons as frontfacing; GL_CW selects clockwise polygons as frontfacing. By default, counterclockwise polygons are taken to be frontfacing. Parameters Mode Specifies the orientation of frontfacing polygons. GL_CW and GL_CCW are accepted. The default value is GL_CCW. Errors GL_INVALID_ENUM GL_INVALID_OPERATION 130 OpenGL 2.1 Reference Manual Mode is not an accepted value. The glFrontFace subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glFrontFace subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_FRONT_FACE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glCullFace subroutine, glLightModel subroutine. glFrustum Subroutine Purpose Multiplies the current matrix by a perspective matrix. Library OpenGL C bindings library: libGL.a C Syntax void glFrustum(GLdouble GLdouble Right, GLdouble Bottom, GLdouble Top, GLdouble Near, GLdouble Far) Left, Description The glFrustum subroutine describes a perspective matrix that produces a perspective projection. The parameters (Left, Bottom, -Near) and (Right, Top, -Near) specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the window, respectively, assuming that the eye is located at (0, 0, 0). -Far specifies the location of the far clipping plane. Both Near and Far must be positive. The corresponding matrix is: Chapter 1. OpenGL Subroutines 131 2 Near Right–Left 0 A 0 0 B 0 0 2 Near Top–Bottom 0 C D 0 0 –1 0 Figure 4. Perspective Projection Perspective Matrix. This diagram shows a matrix enclosed in brackets. The matrix consists of four lines containing four characters each. The first line contains the following (from left to right): 2Near / Right-Left, zero, A, zero. The second line contains the following (from left to right): zero, 2Near / Top-Bottom, B, zero. The third line contains the following (from left to right): zero, zero, C, D. The fourth line contains the following (from left to right): zero, zero, -1, zero. where the following statements apply: A= Right+Left Right–Left B= Top+Bottom Top–Bottom C= Far+Near Far–Near D= 2 Far Near Far–Near Figure 5. Statements. This figure shows the equations used to find the values of A, B, C, and D in the matrix above. In the first equation, A equals Right+Left / Right-Left. In the second equation, B equals Top+Bottom / Top-Bottom. In the third equation, C equals Far+Near / Far-Near. In the fourth equation, D equals 2FarNear / Far-Near. The current matrix is multiplied by this matrix with the result replacing the current matrix. That is, if M is the current matrix and F is the frustum perspective matrix, M is replaced with MF. Use glPushMatrix and glPopMatrix to save and restore the current matrix stack. Parameters Left Right Bottom Top Near Far Specifies Specifies Specifies Specifies Specifies Specifies a point on the left side of the clipping plane a point on the right side of the clipping plane. a point on the bottom of the clipping plane. a point on the top of the clipping plane. the location of the near clipping plane. This must be a positive value. the location of the far clipping plane. This must be a positive value. Notes Depth buffer precision is affected by the values specified for Near and Far. The greater the ratio of Far to Near is, the less effective the depth buffer will be at distinguishing between surfaces that are near each other. If r = Far / Near, roughly log2r bits of depth buffer precision are lost. Because r approaches infinity as Near approaches 0 (zero), Near must never be set to 0. Errors GL_INVALID_VALUE 132 OpenGL 2.1 Reference Manual Either Near or Far is not positive. GL_INVALID_OPERATION The glFrustum subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glFrustum subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE. glGet with argument GL_MODELVIEW_MATRIX. glGet with argument GL_PROJECTION_MATRIX. glGet with argument GL_TEXTURE_MATRIX. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glOrtho subroutine, glPushMatrix or glPopMatrix subroutine, glViewport subroutine. glGenLists Subroutine Purpose Generates a contiguous set of empty display lists. Library OpenGL C bindings library: libGL.a C Syntax GLuint glGenLists(GLsizei Range) Description The glGenLists subroutine has one argument, Range. It returns an integer n such that Range contiguous empty display lists, named n, n+1, ..., n+Range-1, are created. If Range is 0 (zero), if there is no group of Range contiguous names available, or if any error is generated, no display lists are generated, and 0 is returned. Parameters Range Specifies the number of contiguous empty display lists to be generated. Errors GL_INVALID_VALUE Range is negative. Chapter 1. OpenGL Subroutines 133 GL_INVALID_OPERATION The glGenLists subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glGenLists subroutine are as follows. (See the glGet subroutine for more information.) glIsList. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallList subroutine, glCallLists subroutine, glDeleteLists subroutine, glNewList subroutine. glGenTextures Subroutine Purpose Generate texture names. Library OpenGL C bindings library: libGL.a C Syntax void glGenTextures(GLsizei GLuint *textures) n, Parameters n textures Specifies the number of texture names to be generated. Specifies an array in which the generated texture names are stored. Description The glGenTextures subroutine returns n texture names in textures. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to glGenTextures. The generated textures have no dimensionality; they assume the dimensionality of the texture target to which they are first bound (see glBindTexture). Texture names returned by a call to glGenTextures are not returned by subsequent calls, unless they are first deleted with glDeleteTextures. The glGenTextures subroutine is not included in display lists. 134 OpenGL 2.1 Reference Manual Notes The glGenTextures subroutine is available only if the GL version is 1.1 or greater. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_OPERATION is generated if glGenTextures is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsTexture Related Information The glBindTexture subroutine, glDeleteTextures subroutine, glGet subroutine, glGetTexParameter subroutine, glIsTexture subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. glGenTexturesEXT Subroutine Purpose Generates texture names. Library OpenGL C bindings library: libGL.a C Syntax void glGenTexturesEXT(GLsizei GLuint * textures) n, Description glGenTexturesEXT returns n texture names in textures. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to glGenTexturesEXT. The generated textures have no dimensionality; they assume the dimensionality of the texture target to which they are first bound (see glBindTextureEXT). Texture names returned by a call to glGenTexturesEXT will not be returned by subsequent calls, unless they are first deleted with glDeleteTexturesEXT. glGenTexturesEXT is not included in display lists. Parameters n textures The number of texture names to be generated. An array in which the generated texture names are stored. Chapter 1. OpenGL Subroutines 135 Notes glGenTexturesEXT is part of the EXT_texture_object extension, not part of the core GL command set. If GL_EXT_texture_object is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_texture_object is supported by the connection. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_OPERATION is generated if glGenTexturesEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsTextureEXT. File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBindTextureEXT subroutine, glDeleteTexturesEXT subroutine, glGet subroutine, glGetTexParameter subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. glGet Subroutine Purpose Returns the value or values of a selected parameter. Library OpenGL C bindings library: libGL.a C Syntax void glGetBooleanv( GLenum ParameterName, GLBoolean * ParameterValues) void glGetDoublev(GLenum ParameterName, GLdouble * ParameterValues ) void glGetFloatv(GLenum ParameterName, GLfloat * ParameterValues) void glGetIntegerv(GLenum ParameterName, GLint ParameterValues) Description The four commands, glGetBooleanv, glGetDoublev, glGetFloatv, and glGetIntegerv, return values for simple-state variables in GL. ParameterName is a symbolic constant indicating the state variable to be returned, and ParameterValues is a pointer to an array of the indicated type in which to place the returned data. 136 OpenGL 2.1 Reference Manual Type conversion is performed if ParameterValues has a different type than the state variable value being requested. If glGetBooleanv is called, a floating-point or integer value is converted to GL_FALSE if and only if it is 0 (zero). Otherwise, it is converted to GL_TRUE. If glGetIntegerv is called, Boolean values are returned as GL_TRUE or GL_FALSE, and most floating-point values are rounded to the nearest integer value. Floating-point colors and normals, however, are returned with a linear mapping that maps 1.0 to the most positive representable integer value, and -1.0 to the most negative representable integer value. If either glGetFloatv or glGetDoublev is called, Boolean values are returned as GL_TRUE or GL_FALSE, and integer values are converted to floating-point values. The following symbolic constants are accepted by ParameterName: GL_ACCUM_ALPHA_BITS GL_ACCUM_BLUE_BITS GL_ACCUM_CLEAR_VALUE GL_ACCUM_GREEN_BITS GL_ACCUM_RED_BITS GL_ALIASED_LINE_WIDTH_RANGE GL_ALIASED_POINT_SIZE_RANGE GL_ALPHA_BIAS GL_ALPHA_BITS GL_ALPHA_SCALE GL_ALPHA_TEST GL_ALPHA_TEST_FUNC ParameterValues returns one value, the number of alpha bit planes in the accumulation buffer. ParameterValues returns one value, the number of blue bit planes in the accumulation buffer. ParameterValues returns four values: the red, green, blue, and alpha (RGBA) values used to clear the accumulation buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glClearAccum.) ParameterValues returns one value, the number of green bit planes in the accumulation buffer. ParameterValues returns one value, the number of red bit planes in the accumulation buffer. ParameterValues returns two values: the smallest and largest supported widths for aliased lines. (See glLineWidth.) ParameterValues returns two values: the smallest and largest supported sizes for aliased points. (See glPointSize.) ParameterValues returns one value, the alpha bias factor used during pixel transfers. (See glPixelTransfer.) ParmeterValues returns one value, the number of alpha bit planes in each color buffer. ParameterValues returns one value, the alpha scale factor used during pixel transfers. (See glPixelTransfer.) ParameterValues returns a single Boolean value indicating whether alpha testing of fragments is enabled. (See glAlphaFunc.) ParameterValues returns one value, the symbolic name of the alpha test function. (See glAlphaFunc.) Chapter 1. OpenGL Subroutines 137 GL_ALPHA_TEST_REF GL_ARRAY_ELEMENT_LOCK_FIRST_EXT GL_ARRAY_ELEMENT_LOCK_COUNT_EXT GL_ATTRIB_STACK_DEPTH GL_AUTO_NORMAL GL_AUX_BUFFERS GL_BLEND GL_BLEND_DST GL_BLEND_DST_ALPHA_EXT GL_BLEND_DST_RGB_EXT GL_BLEND_EQUATION_EXT GL_BLEND_SRC GL_BLEND_SRC_ALPHA_EXT GL_BLEND_SRC_RGB_EXT 138 OpenGL 2.1 Reference Manual ParameterValues returns one value, the reference value for the alpha test. (See glAlphaFunc.) An integer value, if requested, is linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. ParameterValues returns one value, the first element in the locked range. (See glLockArraysEXT.) Requires extension EXT_compiled_vertex_array. ParameterValues returns one value, the count of elements in the locked range. (See glLockArraysEXT.) Requires extension EXT_compiled_vertex_array. ParameterValues returns one value, the depth of the attribute stack. If the stack is empty, 0 is returned. (See glPushAttrib.) ParameterValues returns a single Boolean value indicating whether two-dimensional (2D) map evaluation automatically generates surface normals. (See glMap2.) ParameterValues returns one value, the number of auxiliary color buffers. ParameterValues returns a single Boolean value indicating whether blending is enabled. (See glBlendFunc.) ParameterValues returns one value, the symbolic constant identifying the destination blend function. (See glBlendFunc.) ParameterValues returns one value, the symbolic constant identifying the destination alpha separate blend function. (See glBlendFuncSeparate.) ParameterValues returns one value, the symbolic constant identifying the destination RGB separate blend function. (See glBlendFuncSeparate.) ParameterValues returns one value, a symbolic constant indicating the blend equation. (See glBlendEquationEXT.) Requires at least one of the following extensions: EXT_blend_minmax, EXT_blend_color, EXT_blend_subtract, EXT_blend_logic_op. ParameterValues returns one value, the symbolic constant identifying the source blend function. (See glBlendFunc.) ParameterValues returns one value, the symbolic constant identifying the source alpha separate blend function. (See glBlendFuncSeparate.) ParameterValues returns one value, the symbolic constant identifying the source RGB separate blend function. (See glBlendFuncSeparate.) GL_BLUE_BIAS GL_BLUE_BITS GL_CLIENT_ATTRIB_STACK_DEPTH GL_BLUE_SCALE GL_CLIP_PLANE GL_COLOR_ARRAY GL_COLOR_ARRAY_COUNT_EXT GL_COLOR_ARRAY_EXT GL_COLOR_ARRAY_LIST_STRIDE_IBM GL_COLOR_ARRAY_SIZE GL_COLOR_ARRAY_SIZE_EXT GL_COLOR_ARRAY_STRIDE GL_COLOR_ARRAY_STRIDE_EXT GL_COLOR_ARRAY_TYPE GL_COLOR_ARRAY_TYPE_EXT ParameterValues returns one value, the blue bias factor used during pixel transfers. (See glPixelTransfer.) ParameterValues returns one value, the number of blue bit planes in each color buffer. ParameterValues returns one value indicating the depth of the attribute stack. The initial value is 0. (See glPushClientAttrib.) ParameterValues returns one value, the blue scale factor used during pixel transfers. (See glPixelTransfer.) ParameterValues returns a single Boolean value indicating whether the specified clipping plane is enabled. (See glClipPlane.) ParameterValues returns a single Boolean value indicating whether the color array is enabled. The initial value is GL_FALSE. (See glColorPointer.) ParameterName returns one value, the number of colors in the color array, counting from the first, that are static. (See glColorPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns a single boolean value, indicating whether the color array is enabled. (See glColorPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the byte stride between successive pointers to color lists. The initial value is 0. (See glColorPointerListIBM.) Requires extension IBM_vertex_array_lists. ParameterValues returns one value, the number of components per color in the color array. The initial value is 4. (See glColorPointer.) ParameterValues returns one value, the number of components per color in the color array. (See glColorPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the byte offset between consecutive colors in the color array. The initial value is 0. (See glColorPointer.) ParameterName returns one value, the byte offset between consecutive colors in the color array. (See glColorPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the data type of each component in the color array. The initial value is GL_FLOAT. (See glColorPointer.) ParameterValues returns one value, the data type of each component in the color array. (See glColorPointerEXT.) Requires extension EXT_vertex_array. Chapter 1. OpenGL Subroutines 139 GL_COLOR_CLEAR_VALUE GL_COLOR_LOGIC_OP GL_COLOR_MATERIAL GL_COLOR_MATERIAL_FACE GL_COLOR_MATERIAL_PARAMETER GL_COLOR_MATRIX GL_COLOR_SUM_EXT GL_COLOR_WRITEMASK GL_CULL_FACE GL_CULL_FACE_MODE GL_CURRENT_COLOR GL_CURRENT_FOG_COORDINATE_EXT GL_CURRENT_INDEX 140 OpenGL 2.1 Reference Manual ParameterValues returns four values: the RGBA values used to clear the color buffers. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glClearColor.) ParameterValues returns a single Boolean value indicating whether a fragment’s color values are merged into the framebuffer using a logical operation. The initial value is GL_FALSE. (See glLogicOp.) ParameterValues returns a single Boolean value indicating whether one or more material parameters are tracking the current color. (See glColorMaterial.) ParameterValues returns one value, a symbolic constant indicating which materials have a parameter that is tracking the current color. (See glColorMaterial.) ParameterValues returns one value, a symbolic constant indicating which material parameters are tracking the current color. (See glColorMaterial.) ParameterValues returns 16 values: the color matrix. (See glLoadNamedMatrixIBM.) ParameterValues returns a single Boolean value indicating whether the color sum stage and secondary color handling is enabled. (See glSecondaryColorEXT.) ParameterValues returns four Boolean values: the RGBA write enables for the color buffers. (See glColorMask.) ParameterValues returns a single Boolean value indicating whether polygon culling is enabled. (See glCullFace.) ParameterValues returns one value, a symbolic constant indicating which polygon faces are to be culled. (See glCullFace.) ParameterValues returns four values: the RGBA values of the current color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glColor.) ParameterValues returns one value, the current fog coordinate. (See glFogCoordEXT.) ParameterValues returns one value, the current color index. (See glIndex.) GL_CURRENT_NORMAL GL_CURRENT_RASTER_COLOR GL_CURRENT_RASTER_DISTANCE GL_CURRENT_RASTER_INDEX GL_CURRENT_RASTER_POSITION GL_CURRENT_RASTER_TEXTURE_COORDS GL_CURRENT_RASTER_POSITION_VALID GL_CURRENT_SECONDARY_COLOR GL_CURRENT_TEXTURE_COORDS GL_DEPTH_BIAS GL_DEPTH_BITS GL_DEPTH_CLEAR_VALUE GL_DEPTH_FUNC ParameterValues returns three values: the x, y, and z values of the current normal. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glNormal.) ParameterValues returns four values: the RGBA values of the current raster position. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glRasterPos.) ParameterValues returns one value, the distance from the eye to the current raster position. The initial value is 0. (See glRasterPos.) ParameterValues returns one value, the color index of the current raster position. (See glRasterPos.) ParameterValues returns four values: the x, y, z, and w components of the current raster position. x, y, and z are in window coordinates, w is in clip coordinates. (See glRasterPos.) ParameterValues returns four values: the s, t, r, and q current raster texture coordinates. (See glRasterPos and glTexCoord.) ParameterValues returns a single Boolean value indicating whether the current raster position is valid. (See glRasterPos.) ParameterValues returns a four values: the RGBA values of the secondary color. (See glSecondaryColorEXT.) ParameterValues returns four values: the s, t, r, and q current texture coordinates. (See glTexCoord.) ParameterValues returns one value, the depth bias factor used during pixel transfers. (See glPixelTransfer.) ParameterValues returns one value, the number of bit planes in the depth buffer. ParameterValues returns one value, the value that is used to clear the depth buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glClearDepth.) ParameterValues returns one value, the symbolic constant that indicates the depth comparison function. (See glDepthFunc.) Chapter 1. OpenGL Subroutines 141 GL_DEPTH_RANGE GL_DEPTH_SCALE GL_DEPTH_TEST GL_DEPTH_WRITEMASK GL_DITHER GL_DOUBLEBUFFER GL_DRAW_BUFFER GL_EDGE_FLAG GL_EDGE_FLAG_ARRAY GL_EDGE_FLAG_ARRAY_COUNT_EXT GL_EDGE_FLAG_ARRAY_EXT GL_EDGE_FLAG_LIST_STRIDE_IBM GL_EDGE_FLAG_ARRAY_STRIDE GL_EDGE_FLAG_ARRAY_STRIDE_EXT 142 OpenGL 2.1 Reference Manual ParameterValues returns two values: the near and far mapping limits for the depth buffer. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glDepthRange.) ParameterValues returns one value, the depth scale factor used during pixel transfers. (See glPixelTransfer.) ParameterValues returns a single Boolean value indicating whether depth testing of fragments is enabled. (See glDepthFunc and glDepthRange.) ParameterValues returns a single Boolean value indicating if the depth buffer is enabled for writing. (See glDepthMask.) ParameterValues returns a single Boolean value indicating whether dithering of fragment colors and indices is enabled. ParameterValues returns a single Boolean value indicating whether double buffering is supported. ParameterValues returns one value, a symbolic constant indicating which buffers are being drawn to. (See glDrawBuffer.) ParameterValues returns a single Boolean value indicating whether the current edge flag is True or False. (See glEdgeFlag.) ParameterValues returns a single Boolean value indicating whether the edge flag array is enabled. The initial value is GL_FALSE. (See glEdgeFlagPointer.) ParameterValues returns one value, the number of edge flags in the edge flag array, counting from the first, that are static. (See glEdgeFlagPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns a single boolean value, indicating whether the edge flag array is enabled. (See glEdgeFlagPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the byte stride between successive pointers to edge flag lists. The initial value is 0. (See glEdgeFlagPointerListIBM.) Requires extension IBM_XXX. ParameterValues returns one value, the byte offset between consecutive edge flags in the edge flag array. The initial value is 0. (See glEdgeFlagPointer.) ParameterValues returns one value, the byte offset between consecutive edge flags in the edge flag array. (See glEdgeFlagPointerEXT.) Requires extension EXT_vertex_array. GL_FOG GL_FOG_COLOR GL_FOG_COORDINATE_ARRAY_TYPE_EXT GL_FOG_COORDINATE_ARRAY_STRIDE_EXT GL_FOG_DENSITY GL_FOG_END GL_FOG_HINT GL_FOG_INDEX GL_FOG_MODE GL_FOG_START GL_FRONT_FACE GL_GREEN_BIAS GL_GREEN_BITS GL_GREEN_SCALE GL_INDEX_ARRAY GL_INDEX_ARRAY_COUNT_EXT GL_INDEX_ARRAY_EXT ParameterValues returns a single Boolean value indicating whether fogging is enabled. (See glFog.) ParameterValues returns four values: the RGBA components of the fog color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glFog.) ParameterValues returns one value, the fog coordinate array type. (See glFogCoordPointerEXT.) ParameterValues returns one value, the fog coordinate array stride. (See glFogCoordPointerEXT.) ParameterValues returns one value, the fog density parameter. (See glFog.) ParameterValues returns one value, the end factor for the linear fog equation. (See glFog.) ParameterValues returns one value, a symbolic constant indicating the mode of the fog hint. (See glHint.) ParameterValues returns one value, the fog color index. (See glFog.) ParameterValues returns one value, a symbolic constant indicating which fog equation is selected. (See glFog.) ParameterValues returns one value, the start factor for the linear fog equation. (See glFog.) ParameterValues returns one value, a symbolic constant indicating whether clockwise or counterclockwise polygon winding is treated as frontfacing. (See glFrontFace.) ParameterValues returns one value, the green bias factor used during pixel transfers. ParameterValues returns one value, the number of green bit planes in each color buffer. ParameterValues returns one value, the green scale factor used during pixel transfers. (See glPixelTransfer.) ParameterValues returns a single Boolean value indicating whether the color index array is enabled. The initial value is GL_FALSE. (See glIndexPointer.) ParameterValues returns one value, the number of color indexes in the color index array, counting from the first, that are static. (See glIndexPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns a single boolean value, indicating whether the color index array is enabled. (See glIndexPointerEXT.) Requires extension EXT_vertex_array. Chapter 1. OpenGL Subroutines 143 GL_INDEX_ARRAY_LIST_STRIDE_IBM GL_INDEX_ARRAY_STRIDE GL_INDEX_ARRAY_STRIDE_EXT GL_INDEX_ARRAY_TYPE GL_INDEX_ARRAY_TYPE_EXT GL_INDEX_BITS GL_INDEX_CLEAR_VALUE GL_INDEX_MODE GL_INDEX_OFFSET GL_INDEX_SHIFT GL_INDEX_WRITEMASK GL_LIGHT# (where ’#’ is 0...GL_MAXLIGHTS-1) GL_LIGHTING GL_LIGHT_MODEL_AMBIENT 144 OpenGL 2.1 Reference Manual ParameterValues returns one value, the byte stride between successive pointers to index lists. The initial value is 0. (See glIndexPointerListIBM.) Requires extension IBM_vertex_array_lists. ParameterValues returns one value, the byte offset between consecutive color indexes in the color index array. The initial value is 0. (See glIndexPointer.) ParameterValues returns one value, the byte offset between consecutive color indexes in the color index array. (See glIndexPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the data type of indexes in the color index array. The initial value is GL_FLOAT. (See glIndexPointer.) ParameterValues returns one value, the data type of indexes in the color index array. (See glIndexPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the number of bit planes in each color index buffer. ParameterValues returns one value, the color index used to clear the color index buffers. (See glClearIndex.) ParameterValues returns a single Boolean value indicating whether the GL is in color index mode (True) or RGBA mode (False). ParameterValues returns one value, the offset added to color and stencil indices during pixel transfers. (See glPixelTransfer.) ParameterValues returns one value, the amount that color and stencil indices are shifted during pixel transfers. (See glPixelTransfer.) ParameterValues returns one value, a mask indicating which bit planes of each color index buffer can be written. (See glIndexMask.) ParameterValues returns a single Boolean value indicating whether the specified light is enabled. (See glLight and glLightModel.) ParameterValues returns a single Boolean value indicating whether lighting is enabled. (See glLightModel.) ParameterValues returns four values: the RGBA components of the ambient intensity of the entire scene. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glLightModel.) GL_LIGHT_MODEL_COLOR_CONTROL GL_LIGHT_MODEL_LOCAL_VIEWER GL_LIGHT_MODEL_TWO_SIDE GL_LINE_SMOOTH GL_LINE_SMOOTH_HINT GL_LINE_STIPPLE GL_LINE_STIPPLE_PATTERN GL_LINE_STIPPLE_REPEAT GL_LINE_WIDTH GL_LINE_WIDTH_GRANULARITY GL_LINE_WIDTH_RANGE GL_LIST_BASE GL_LIST_INDEX GL_LIST_MODE GL_LOGIC_OP GL_LOGIC_OP_MODE GL_MAP1_COLOR_4 ParameterValues can be GL_SINGLE_COLOR or GL_SPECULAR_COLOR. GL_SINGLE_COLOR is the default value. Depending upon the ParameterValues, the lighting equations compute the two colors differently. All computations are carried out in eye coordinates. (See glLightModel.) ParameterValues returns a single Boolean value indicating whether specular reflection calculations treat the viewer as being local to the scene. (See glLightModel.) ParameterValues returns a single Boolean value indicating whether separate materials are used to compute lighting for frontfacing and backfacing polygons. (See glLightModel.) ParameterValues returns a single Boolean value indicating whether antialiasing of lines is enabled. (See glLineWidth.) ParameterValues returns one value, a symbolic constant indicating the mode of the line antialiasing hint. (See glHint). ParameterValues returns a single Boolean value indicating whether stippling of lines is enabled. (See glLineStipple.) ParameterValues returns one value, the 16-bit line stipple pattern. (See glLineStipple.) ParameterValues returns one value, the line stipple repeat factor. (See glLineStipple.) ParameterValues returns one value, the line width as specified with glLineWidth. ParameterValues returns one value, the width difference between adjacent supported widths for antialiased lines. (See glLineWidth.) ParameterValues returns two values: the smallest and largest supported widths for antialiased lines. (See glLineWidth.) ParameterValues returns one value, the base offset added to all names in arrays presented to glCallLists. (See glListBase.) ParameterValues returns one value, the name of the display list currently under construction. If no display list is currently under construction, 0 is returned. (See glNewList.) ParameterValues returns one value, a symbolic constant indicating the construction mode of the display list currently being constructed. (See glNewList.) ParameterValues returns a single Boolean value indicating whether fragment indexes are merged into the frame buffer using a logical operation. (See glLogicOp.) ParameterValues returns one value, a symbolic constant indicating the selected logic operational mode. (See glLogicOp.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates colors. (See glMap1.) Chapter 1. OpenGL Subroutines 145 GL_MAP1_GRID_DOMAIN GL_MAP1_GRID_SEGMENTS GL_MAP1_INDEX GL_MAP1_NORMAL GL_MAP1_TEXTURE_COORD_1 GL_MAP1_TEXTURE_COORD_2 GL_MAP1_TEXTURE_COORD_3 GL_MAP1_TEXTURE_COORD_4 GL_MAP1_VERTEX_3 GL_MAP1_VERTEX_4 GL_MAP2_COLOR_4 GL_MAP2_GRID_DOMAIN GL_MAP2_GRID_SEGMENTS GL_MAP2_INDEX GL_MAP2_NORMAL GL_MAP2_TEXTURE_COORD_1 GL_MAP2_TEXTURE_COORD_2 146 OpenGL 2.1 Reference Manual ParameterValues returns two values: the endpoints of the one-dimensional (1D) map’s grid domain. (See glMapGrid.) ParameterValues returns one value, the number of partitions in the 1D map’s grid domain. (See glMapGrid.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates color indices. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates normals. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates 1D texture coordinates. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates 2D texture coordinates. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates 3D texture coordinates. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates 4D texture coordinates. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates 3D vertex coordinates. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 1D evaluation generates 4D vertex coordinates. (See glMap1.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates colors. (See glMap2.) ParameterValues returns four values: the endpoints of the 2D map’s i and j grid domains. (See glMapGrid.) ParameterValues returns two values: the number of partitions in the 2D map’s i and j grid domains. (See glMapGrid.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates color indices. (See glMap2.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates normals. (See glMap2.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates 1D texture coordinates. (See glMap2.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates 2D texture coordinates. (See glMap2.) GL_MAP2_TEXTURE_COORD_3 GL_MAP2_TEXTURE_COORD_4 GL_MAP2_VERTEX_3 GL_MAP2_VERTEX_4 GL_MAP_COLOR GL_MAP_STENCIL GL_MATRIX_MODE GL_MAX_3D_TEXTURE_SIZE GL_MAX_3D_TEXTURE_SIZE_EXT GL_MAX_ATTRIB_STACK_DEPTH GL_MAX_CLIENT_ATTRIB_STACK_DEPTH GL_MAX_CLIP_PLANES GL_MAX_ELEMENTS_INDICES GL_MAX_ELEMENTS_VERTICES GL_MAX_EVAL_ORDER GL_MAX_LIGHTS ParameterValues returns a single Boolean value indicating whether 2D evaluation generates 3D texture coordinates. (See glMap2.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates 4D texture coordinates. (See glMap2.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates 3D vertex coordinates. (See glMap2.) ParameterValues returns a single Boolean value indicating whether 2D evaluation generates 4D vertex coordinates. (See glMap2.) ParameterValues returns a single Boolean value indicating if colors and color indices are to be replaced by table lookup during pixel transfers. (See glPixelTransfer.) ParameterValues returns a single Boolean value indicating if stencil indices are to be replaced by table lookup during pixel transfers. (See glPixelTransfer.) ParameterValues returns one value, a symbolic constant indicating which matrix stack is currently the target of all matrix operations. (See glMatrixMode.) ParameterValues returns one value, the maximum width, height, or depth of any 3D texture image (without borders). (See glTexImage3DEXT.) ParameterValues returns one value, a rough estimate of the largest 3D texture that the GL can handle. If the GL version is 1.2 or greater, use GL_PROXY_TEXTURE_3D″ to determine if a texture is too large. (See glTexImage3DEXT.) Requires extension EXT_texture3D. ParameterValues returns one value, the maximum supported depth of the attribute stack. (See glPushAttrib.) ParameterValues returns one value indicating the maximum supported depth of the client attribute stack. (See glPushClientAttrib.) ParameterValues returns one value, the maximum number of application-defined clipping planes. (See glClipPlane.) ParameterValues returns one value: the maximum number of DrawRangeElements vertices. ParameterValues returns one value: the maximum number of DrawRangeElements vertices. ParameterValues returns one value, the maximum equation order supported by 1D and 2D evaluators. (See glMap1 and glMap2.) ParameterValues returns one value, the maximum number of lights. (See glLight.) Chapter 1. OpenGL Subroutines 147 GL_MAX_LIST_NESTING GL_MAX_MODELVIEW_STACK_DEPTH GL_MAX_NAME_STACK_DEPTH GL_MAX_PIXEL_MAP_TABLE GL_MAX_PROJECTION_STACK_DEPTH GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT GL_MAX_TEXTURE_SIZE GL_MAX_TEXTURE_STACK_DEPTH GL_MAX_VIEWPORT_DIMS GL_MAX_VISIBILITY_THRESHOLD_IBM GL_MODELVIEW_MATRIX GL_MODELVIEW_STACK_DEPTH GL_NAME_STACK_DEPTH GL_NORMAL_ARRAY GL_NORMAL_ARRAY_COUNT_EXT GL_NORMAL_ARRAY_EXT 148 OpenGL 2.1 Reference Manual ParameterValues returns one value, the maximum recursion depth allowed during display list traversal. (See glCallList.) ParameterValues returns one value, the maximum supported depth of the modelview matrix stack. (See glPushMatrix.) ParameterValues returns one value, the maximum supported depth of the selection name stack. (See glPushName.) ParameterValues returns one value, the maximum supported size of a glPixelMap lookup table. (See glPixelMap.) ParameterValues returns one value, the maximum supported depth of the projection matrix stack. (See glPushMatrix.) ParameterValues returns one value, the maximum level of texture anisotropy supported by this implementation. (See glGetTexParameter.) Requires extension EXT_texture_filter_anisotropic. ParameterValues returns one value, the maximum width or height of any texture image (without borders). (See glTexImage1D and glTexImage2D.) ParameterValues returns one value, the maximum supported depth of the texture matrix stack. (See glPushMatrix.) ParameterValues returns two values: the maximum supported width and height of the viewport. (See glViewport.) ParameterValues returns one value: the maximum permitted number of visible fragments that will be discarded prior to registering a visibility hit. (See glVisibilityBufferIBM.) Requires extension IBM_occlusion_cull. ParameterValues returns 16 values: the modelview matrix on the top of the modelview matrix stack. (See glMatrixMode.) ParameterValues returns one value, the number of matrices on the modelview matrix stack. (See glPushMatrix.) ParameterValues returns one value, the number of names on the selection name stack. (See glPushMatrix.) ParameterValues returns a single Boolean value, indicating whether the normal array is enabled. The initial value is GL_FALSE. (See glNormalPointer.) ParameterValues returns one value, the number of normals in the normal array, counting from the first, that are static. (See glNormalPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns a single boolean value, indicating whether the normal array is enabled. (See glNormalPointerEXT.) Requires extension EXT_vertex_array. GL_NORMAL_ARRAY_LIST_STRIDE_IBM GL_NORMAL_ARRAY_STRIDE GL_NORMAL_ARRAY_STRIDE_EXT GL_NORMAL_ARRAY_TYPE GL_NORMAL_ARRAY_TYPE_EXT GL_NORMALIZE GL_OCCLUSION_TEST_HP GL_OCCLUSION_TEST_RESULT_HP GL_PACK_ALIGNMENT GL_PACK_IMAGE_HEIGHT GL_PACK_IMAGE_HEIGHT_EXT GL_PACK_LSB_FIRST GL_PACK_ROW_LENGTH GL_PACK_SKIP_IMAGES ParameterValues returns one value, the byte stride between successive pointers to normal lists. The initial value is 0. (See glNormalPointerListIBM.) Requires extension IBM_vertex_array_lists. ParameterValues returns one value, the byte offset between consecutive normals in the normal array. The initial value is 0. (See glNormalPointer.) ParameterValues returns one value, the byte offset between consecutive normals in the normal array. (See glNormalPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the data type of each coordinate in the normal array. The initial value is GL_FLOAT. (See glNormalPointer.) ParameterValues returns one value, the data type of each coordinate in the normal array. (See glNormalPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns a single Boolean value indicating whether normals are automatically scaled to unit length after they have been transformed to eye coordinates. (See glNormal.) ParameterValues returns a single Boolean value indicating whether the occlusion test HP_OCCLUSION_TEST is enabled. (See glEnable.) ParameterValues returns a single Boolean value indicating whether the occlusion test HP_OCCLUSION_TEST noted any fragments successfully passing the depth test. (See glEnable.) ParameterValues returns one value, the byte alignment used for writing pixel data to memory. (See glPixelStore.) ParameterValues returns one value, the number of image rows used for writing 3D pixel data to memory. (See glPixelStore.) ParameterValues returns one value, the number of image rows used for writing 3D pixel data to memory. (See glPixelStore.) Requires extension EXT_texture3D. ParameterValues returns a single Boolean value indicating whether single-bit pixels being written to memory are written first to the least significant bit of each unsigned byte. (See glPixelStore.) ParameterValues returns one value, the row length used for writing pixel data to memory. (See glPixelStore.) ParameterValues returns one value, the number of 2D images skipped before the first pixel of a 3D image is written into memory. (See glPixelStore.) Chapter 1. OpenGL Subroutines 149 GL_PACK_SKIP_IMAGES_EXT GL_PACK_SKIP_PIXELS GL_PACK_SKIP_ROWS GL_PACK_SWAP_BYTES GL_PERSPECTIVE_CORRECTION_HINT GL_PIXEL_MAP_A_TO_A_SIZE GL_PIXEL_MAP_B_TO_B_SIZE GL_PIXEL_MAP_G_TO_G_SIZE GL_PIXEL_MAP_I_TO_A_SIZE GL_PIXEL_MAP_I_TO_B_SIZE GL_PIXEL_MAP_I_TO_G_SIZE GL_PIXEL_MAP_I_TO_I_SIZE GL_PIXEL_MAP_I_TO_R_SIZE GL_PIXEL_MAP_R_TO_R_SIZE GL_PIXEL_MAP_S_TO_S_SIZE GL_POINT_SIZE GL_POINT_SIZE_GRANULARITY GL_POINT_SIZE_RANGE 150 OpenGL 2.1 Reference Manual ParameterValues returns one value, the number of 2D images skipped before the first pixel of a 3D image is written into memory. (See glPixelStore.) Requires extension EXT_texture3D. ParameterValues returns one value, the number of pixel locations skipped before the first pixel is written into memory. (See glPixelStore.) ParameterValues returns one value, the number of rows of pixel locations skipped before the first pixel is written into memory. (See glPixelStore.) ParameterValues returns a single Boolean value indicating whether the bytes of 2-byte and 4-byte pixel indices and components are swapped before being written to memory. (See glPixelStore.) ParameterValues returns one value, a symbolic constant indicating the mode of the perspective correction hint. (See glHint.) ParameterValues returns one value, the size of the alpha-to-alpha pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the blue-to-blue pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the green-to-green pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the index-to-alpha pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the index-to-blue pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the index-to-green pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the index-to-index pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the index-to-red pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the red-to-red pixel translation table. (See glPixelMap.) ParameterValues returns one value, the size of the stencil-to-stencil pixel translation table. (See glPixelMap.) ParameterValues returns one value, the point size as specified by glPointSize. ParameterValues returns one value, the size difference between adjacent supported sizes for antialiased points. (See glPointSize.) ParameterValues returns two values: the smallest and largest supported sizes for antialiased points. (See glPointSize.) GL_POINT_SMOOTH GL_POINT_SMOOTH_HINT GL_POLYGON_MODE GL_POLYGON_OFFSET_BIAS_EXT GL_POLYGON_OFFSET_EXT GL_POLYGON_OFFSET_FACTOR GL_POLYGON_OFFSET_FACTOR_EXT GL_POLYGON_OFFSET_FILL GL_POLYGON_OFFSET_LINE GL_POLYGON_OFFSET_POINT GL_POLYGON_OFFSET_UNITS GL_POLYGON_SMOOTH GL_POLYGON_SMOOTH_HINT GL_POLYGON_STIPPLE ParameterValues returns a single Boolean value indicating whether antialiasing of points is enabled. (See glPointSize.) ParameterValues returns one value, a symbolic constant indicating the mode of the point antialiasing hint. (See glHint.) ParameterValues returns two values: symbolic constants indicating whether frontfacing and backfacing polygons are rasterized as points, lines, or filled polygons. (See glPolygonMode.) ParameterValues returns one value, the constant which is added to the z value of each fragment generated when a polygon is rasterized. (See glPolygonOffsetEXT.) Requires extension EXT_polygon_offset. ParameterValues returns a single Boolean value indicating whether polygon offest is enabled. (See glPolygonOffsetEXT.) Requires extension EXT_polygon_offset. ParameterValues returns one value, the scaling factor used to determine the variable offset which is added to the depth value of each fragment generated when a polygon is rasterized. The initial value is 0.0. (See glPolygonOffset.) ParameterValues returns one value, the scaling factor used to determine the variable offset which is added to the z value of each fragment generated when a polygon is rasterized. (See glPolygonOffsetEXT.) Requires extension EXT_polygon_offset. ParameterValues returns a single Boolean value indicating whether polygon offset is enabled for polygons in fill mode. The initial value is GL_FALSE. (See glPolygonOffset.) ParameterValues returns a single Boolean value indicating whether polygon offset is enabled for polygons in line mode. The initial value is GL_FALSE. (See glPolygonOffset.) ParameterValues returns a single Boolean value indicating whether polygon offset is enabled for polygons in point mode. The initial value is GL_FALSE. (See glPolygonOffset.) ParameterValues returns one value, this value is multiplied by an implementation-specific value and then added to the z value of each fragment generated when a polygon is rasterized. The initial value is 0.0. (See glPolygonOffset.) ParameterValues returns a single Boolean value indicating whether antialiasing of polygons is enabled. (See glPolygonMode.) ParameterValues returns one value, a symbolic constant indicating the mode of the polygon antialiasing hint. (See glHint.) ParameterValues returns a single Boolean value indicating whether stippling of polygons is enabled. (See glPolygonStipple.) Chapter 1. OpenGL Subroutines 151 GL_PROJECTION_MATRIX GL_PROJECTION_STACK_DEPTH GL_READ_BUFFER GL_RED_BIAS GL_RED_BITS GL_RED_SCALE GL_RENDER_MODE GL_RGBA_MODE GL_SCISSOR_BOX GL_SCISSOR_TEST GL_SHADE_MODEL GL_SECONDARY_COLOR_ARRAY_SIZE_EXT GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT GL_SECONDARY_COLOR_ARRAY_TYPE_EXT GL_SMOOTH_LINE_WIDTH_GRANULARITY GL_SMOOTH_LINE_WIDTH_RANGE GL_SMOOTH_POINT_SIZE_GRANULARITY 152 OpenGL 2.1 Reference Manual ParameterValues returns 16 values: the projection matrix on the top of the projection matrix stack. (See glMatrixMode.) ParameterValues returns one value, the number of matrices on the projection matrix stack. (See glPushMatrix.) ParameterValues returns one value, a symbolic constant indicating which color buffer is selected for reading. (See glReadPixels and glAccum.) ParameterValues returns one value, the red bias factor used during pixel transfers. ParameterValues returns one value, the number of red bit planes in each color buffer. ParameterValues returns one value, the red scale factor used during pixel transfers. (See glPixelTransfer.) ParameterValues returns one value, a symbolic constant indicating whether the GL is in render, select, or feedback mode. (See glRenderMode.) ParameterValues returns a single Boolean value indicating whether the GL is in RGBA mode (True) or color index mode (False). (See glColor.) ParameterValues returns four values: the x and y window coordinates of the scissor box, followed by its width and height. (See glScissor.) ParameterValues returns a single Boolean value indicating whether scissoring is enabled. (See glScissor.) ParameterValues returns one value, a symbolic constant indicating whether the shading mode is flat or smooth. (See glShadeModel.) ParameterValues returns one value, the number of components in each entry of the secondary color array, which will be either 3 or 4. (See glSecondaryColorPointerEXT.) ParameterValues returns one value, the byte offset between consecutive entries in the secondary color array. (See glSecondaryColorPointerEXT.) ParameterValues returns one value, the data type of each component in the secondary color array. (See glSecondaryColorPointerEXT.) ParameterValues returns one value, the width difference between adjacent supported widths for antialiased lines. (See glLineWidth.) ParameterValues returns two values: the smallest and largest supported widths for antialiased lines. (See glLineWidth.) ParameterValues returns one value, the size difference between adjacent supported sizes for antialiased points. (See glPointSize.) GL_SMOOTH_POINT_SIZE_RANGE GL_STENCIL_BITS GL_STENCIL_CLEAR_VALUE GL_STENCIL_FAIL GL_STENCIL_FUNC GL_STENCIL_PASS_DEPTH_FAIL GL_STENCIL_PASS_DEPTH_PASS GL_STENCIL_REF GL_STENCIL_TEST GL_STENCIL_VALUE_MASK GL_STENCIL_WRITEMASK GL_STEREO GL_SUBPIXEL_BITS GL_TEXTURE_1D GL_TEXTURE_2D GL_TEXTURE_1D_BINDING ParameterValues returns two values: the smallest and largest supported sizes for antialiased points. (See glPointSize.) ParameterValues returns one value, the number of bit planes in the stencil buffer. ParameterValues returns one value, the index to which the stencil bit planes are cleared. (See glClearStencil.) ParameterValues returns one value, a symbolic constant indicating what action is taken when the stencil test fails. (See glStencilOp.) ParameterValues returns one value, a symbolic constant indicating what function is used to compare the stencil reference value with the stencil buffer value. (See glStencilFunc.) ParameterValues returns one value, a symbolic constant indicating what action is taken when the stencil test passes but the depth test fails. (See glStencilOp.) ParameterValues returns one value, a symbolic constant indicating what action is taken when the stencil test passes and the depth test passes. (See glStencilOp.) ParameterValues returns one value, the reference value that is compared with the contents of the stencil buffer. (See glStencilFunc.) ParameterValues returns a single Boolean value indicating whether stencil testing of fragments is enabled. (See glStencilFunc and glStencilOp.) ParameterValues returns one value, the mask that is used to mask both the stencil reference value and the stencil buffer value before they are compared. (See glStencilFunc.) ParameterValues returns one value, the mask that controls writing of the stencil bit planes. (See glStencilMask.) ParameterValues returns a single Boolean value indicating whether stereo buffers (left and right) are supported. ParameterValues returns one value, an estimate of the number of bits of subpixel resolution that are used to position rasterized geometry in window coordinates. ParameterValues returns a single Boolean value indicating whether 1D texture mapping is enabled. (See glTexImage1D.) ParameterValues returns a single Boolean value indicating whether 2D texture mapping is enabled. (See glTexImage2D.) ParameterValues returns a single value, the name of the texture currently bound to the target GL_TEXTURE_1D. The initial value is 0. (See glBindTexture.) Chapter 1. OpenGL Subroutines 153 GL_TEXTURE_1D_BINDING_EXT GL_TEXTURE_2D_BINDING GL_TEXTURE_2D_BINDING_EXT GL_TEXTURE_3D_BINDING_EXT GL_TEXTURE_3D_EXT GL_TEXTURE_COLOR_TABLE_EXT GL_TEXTURE_COORD_ARRAY GL_TEXTURE_COORD_ARRAY_COUNT_EXT GL_TEXTURE_COORD_ARRAY_EXT GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM GL_TEXTURE_COORD_ARRAY_SIZE GL_TEXTURE_COORD_ARRAY_SIZE_EXT GL_TEXTURE_COORD_ARRAY_STRIDE 154 OpenGL 2.1 Reference Manual ParameterValues returns a single value, the name of the texture currently bound to the target GL_TEXTURE_1D. (See glBindTextureEXT.) Requires extension EXT_texture_object. ParameterValues returns a single value, the name of the texture currently bound to the target GL_TEXTURE_2D. The initial value is 0. (See glBindTexture.) ParameterValues returns a single value, the name of the texture currently bound to the target GL_TEXTURE_2D. (See glBindTextureEXT.) Requires extension EXT_texture_object. ParameterValues returns a single value, the name of the texture currently bound to the target GL_TEXTURE_3D_EXT. (See glBindTexture.) Requires extension EXT_texture_object. ParameterValues returns a single Boolean value indicating whether 3D texture mapping is enabled. (See glTexImage3DEXT.) Requires extension EXT_texture3D. ParameterValues returns a single Boolean value indicating whether the texture color table is enabled. The initial value is GL_FALSE. (See glColorTable.) ParameterValues returns a single Boolean value indicating whether the texture coordinate array is enabled. The initial value is GL_FALSE. (See glTexCoordPointer.) ParameterValues returns one value, the number of elements in the texture coordinate array, counting from the first, that are static. (See glTexCoordPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns a single boolean value, indicating whether the texture coordinate array is enabled. (See glTexCoordPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the byte stride between successive pointers to texture coord lists. The initial value is 0. (See glTexCoordPointerListIBM.) Requires extension IBM_vertex_array_lists. ParameterValues returns one value, the number of coordinates per element in the texture coordinate array. The initial value is 4. (See glTexCoordPointer.) ParameterValues returns one value, the number of coordinates per element in the texture coordinate array. (See glTexCoordPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the byte offset between consecutive elements in the texture coordinate array. The initial value is 0. (See glTexCoordPointer.) GL_TEXTURE_COORD_ARRAY_STRIDE_EXT GL_TEXTURE_COORD_ARRAY_TYPE GL_TEXTURE_COORD_ARRAY_TYPE_EXT GL_TEXTURE_ENV_COLOR GL_TEXTURE_ENV_MODE GL_TEXTURE_GEN_S GL_TEXTURE_GEN_T GL_TEXTURE_GEN_R GL_TEXTURE_GEN_Q GL_TEXTURE_MATRIX GL_TEXTURE_STACK_DEPTH GL_TRANSPOSE_COLOR_MATRIX_ARB GL_TRANSPOSE_MODELVIEW_MATRIX_ARB ParameterValues returns one value, the byte offset between consecutive elements in the texture coordinate array. (See glTexCoordPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the data type of the coordinates in the texture coordinate array. The initial value is GL_FLOAT. (See glTexCoordPointer.) ParameterValues returns one value, the data type of the coordinates in the texture coordinate array. (See glTexCoordPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns four values: the RGBA values of the texture environment color. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value, and -1.0 returns the most negative representable integer value. (See glTexEnv.) ParameterValues returns one value, a symbolic constant indicating what texture environment function is currently selected. (See glTexEnv.) ParameterValues returns a single Boolean value indicating whether automatic generation of the S texture coordinate is enabled. (See glTexGen.) ParameterValues returns a single Boolean value indicating whether automatic generation of the T texture coordinate is enabled. (See glTexGen.) ParameterValues returns a single Boolean value indicating whether automatic generation of the R texture coordinate is enabled. (See glTexGen.) ParameterValues returns a single Boolean value indicating whether automatic generation of the Q texture coordinate is enabled. (See glTexGen.) ParameterValues returns 16 values: the texture matrix on the top of the texture matrix stack. (See glMatrixMode.) ParameterValues returns one value, the number of matrices on the texture matrix stack . (See glPushMatrix.) ParameterValues returns 16 values: the transpose of the color matrix. (See glLoadNamedMatrixIBM.) Requires extension ARB_transpose_matrix. ParameterValues returns 16 values: the transpose of the modelview matrix on the top of the modelview matrix stack. (See glMatrixMode.) Requires extension ARB_transpose_matrix. Chapter 1. OpenGL Subroutines 155 GL_TRANSPOSE_PROJECTION_MATRIX_ARB GL_TRANSPOSE_TEXTURE_MATRIX_ARB GL_UNPACK_ALIGNMENT GL_UNPACK_IMAGE_HEIGHT GL_UNPACK_IMAGE_HEIGHT_EXT GL_UNPACK_LSB_FIRST GL_UNPACK_ROW_LENGTH GL_UNPACK_SKIP_IMAGES GL_UNPACK_SKIP_IMAGES_EXT GL_UNPACK_SKIP_PIXELS GL_UNPACK_SKIP_ROWS GL_UNPACK_SWAP_BYTES GL_UPDATE_CLIP_VOLUME_HINT 156 OpenGL 2.1 Reference Manual ParameterValues returns 16 values: the transpose of the projection matrix on the top of the projection matrix stack. (See glMatrixMode.) Requires extension ARB_transpose_matrix. ParameterValues returns 16 values: the transpose of the texture matrix on the top of the texture matrix stack. (See glMatrixMode.) Requires extension ARB_transpose_matrix. ParameterValues returns one value, the byte alignment used for reading pixel data from memory. (See glPixelStore.) ParameterValues returns one value, the number of image rows used for reading 3D pixel data from memory. (See glPixelStore.) ParameterValues returns one value, the number of image rows used for reading 3D pixel data from memory. (See glPixelStore.) Requires extension EXT_texture3D. ParameterValues returns a single Boolean value indicating whether single-bit pixels being read from memory are read first from the least significant bit of each unsigned byte. (See glPixelStore.) ParameterValues returns one value, the row length used for reading pixel data from memory. (See glPixelStore.) ParameterValues returns one value, the number of 2D images skipped before the first pixel of a 3D image is read from memory. (See glPixelStore.) ParameterValues returns one value, the number of 2D images skipped before the first pixel of a 3D image is read from memory. (See glPixelStore.) Requires extension EXT_texture3D. ParameterValues returns one value, the number of pixel locations skipped before the first pixel is read from memory. (See glPixelStore.) ParameterValues returns one value, the number of rows of pixel locations skipped before the first pixel is read from memory. (See glPixelStore.) ParameterValues returns a single Boolean value indicating whether the bytes of 2-byte and 4-byte pixel indices and components are swapped after being read from memory. (See glPixelStore.) ParameterValues returns a single Boolean value indicating whether the automatic updating of the Clip Volume Hint (through calls to glClipBoundingBoxIBM, glClipBoundingSphereIBM or glClipBoundingVerticesIBM) is enabled. (See glHint.) Requires extension IBM_clip_check. GL_VERTEX_ARRAY GL_VERTEX_ARRAY_COUNT_EXT GL_VERTEX_ARRAY_EXT GL_VERTEX_ARRAY_LIST_STRIDE_IBM GL_VERTEX_ARRAY_SIZE_EXT GL_VERTEX_ARRAY_STRIDE GL_VERTEX_ARRAY_STRIDE_EXT GL_VERTEX_ARRAY_TYPE GL_VERTEX_ARRAY_TYPE_EXT GL_VIEWPORT GL_VISIBILITY_BUFFER_SIZE_IBM GL_VISIBILITY_THRESHOLD_IBM GL_ZOOM_X GL_ZOOM_Y ParameterValues returns a single Boolean value indicating whether the vertex array is enabled. The initial value is GL_FALSE. (See glVertexPointer.) ParameterValues returns one value, the number of vertices in the vertex array, counting from the first, that are static. (See glVertexPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns a single boolean value, indicating whether the vertex array is enabled. (See glVertexPointerEXT.) ParameterValues returns one value, the byte stride between successive pointers to vertex lists. The initial value is 0. (See glVertexPointerListIBM.) Requires extension IBM_vertex_array_lists. ParameterValues returns one value, the number of coordinates per vertex in the vertex array. (See glVertexPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the byte offset between consecutive vertices in the vertex array. The initial value is 0. (See glVertexPointer.) ParameterValues returns one value, the byte offset between consecutive vertices in the vertex array. (See glVertexPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns one value, the data type of each coordinate in the vertex array. The initial value is GL_FLOAT. (See glVertexPointer.) ParameterValues returns one value, the data type of each coordinate in the vertex array. (See glVertexPointerEXT.) Requires extension EXT_vertex_array. ParameterValues returns four values: the x and y window coordinates of the viewport, followed by its width and height. (See glViewPort.) ParameterValues returns one value: the maximum number of values that can be stored in the visibility array. (See glVisibilityBufferIBM.) Requires extension IBM_occlusion_cull. ParameterValues returns one value: the number of visible fragments that will be discarded prior to registering a visibility hit. (See glVisibilityThresholdIBM.) Requires extension IBM_occlusion_cull. ParameterValues returns one value, the x pixel zoom factor. (See glPixelZoom.) ParameterValues returns one value, the y pixel zoom factor. (See glPixelZoom.) Many of the Boolean parameters can also be queried more easily using glIsEnabled. Chapter 1. OpenGL Subroutines 157 Parameters ParameterName ParameterValues Specifies the parameter value to be returned. The symbolic constants listed in the Description section are accepted. Returns the value or values of the specified parameter. Error Codes GL_INVALID_ENUM GL_INVALID_OPERATION ParameterName is not an accepted value. The glGet subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glGetClipPlane subroutine, glGetError subroutine, glGetLight subroutine, glGetMap subroutine, glGetMaterial subroutine, glGetPixelMap subroutine, glGetPointerv subroutine, glGetPointervEXT subroutine, glGetPolygonStipple subroutine, glGetString subroutine, glGetTexEnv subroutine, glGetTexGen subroutine, glGetTexImage subroutine, glGetTexLevelParameter subroutine, glGetTexParameter subroutine, glIsEnabled subroutine. glGetClipPlane Subroutine Purpose Returns the coefficients of the clipping plane. Library OpenGL C bindings library: libGL.a C Syntax void glGetClipPlane(GLenum Plane, GLdouble * Equation) Description The glGetClipPlane subroutine returns in Equation the four coefficients of the plane equation for Plane. Parameters Plane Equation 158 Specifies a clipping plane. The number of clipping planes depends on the implementation; however, at least six clipping planes are supported. They are identified by symbolic names of the form GL_CLIP_PLANEi where 0 < i < GL_MAX_CLIP_PLANES. Returns four double-precision values that are the coefficients of the plane equation of Plane in eye coordinates. OpenGL 2.1 Reference Manual Notes It is always the case that GL_CLIP_PLANEi = GL_CLIP_PLANE0 + i. If an error is generated, no change is made to the contents of Equation. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Plane is not an accepted value. The glGetClipPlane subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glClipPlane subroutine. glGetColorTable Subroutine Purpose Return a color lookup table to the user. Library OpenGL C bindings library: (libGL.a) C Syntax void glGetColorTable(GLenum target, GLenum format, GLenum type, const GLvoid *table) void glGetColorTableSGI(GLenum target, GLenum format, GLenum type, const GLvoid *table) Description glGetColorTable returns in table the contents of the color table specified by target. No pixel transfer operations are performed, but pixel storage modes that are applicable to glReadPixels are performed. Color components that are requested to be in the specified format, but which are not included in the internal format of the color lookup table, are returned as zero. The assignments of the internal color components to the components requested by format are: Internal Component red green blue alpha luminance intensity Resulting Component red green blue alpha red red Chapter 1. OpenGL Subroutines 159 Parameters target format Must be GL_TEXTURE_COLOR_TABLE_EXT. is the format of the pixel data in table. The allowable values are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, GL_BGR, GL_RGBA, GL_BGRA, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, and GL_422_REV_AVERAGE_EXT. is the type of the pixel data in table. The allowable values are GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV. is a pointer to a one-dimensional array of pixel data that will be loaded with the contents of the color table. type table Notes GL_TEXTURE_COLOR_TABLE_SGI is an alias for GL_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. GL_PROXY_TEXTURE_COLOR_TABLE_SGI is an alias for GL_PROXY_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. Error Codes GL_INVALID_ENUM GL_INVALID_ENUM GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_OPERATION 160 OpenGL 2.1 Reference Manual is generated if target is not one of the allowable values. is generated if format is not one of the allowable values. is generated if type is not one of the allowable values. is generated if type is one of GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, or GL_UNSIGNED_SHORT_5_6_5_REV, and format is not GL_RGB. is generated if type is one of GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_SHORT_8_8_8_8, GL_UNSIGNED_SHORT_8_8_8_8_REV, GL_UNSIGNED_SHORT_10_10_10_2, or GL_UNSIGNED_SHORT_2_10_10_10_REV, and format is neigher GL_RGBA nor GL_BGRA. GL_INVALID_OPERATION is generated if glColorTable is executed between the execution of glBegin and the corresponding execution of glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glColorSubTable subroutine, the glColorTableParameter subroutine, the glGetColorTableParameter subroutine. glGetColorTableParameter Subroutine Purpose Returns attributes used when loading a color table. Library OpenGL C bindings library: (libGL.a) C Syntax void glGetColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) void glGetColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) void glGetColorTableParameterfvSGI(GLenum target, GLenum pname, const GLfloat *params) void glGetColorTableParameterivSGI(GLenum target, GLenum pname, const GLint *params) Description This subroutine returns parameters specific to color table target. When pname is set to GL_COLOR_TABLE_SCALE or GL_COLOR_TABLE_BIAS, glGetColorTableParameter returns the color table scale or bias parameters for the table specified by target. For these queries, target must be set to GL_TEXTURE_COLOR_TABLE_EXT and params points to an array of four elements, which receive the scale or bias factors for red, green, blue, and alpha, in that order. glGetColorTableParameter can also be used to retrieve the format and size parameters for a color table. For thes queries, set target to any of the six targets listed above. The format and size parameters are set by glColorTable. The following table lists the format and size parameters that may be queried. For each symbolic constant listed below for pname, params must point to an array of the given length, and will receive the values indicated. Chapter 1. OpenGL Subroutines 161 Parameter N Meaning GL_COLOR_TABLE_FORMAT GL_COLOR_TABLE_WIDTH GL_COLOR_TABLE_RED_SIZE GL_COLOR_TABLE_GREEN_SIZE GL_COLOR_TABLE_BLUE_SIZE GL_COLOR_TABLE_ALPHA_SIZE GL_COLOR_TABLE_LUMINANCE_SIZE GL_COLOR_TABLE_INTENSITY_SIZE 1 1 1 1 1 1 1 1 Internal format (e.g. GL_RGBA) Number of elements in the table Size of red component, in bits Size of green component, in bits Size of blue component, in bits Size of alpha component, in bits Size of luminance component, in bits Size of intensity component, in bits Parameters target is the target color table. Must be GL_TEXTURE_COLOR_TABLE_EXT, or GL_PROXY_TEXTURE_COLOR_TABLE_EXT. is the symbolic name of a texture color lookup table parameter. Must be one of GL_COLOR_TABLE_SCALE, GL_COLOR_TABLE_BIAS, GL_COLOR_TABLE_FORMAT, GL_COLOR_TABLE_WIDTH, GL_COLOR_TABLE_RED_SIZE, GL_COLOR_TABLE_GREEN_SIZE, GL_COLOR_TABLE_BLUE_SIZE, GL_COLOR_TABLE_ALPHA_SIZE, GL_COLOR_TABLE_LUMINANCE_SIZE, or GL_COLOR_TABLE_INTENSITY_SIZE. is a pointer to an array where the values of the paramaters will be stored. pname params Notes GL_TEXTURE_COLOR_TABLE_SGI is an alias for GL_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. GL_PROXY_TEXTURE_COLOR_TABLE_SGI is an alias for GL_PROXY_TEXTURE_COLOR_TABLE_EXT, and these tokens may be used interchangeably. Error Codes GL_INVALID_ENUM GL_INVALID_ENUM GL_INVALID_OPERATION is generated if target is not one of the allowable values. is generated if pname is not one of the allowable values. is generated if glColorTableParameter is executed between the execution of a glBegin and the corresponding execution of glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glColorSubTable subroutine, the glColorTableParameter subroutine. 162 OpenGL 2.1 Reference Manual glGetError Subroutine Purpose Returns error information. Library OpenGL C bindings library: libGL.a C Syntax GLenum glGetError( void ) Description The glGetError subroutine returns the value of the error flag. Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until glGetError is called, the error code is returned, and the flag is reset to GL_NO_ERROR. If a call to glGetError returns GL_NO_ERROR, there has been no detectable error since the last call to glGetError, or since the GL was initialized. To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an error, the value of that flag is returned, and that flag is reset to GL_NO_ERROR when glGetError is called. If more than one flag has recorded an error, glGetError returns and clears an arbitrary error flag value. Therefore, glGetError should always be called in a loop, until it returns GL_NO_ERROR, if all error flags are to be reset. Initially, all error flags are set to GL_NO_ERROR. The currently defined errors are: GL_NO_ERROR GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_OPERATION GL_STACK_OVERFLOW GL_STACK_UNDERFLOW GL_OUT_OF_MEMORY GL_TABLE_TOO_LARGE No error has been recorded. The value of this symbolic constant is guaranteed to be 0 (zero). An unacceptable value is specified for an enumerated argument. The offending command is ignored, having no side effect other than to set the error flag. A numeric argument is out of range. The offending command is ignored, having no side effect other than to set the error flag. The specified operation is not allowed in the current state. The offending command is ignored, having no side effect other than to set the error flag. This command would cause a stack overflow. The offending command is ignored, having no side effect other than to set the error flag. This command would cause a stack underflow. The offending command is ignored, having no side effect other than to set the error flag. There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded. The specified table is too large. When an error flag is set, results of a GL operation are undefined only if GL_OUT_OF_MEMORY has occurred. In all other cases, the command generating the error is ignored and has no effect on the GL state or frame buffer contents. Chapter 1. OpenGL Subroutines 163 Errors GL_INVALID_OPERATION The glGetError subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes fo OpenGL. Related Information The glBegin or glEnd subroutine. glGetLight Subroutine Purpose Returns light source parameter values. Library OpenGL C bindings library: libGL.a C Syntax void glGetLightfv(GLenum Light, GLenum ParameterName, GLfloat * ParameterValues) void glGetLightiv(GLenum Light, GLenum ParameterName, GLint * ParameterValues) Description The glGetLight subroutine returns in ParameterValues the value or values of a light source parameter. Light names the light and is a symbolic name of the form GL_LIGHTi for 0 < i < GL_MAX_LIGHTS, where GL_MAX_LIGHTS is an implementation-dependent constant that is greater than or equal to 8. ParameterName specifies one of 10 light source parameters, again by symbolic name. The parameters are: GL_AMBIENT GL_DIFFUSE 164 OpenGL 2.1 Reference Manual ParameterValues returns four integer or floating-point values representing the ambient intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. ParameterValues returns four integer or floating-point values representing the diffuse intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. GL_SPECULAR GL_POSITION GL_SPOT_DIRECTION GL_SPOT_EXPONENT GL_SPOT_CUTOFF GL_CONSTANT_ATTENUATION GL_LINEAR_ATTENUATION GL_QUADRATIC_ATTENUATION ParameterValues returns four integer or floating-point values representing the specular intensity of the light source. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. ParameterValues returns four integer or floating-point values representing the position of the light source. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer value. The returned values are those maintained in eye coordinates. They will not be equal to the values specified using glLight, unless the modelview matrix was identified at the time glLight was called. ParameterValues returns three integer or floating-point values representing the direction of the light source. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer value. The returned values are those maintained in eye coordinates. They will not be equal to the values specified using glLight, unless the modelview matrix was identity at the time glLight was called. Although spot direction is normalized before being used in the lighting equation, the returned values are the transformed versions of the specified values prior to normalization. ParameterValues returns a single integer or floating-point value representing the spot exponent of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer. ParameterValues returns a single integer or floating-point value representing the spot cutoff angle of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer. ParameterValues returns a single integer or floating-point value representing the constant (not distance related) attenuation of the light. An integer value, when requested, is computed by rounding the internal floating point representation to the nearest integer. ParameterValues returns a single integer or floating-point value representing the linear attenuation of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer. ParameterValues returns a single integer or floating-point value representing the quadratic attenuation of the light. An integer value, when requested, is computed by rounding the internal floating-point representation to the nearest integer. Parameters Light ParameterName ParameterValues Specifies a light source. The number of possible lights depends on the implementation; however, at least eight lights are supported. They are identified by symbolic names of the form GL_LIGHTi where 0 < i < GL_MAX_LIGHTS. Specifies a light source parameter for Light. Accepted symbolic names are GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION. Returns the requested data. Chapter 1. OpenGL Subroutines 165 Notes It is always the case that GL_LIGHTi = GL_LIGHT0 + i. If an error is generated, no change is made to the contents of ParameterValues. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Either Light or ParameterName is not an accepted value. The glGetLight subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glLight subroutine. glGetMap Subroutine Purpose Returns evaluator parameters. Library OpenGL C bindings library: libGL.a C Syntax void glGetMapdv(GLenum GLenum Query, GLdouble * v) Target, void glGetMapfv(GLenum GLenum Query, GLfloat * v) Target, void glGetMapiv(GLenum GLenum Query, GLint * v) Target, Description The glMap1 and glMap2 subroutines define evaluators. The glGetMap subroutine returns evaluator parameters. Target chooses a map, Query selects a specific parameter, and v points to storage where the values are returned. (See the glMap1 and glMap2 subroutines for a description of the acceptable values for the Target parameter.) 166 OpenGL 2.1 Reference Manual Query can assume the following values: GL_COEFF GL_ORDER GL_DOMAIN v returns the control points for the evaluator function. One-dimensional (1D) evaluators return order control points, and two-dimensional (2D) evaluators return uorder x vorder control points. Each control point consists of 1, 2, 3, or 4 integer, single-precision floating-point, or double-precision floating-point values, depending on the type of the evaluator. Two-dimensional control points are returned in row major order, incrementing the uorder index quickly, and the vorder index after each row. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer values. v returns the order of the evaluator function. One-dimensional evaluators return a single value, order. Two-dimensional evaluators return two values, uorder and vorder. v returns the linear u and v mapping parameters. One-dimensional evaluators return two values, u1 and u2, as specified by glMap1. Two-dimensional evaluators return four values, u1, u2, v1, and v2, as specified by glMap2. Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer values. Parameters Target Query v Specifies the symbolic name of a map. Accepted values are GL_MAP1_COLOR_4, GL_MAP1_INDEX, GL_MAP1_NORMAL, GL_MAP1_TEXTURE_COORD_1, GL_MAP1_TEXTURE_COORD_2, GL_MAP1_TEXTURE_COORD_3, GL_MAP1_TEXTURE_COORD_4, GL_MAP1_VERTEX_3, GL_MAP1_VERTEX_4, GL_MAP2_COLOR_4, GL_MAP2_INDEX, GL_MAP2_NORMAL, GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2, GL_MAP2_TEXTURE_COORD_3, GL_MAP2_TEXTURE_COORD_4, GL_MAP2_VERTEX_3, and GL_MAP2_VERTEX_4. Specifies which parameter to return. Symbolic names GL_COEFF, GL_ORDER, and GL_DOMAIN are accepted. Returns the requested data. Notes If an error is generated, no change is made to the contents of v. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Either Target or Query is not an accepted value. The glGetMap subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEvalCoord subroutine, glMap1 subroutine, glMap2 subroutine. glGetMaterial Subroutine Purpose Returns material parameters. Chapter 1. OpenGL Subroutines 167 Library OpenGL C bindings library: libGL.a C Syntax void glGetMaterialfv(GLenum Face, GLenum ParameterName, GLfloat * ParameterValues) void glGetMaterialiv(GLenum Face, GLenum ParameterName, GLint * ParameterValues) Description The glGetMaterial subroutine returns in ParameterValues the value or values of parameter ParameterName of material Face. Six parameters are defined: GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_EMISSION GL_SHININESS GL_COLOR_INDEXES ParameterValues returns four integer or floating-point values representing the ambient reflectance of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. ParameterValues returns four integer or floating-point values representing the diffuse reflectance of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. ParameterValues returns four integer or floating-point values representing the specular reflectance of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. ParameterValues returns four integer or floating-point values representing the emitted light intensity of the material. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0 maps to the most negative representable integer value. If the internal value is outside the range [-1,1], the corresponding integer return value is undefined. ParameterValues returns one integer or floating-point value representing the specular exponent of the material. Integer values, when requested, are computed by rounding the internal floating-point value to the nearest integer value. ParameterValues returns three integer or floating-point values representing the ambient, diffuse, and specular indices of the material. These indices are used only for color index lighting. (The other parameters are all used only for red, green, blue, and alpha lighting.) Integer values, when requested, are computed by rounding the internal floating-point values to the nearest integer values. Parameters Face ParameterName 168 Specifies which of the two materials is being queried. GL_FRONT or GL_BACK are accepted, representing the front and back materials, respectively. Specifies the material parameter to return. GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, and GL_COLOR_INDEXES are accepted. OpenGL 2.1 Reference Manual ParameterValues Returns the requested data. Notes If an error is generated, no change is made to the contents of ParameterValues. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Either Face or ParameterName is not an accepted value. The glGetMaterial subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glMaterial subroutine. glGetPixelMap Subroutine Purpose Returns the specified pixel map. Library OpenGL C bindings library: libGL.a C Syntax void glGetPixelMapfv(GLenum GLfloat *Values) Map, void glGetPixelMapuiv(GLenum GLuint *Values) Map, void glGetPixelMapusv(GLenum GLushort *Values) Map, Description The glGetPixelMap subroutine returns in the Values parameter the contents of the pixel map specified by the Map parameter. Pixel maps are used during the execution of glReadPixels, glDrawPixels, glCopyPixels, glTexImage1D, and glTexImage2D to map color indices, stencil indices, color components, and depth components to other values. Unsigned integer values, if requested, are linearly mapped from the internal fixed- or floating-point representation such that 1.0 maps to the largest representable integer value, and 0.0 maps to 0 (zero). Returned unsigned integer values are undefined if the map value was not in the range [0,1]. To determine the required size of the Map parameter, call the glGet subroutine with the appropriate symbolic constant. Chapter 1. OpenGL Subroutines 169 Parameters Map Specifies the name of the pixel map to return. Accepted values are GL_PIXEL_MAP_I_TO_I, GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, GL_PIXEL_MAP_I_TO_A, GL_PIXEL_MAP_R_TO_R, GL_PIXEL_MAP_G_TO_G, GL_PIXEL_MAP_B_TO_B, and GL_PIXEL_MAP_A_TO_A. Returns the pixel map contents. Values Notes If an error is generated, no change is made to the contents of the Values parameter. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Map is not an accepted value. The glGetPixelMap subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glGetPixelMap subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_PIXEL_MAP_I_TO_I_SIZE. glGet with argument GL_PIXEL_MAP_S_TO_S_SIZE. glGet with argument GL_PIXEL_MAP_I_TO_R_SIZE. glGet with argument GL_PIXEL_MAP_I_TO_G_SIZE. glGet with argument GL_PIXEL_MAP_I_TO_B_SIZE. glGet with argument GL_PIXEL_MAP_I_TO_A_SIZE. glGet with argument GL_PIXEL_MAP_R_TO_R_SIZE. glGet with argument GL_PIXEL_MAP_G_TO_G_SIZE. glGet with argument GL_PIXEL_MAP_B_TO_B_SIZE. glGet with argument GL_PIXEL_MAP_A_TO_A_SIZE. glGet with argument GL_MAX_PIXEL_MAP_TABLE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCopyPixels subroutine, glDrawPixels subroutine, glPixelMap subroutine, glPixelTransfer subroutine, glReadPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine. 170 OpenGL 2.1 Reference Manual glGetPointerv Subroutine Purpose Returns the address of the specified pointer. Library OpenGL C bindings library: libGL.a C Syntax void glGetPointerv(GLenum GLvoid* *params) pname, Description The glGetPointerv subroutine returns pointer information. The pname parameter is a symbolic constant indicating the pointer to be returned, and params is a pointer to a location in which to place the returned data. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the various vertex arrays are used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters pname Specifies the array or buffer pointer to be returned. The following symbolic constants are accepted: v GL_COLOR_ARRAY_LIST_IBM v GL_COLOR_ARRAY_POINTER v GL_EDGE_FLAG_ARRAY_LIST_IBM v GL_EDGE_FLAG_ARRAY_POINTER v GL_FEEDBACK_BUFFER_POINTER v GL_FOG_COORDINATE_ARRAY_LIST_IBM v GL_FOG_COORDINATE_ARRAY_POINTER_EXT v GL_INDEX_ARRAY_LIST_IBM v GL_INDEX_ARRAY_POINTER v GL_NORMAL_ARRAY_LIST_IBM v GL_NORMAL_ARRAY_POINTER v GL_SECONDARY_COLOR_ARRAY_LIST_IBM v GL_SECONDARY_COLOR_ARRAY_POINTER v GL_SELECTION_BUFFER_POINTER v GL_TEXTURE_COORD_ARRAY_LIST_IBM v GL_TEXTURE_COORD_ARRAY_POINTER v GL_VERTEX_ARRAY_LIST_IBM v GL_VERTEX_ARRAY_POINTER params v GL_VISIBILITY_BUFFER_POINTER_IBM Returns the pointer value specified by pname. Chapter 1. OpenGL Subroutines 171 Notes The glGetPointerv subroutine is available only if the GL version is 1.1 or greater. The ″*_ARRAY_LIST_IBM″ symbolic constants are only accepted if the IBM_vertex_array_list extension is defined. The *_ARRAY_LIST_IBM symbolic constants are only accepted if the IBM_vertex_array_list extension is defined. The ″GL_FOG_COORDINATE_*″ symbolic constants are only accepted if the EXT_fog_coord extension is defined. The ″GL_SECONDARY_COLOR_*″ symbolic constants are only accepted if the EXT_secondary_color extension is defined. The GL_VISIBILITY_BUFFER_POINTER_IBM symbolic constant is only accepted if the IBM_occlusion_cull extension is supported. The pointers are all client side state. The initial value for each pointer is 0. Error Codes GL_INVALID_ENUM is generated if pname is not an accepted value. Related Information The glArrayElement subroutine, glColorPointer subroutine, glColorPointerListIBM subroutine, glDrawArrays subroutine, glEdgeFlagPointer subroutine, glEdgeFlagPointerListIBM subroutine, glFeedbackBuffer subroutine, glIndexPointer subroutine, glIndexPointerListIBM subroutine, glNormalPointer subroutine, glNormalPointerListIBM subroutine, glSelectBuffer subroutine, glTexCoordPointer subroutine, glTexCoordPointerListIBM subroutine, glVertexPointer subroutine, glVertexPointerListIBM subroutine, glVisibilityBufferIBM subroutine. glGetPointervEXT Subroutine Purpose Returns the address of a vertex data array. Library OpenGL C bindings library: libGL.a C Syntax void glGetPointervEXT(GLenum GLvoid **params) pname, Description glGetPointervEXT returns array pointer information. pname is a symbolic constant indicating the array pointer to be returned, and params is a pointer to a location in which to place the returned data. 172 OpenGL 2.1 Reference Manual Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the various vertex arrays are used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters pname **params Specifies the array pointer to be returned. Symbolic constants GL_VERTEX_ARRAY_POINTER_EXT, GL_NORMAL_ARRAY_POINTER_EXT, GL_COLOR_ARRAY_POINTER_EXT, GL_INDEX_ARRAY_POINTER_EXT, GL_TEXTURE_COORD_ARRAY_POINTER_EXT, GL_EDGE_FLAG_ARRAY_POINTER_EXT, are accepted. returns the array pointer value specified by pname. Notes The array pointers are client side state. glGetPointervEXT is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. Errors GL_INVALID_ENUM is generated if pname is not an accepted value. File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElementEXT subroutine, glColorPointerEXT subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glIndexPointerEXT subroutine, glNormalPointerEXT subroutine, glTexCoordPointerEXT subroutine, glVertexPointerEXT subroutine. glGetPolygonStipple Subroutine Purpose Returns the polygon stipple pattern. Library OpenGL C bindings library: libGL.a C Syntax void glGetPolygonStipple(GLubyte *Mask) Chapter 1. OpenGL Subroutines 173 Description The glGetPolygonStipple subroutine returns to Mask a 32 x 32 polygon stipple pattern. The pattern is packed into memory as if the following values were called: v glReadPixels with both Height and Width equal to 32. v Type is GL_BITMAP. v Format is GL_COLOR_INDEX. In addition, the pattern is packed into memory as if the stipple pattern was stored in an internal 32 x 32 color index buffer. Unlike glReadPixels, however, pixel transfer operations (shift, offset, pixel map) are not applied to the returned stipple image. Parameters Mask Returns the stipple pattern. Notes If an error is generated, no change is made to the contents of the Mask parameter. Errors GL_INVALID_OPERATION The glGetPolygonStipple subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glPolygonStipple subroutine, glReadPixels subroutine. glGetString Subroutine Purpose Returns a string describing the current GL connection. Library OpenGL C bindings library: libGL.a C Syntax const GLubyte * glGetString(GLenum Parameter1) Description The glGetString subroutine returns a pointer to a static string describing some aspect of the current GL connection. The Parameter1 parameter can be one of the following values: 174 OpenGL 2.1 Reference Manual GL_VENDOR GL_RENDERER GL_VERSION GL_EXTENSIONS Returns the name of the company responsible for this GL implementation. This name does not change from release to release. Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release. Returns a version or release number. Returns a space-separated list of supported extensions to GL. Because GL does not include queries for the performance characteristics of an implementation, it is expected that some applications will be written to recognize known platforms and will modify their GL usage based on known performance characteristics of these platforms. Together, strings GL_VENDOR and GL_RENDERER uniquely specify a platform, and do not change from release to release. These strings should be used by such platform recognition algorithms. The format and contents of the string that glGetString returns depend on the implementation, except that extension names do not include space characters and are separated by space characters in the GL_EXTENSIONS string, and all strings are null-terminated. Parameters Parameter1 Specifies a symbolic constant, one of GL_VENDOR, GL_RENDERER, GL_VERSION, or GL_EXTENSIONS. Notes If an error is generated, glGetString returns 0 (zero). Errors GL_INVALID_ENUM GL_INVALID_OPERATION Parameter1 is not an accepted value. The glGetString subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine. glGetTexEnv Subroutine Purpose Returns texture environment parameters. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 175 C Syntax void glGetTexEnvfv(GLenum Target, GLenum ParameterName, GLfloat *ParameterValues) void glGetTexEnviv(GLenum Target, GLenum ParameterName, GLint *ParameterValues) Description The glGetTexEnv subroutine returns in the ParameterValues parameter selected values of a texture environment that was specified with glTexEnv. The Target parameter specifies a texture environment. Currently only the GL_TEXTURE_ENV texture environment is defined and supported. ParameterName names a specific texture environment parameter. The parameters are: GL_TEXTURE_ENV_MODE GL_TEXTURE_ENV_COLOR GL_COMBINE_RGB_EXT GL_COMBINE_ALPHA_EXT GL_SOURCE0_RGB_EXT GL_SOURCE1_RGB_EXT GL_SOURCE2_RGB_EXT GL_SOURCE0_ALPHA_EXT GL_SOURCE1_ALPHA_EXT GL_SOURCE2_ALPHA_EXT GL_OPERAND0_RGB_EXT GL_OPERAND1_RGB_EXT GL_OPERAND2_RGB_EXT GL_OPERAND0_ALPHA_EXT GL_OPERAND1_ALPHA_EXT GL_OPERAND2_ALPHA_EXT GL_RGB_SCALE_EXT GL_ALPHA_SCALE ParameterValues returns the single-valued texture environment mode, a symbolic constant. ParameterValues returns four integer or floating-point values that are the texture environment color. Integer values, when requested, are linearly mapped from the internal floating-point representation such that 1.0 maps to the most positive representable integer, and -1.0 maps to the most negative representable integer. ParameterValues returns the currently defined function to be used when blending texture RGB values in ″combine″ mode. ParameterValues returns the currently defined function to be used when blending texture Alpha values in ″combine″ mode. ParameterValues returns the currently defined value used to determine the source for RGB Operand 0. ParameterValues returns the currently defined value used to determine the source for RGB Operand 1. ParameterValues returns the currently defined value used to determine the source for RGB Operand 2. ParameterValues returns the currently defined value used to determine the source for Alpha Operand 0. ParameterValues returns the currently defined value used to determine the source for Alpha Operand 1. ParameterValues returns the currently defined value used to determine the source for Alpha Operand 2. ParameterValues returns the currently defined RGB Operand 0. ParameterValues returns the currently defined RGB Operand 1. ParameterValues returns the currently defined RGB Operand 2. ParameterValues returns the currently defined RGB Alpha 0. ParameterValues returns the currently defined RGB Alpha 1. ParameterValues returns the currently defined RGB Alpha 2. ParameterValues returns the floating-point value which is used to do the final scale on the RGB channels. ParameterValues returns the floating-point number which is used to do the final scale on the alpha channel. Parameters Target 176 Specifies a texture environment. Must be GL_TEXTURE_ENV. OpenGL 2.1 Reference Manual ParameterName Specifies the symbolic name of a texture environment parameter. Accepted values are: v GL_TEXTURE_ENV_MODE v GL_TEXTURE_ENV_COLOR v GL_COMBINE_RGB_EXT v GL_COMBINE_ALPHA_EXT v GL_SOURCE0_RGB_EXT v GL_SOURCE1_RGB_EXT v GL_SOURCE2_RGB_EXT v GL_SOURCE0_ALPHA_EXT v GL_SOURCE1_ALPHA_EXT v GL_SOURCE2_ALPHA_EXT v GL_OPERAND0_RGB_EXT v GL_OPERAND1_RGB_EXT v GL_OPERAND2_RGB_EXT v GL_OPERAND0_ALPHA_EXT v GL_OPERAND1_ALPHA_EXT v GL_OPERAND2_ALPHA_EXT v GL_RGB_SCALE_EXT ParameterValues v GL_ALPHA_SCALE Returns the requested data. Notes If an error is generated, no change is made to the contents of ParameterValues. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Either Target or ParameterName is not an accepted value. The glGetTexEnv subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glTexEnv subroutine. glGetTexGen Subroutine Purpose Returns texture coordinate generation parameters. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 177 C Syntax void glGetTexGendv(GLenum Coordinate, GLenum ParameterName, GLdouble *ParameterValues) void glGetTexGenfv(GLenum Coordinate, GLenum ParameterName, GLfloat *ParameterValues) void glGetTexGeniv(GLenum Coordinate, GLenum ParameterName, GLint *ParameterValues) Description The glGetTexGen subroutine returns in ParameterValues selected parameters of a texture coordinate generation function specified with glTexGen. Coordinate names one of the (s, t, r, q) texture coordinates, using the symbolic constant GL_S, GL_T, GL_R, or GL_Q. ParameterName specifies one of three symbolic names: GL_TEXTURE_GEN_MODE ParameterValues returns the single-valued texture generation function, a symbolic constant. ParameterValues returns the four plane equation coefficients that specify object linear-coordinate generation. Integer values, when requested, are mapped directly from the internal floating-point representation. ParameterValues returns the four plane equation coefficients that specify eye linear-coordinate generation. Integer values, when requested, are mapped directly from the internal floating-point representation. The returned values are those maintained in eye coordinates. They are not equal to the values specified using glTexGen, unless the modelview matrix was identified at the time glTexGen was called. GL_OBJECT_PLANE GL_EYE_PLANE Parameters Coordinate ParameterName ParameterValues Specifies a texture coordinate. Must be GL_S, GL_T, GL_R, or GL_Q. Specifies the symbolic name of the values to be returned. Must be either GL_TEXTURE_GEN_MODE or the name of one of the texture generation plane equations, either GL_OBJECT_PLANE or GL_EYE_PLANE. Returns the requested data. Notes If an error is generated, no change is made to the contents of ParameterValues. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Either Coordinate or ParameterName is not an accepted value. The glGetTexGen subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h 178 OpenGL 2.1 Reference Manual Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glTexGen subroutine. glGetTexImage Subroutine Purpose Returns a texture image. Library OpenGL C bindings library: libGL.a C Syntax void glGetTexImage(GLenum Target, GLint Level, GLenum Format, GLenum Type, GLvoid *Pixels) Description The glGetTexImage subroutine returns a texture image and places it in the Pixels parameter. Target specifies whether the desired texture image is one specified by glTexImage1D (GL_TEXTURE_1D), glTexImage2D (GL_TEXTURE_2D), glTexImage3D (GL_TEXTURE_3D), or by glTexImage3DEXT (GL_TEXTURE_3D_EXT). Level specifies the level-of-detail number of the desired image. Format and Type specify the format and type of the desired image array. (See the glTexImage1D and glDrawPixels subroutines for a description of the acceptable values for the Format and Type parameters, respectively.) Operation of glGetTexImage is best understood by considering the selected internal four-component texture image to be a red, green, blue, alpha (RGBA) color buffer that is the size of the image. The semantics of glGetTexImage are then identical to those of glReadPixels called with the same Format and Type, with x and y set to 0 (zero), Width set to the width of the texture image (including the border if one was specified), and Height set to 1 (one) for one-dimensional (1D) images, or to the height of the texture image (including the border if one was specified) for two-dimensional (2D) images. Because the internal texture image is an RGBA image, pixel formats GL_COLOR_INDEX, GL_STENCIL_INDEX, and GL_DEPTH_COMPONENT are not accepted, and pixel type GL_BITMAP is not accepted. If the selected texture image does not contain four components, the following mappings are applied: v Single-component textures are treated as RGBA buffers with red set to the single-component value, and green, blue, and alpha set to 0. v Two-component textures are treated as RGBA buffers with red set to the value of component 0, alpha set to the value of component 1, and green and blue set to 0. v Three-component textures are treated as RGBA buffers with red set to component 0, green set to component 1, blue set to component 2, and alpha set to 0. To determine the required size of Pixels, use the glGetTexLevelParameter subroutine to ascertain the dimensions of the internal texture image, then scale the required number of pixels by the storage required for each pixel, based on Format and Type. Be sure to consider the pixel storage parameters, especially GL_PACK_ALIGNMENT. Notes If an error is generated, no change is made to the contents of Pixels. Chapter 1. OpenGL Subroutines 179 Format of GL_ABGR_EXT is part of the _extname (EXT_abgr) extension, not part of the core GL command set. Target of GL_TEXTURE_3D_EXT is part of the _extname (EXT_texture3D) extension, not part of the core GL command set. Parameters Target Specifies which texture is to be obtained. GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, and GL_TEXTURE_3D_EXT are accepted. Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies a pixel format for the returned data. The supported formats are GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_ABGR_EXT, GL_LUMINANCE, and GL_LUMINANCE_ALPHA. Specifies a pixel type for the returned data. The supported types are GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, and GL_FLOAT. Returns the texture image. Should be a pointer to an array of the type specified by the Type parameter. Level Format Type Pixels Errors GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_OPERATION Either Target, Format, or Type is not an accepted value. Level is less than 0 or greater than log2max, where max is the returned value of GL_MAX_TEXTURE_SIZE. The glGetTexImage subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glGetTexImage subroutine are as follows. (See the glGet subroutine for more information.) glGetTexLevelParameter with argument GL_TEXTURE_WIDTH. glGetTexLevelParameter with argument GL_TEXTURE_HEIGHT. glGetTexLevelParameter with argument GL_TEXTURE_BORDER. glGetTexLevelParameter with argument GL_TEXTURE_COMPONENTS. glGet with arguments GL_PACK_ALIGNMENT and others. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glDrawPixels subroutine, glReadPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine. 180 OpenGL 2.1 Reference Manual glGetTexLevelParameter Subroutine Purpose Returns texture parameter values for a specific level of detail. Library OpenGL C bindings library: libGL.a C Syntax void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params) void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params) Description The glGetTexLevelParameter subroutine returns in params texture parameter values for a specific level-of-detail value, specified as level. The target parameter defines the target texture, either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_3D_EXT, GL_PROXY_TEXTURE_1D, GL_PROXY_TEXTURE_2D, GL_PROXY_TEXTURE_3D, or GL_PROXY_TEXTURE_3D_EXT. The GL_MAX_TEXTURE_SIZE parameter reports the largest square texture image which can be accomodated with mipmaps and borders (but a long skinny texture, or a texture without mipmaps and borders, may easily fit in texture memory). The proxy targets allow the user to more accurately query whether the GL can accomodate a texture of a given configuration. If the texture cannot be accomodated, the texture state variables (which may be queried with glGetTexLevelParameter) are set to 0. If the texture can be accomodated the texture state values will be set as they would be set for a non-proxy target. The pname parameter specifies the texture parameter whose value or values will be returned. The accepted parameter names are as follows: GL_TEXTURE_ALPHA_SIZE GL_TEXTURE_BLUE_SIZE GL_TEXTURE_BORDER GL_TEXTURE_DEPTH The internal storage resolution of an individual alpha component. The resolution chosen by the GL will be a close match for the resolution requested by the user with the component argument of glTexImage1D, glTexImage2D, or glTexImage3DEXT. The initial value is 0. The internal storage resolution of an individual blue component. The resolution chosen by the GL will be a close match for the resolution requested by the user with the component argument of glTexImage1D, glTexImage2D, or glTexImage3DEXT. The initial value is 0. params returns a single value, the width in pixels of the border of the texture image. The inital value is 0. params returns a single value, the depth of the texture image. This value includes the border of the texture image. The initial value is 0. Chapter 1. OpenGL Subroutines 181 GL_TEXTURE_DEPTH_EXT GL_TEXTURE_GREEN_SIZE GL_TEXTURE_HEIGHT GL_TEXTURE_INTENSITY_SIZE GL_TEXTURE_INTERNAL_FORMAT GL_TEXTURE_LUMINANCE_SIZE GL_TEXTURE_RED_SIZE GL_TEXTURE_WIDTH params returns a single value, the depth of the texture image. This value includes the border of the texture image. The initial value is 0. The internal storage resolution of an individual green component. The resolution chosen by the GL will be a close match for the resolution requested by the user with the component argument of glTexImage1D, glTexImage2D, or glTexImage3DEXT. The initial value is 0. params returns a single value, the height of the texture image. This value includes the border of the texture image. The initial value is 0. The internal storage resolution of an individual component. The resolution chosen by the GL will be a close match for the resolution requested by the user with the component argument of glTexImage1D or glTexImage2D. The initial value is 0. params returns a single value, the requested internal format of the texture image. The internal storage resolution of an individual luminance component. The resolution chosen by the GL will be a close match for the resolution requested by the user with the component argument of glTexImage1D, glTexImage2D, or glTexImage3DEXT. The initial value is 0. The internal storage resolution of an individual red component. The resolution chosen by the GL will be a close match for the resolution requested by the user with the component argument of glTexImage1D, glTexImage2D, or glTexImage3DEXT. The initial value is 0. params returns a single value, the width of the texture image. This value includes the border of the texture image. The initial value is 0. Parameters target Specifies the symbolic name of the target texture, either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_PROXY_TEXTURE_1D, or GL_PROXY_TEXTURE_2D, GL_PROXY_TEXTURE_3D, GL_PROXY_TEXTURE_3D_EXT, GL_TEXTURE_3D_EXT. Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the symbolic name of a texture parameter. GL_TEXTURE_DEPTH, GL_TEXTURE_DEPTH_EXT, GL_TEXTURE_WIDTH, GL_TEXTURE_HEIGHT, GL_TEXTURE_INTERNAL_FORMAT, GL_TEXTURE_BORDER, GL_TEXTURE_RED_SIZE, GL_TEXTURE_GREEN_SIZE, GL_TEXTURE_BLUE_SIZE, GL_TEXTURE_ALPHA_SIZE, GL_TEXTURE_LUMINANCE_SIZE, and GL_TEXTURE_INTENSITY_SIZE are accepted. Returns the requested data. level pname params Notes If an error is generated, no change is made to the contents of params. The GL_TEXTURE_INTERNAL_FORMAT parameter is only available if the GL version is 1.1 or greater. In version 1.0, use GL_TEXTURE_COMPONENTS instead. Errors GL_INVALID_ENUM is generated if target or pname is not an accepted value. GL_INVALID_VALUE is generated if level is less than zero. 182 OpenGL 2.1 Reference Manual GL_INVALID_VALUE may be generated if level is greater than log sub 2 max, where max is the returned value of GL_MAX_TEXTURE_SIZE. GL_INVALID_OPERATION is generated if glGetTexLevelParameter is executed between the execution of glBegin and the corresponding execution of glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glGetTexParameter subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexParameter subroutine. glGetTexParameter Subroutine Purpose Returns texture parameter values. Library OpenGL C bindings library: libGL.a C Syntax void glGetTexParameterfv(GLenum Target, GLenum ParameterName, GLfloat *ParameterValues) void glGetTexParameteriv(GLenum Target, GLenum ParameterName, GLint *ParameterValues) Description The glGetTexParameter subroutine returns in ParameterValues the value or values of the texture parameter specified as ParameterName. Target defines the target texture, either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, and GL_TEXTURE_3D_EXT (if the 3D texture extension is supported). ParameterName accepts the same symbols as glTexParameter, with the same interpretations: GL_TEXTURE_BASE_LEVEL GL_TEXTURE_MAX_LEVEL GL_TEXTURE_BORDER_COLOR GL_TEXTURE_MAG_FILTER GL_TEXTURE_MIN_FILTER Specifies for the texture the base array level. Any non-negative integer value is permissable. Supported in OpenGL 1.2 and later. Specifies for the texture the maximum array level. Any non-negative integer value is permissable. Supported in OpenGL 1.2 and later. Returns four integer or floating-point numbers that comprise the red, green, blue, alpha (RGBA) color of the texture border. Floating-point values are returned in the range [0,1]. Integer values are returned as a linear mapping of the internal floating-point representation such that 1.0 maps to the most positive representable integer and -1.0 maps to the most negative representable integer. Returns the single-valued texture magnification filter, a symbolic constant. Returns the single-valued texture minification filter, a symbolic constant. Chapter 1. OpenGL Subroutines 183 GL_TEXTURE_MAX_LOD Specifies for the texture the maximum level of detail of the image array. Any floating-point value is permissable. Supported in OpenGL 1.2 and later. Specifies for the texture the minimum level of detail of the image array. Any floating-point value is permissable. Supported in OpenGL 1.2 and later. GL_TEXTURE_MIN_LOD GL_TEXTURE_PRIORITY (1.1 only) GL_TEXTURE_PRIORITY_EXT (EXT_texture_object) GL_TEXTURE_RESIDENT (1.1 only) GL_TEXTURE_RESIDENT_EXT (EXT_texture_object) GL_TEXTURE_WRAP_R GL_TEXTURE_WRAP_R (3D Texture Extension) GL_TEXTURE_WRAP_S GL_TEXTURE_WRAP_T Returns the priority of the target texture (or the named texture bound to it). The initial value is 1. See glPrioritizeTextures. Returns the residence status of the target texture. If the value returned in params is GL_TRUE, the texture is resident in texture memory. See glAreTexturesResident. Returns the single-valued wrapping function for texture coordinate r, a symbolic constant. Returns the single-valued wrapping function for texture coordinate r, a symbolic constant. Returns the single-valued wrapping function for texture coordinate s, a symbolic constant. Returns the single-valued wrapping function for texture coordinate t, a symbolic constant. Parameters Target ParameterName ParameterValues Specifies the symbolic name of the target texture. GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, and GL_TEXTURE_3D_EXT (EXT_texture_3D) are accepted. Specifies the symbolic name of a texture parameter. GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAX_LOD, GL_TEXTURE_MIN_LOD, GL_TEXTURE_PRIORITY, GL_TEXTURE_PRIORITY_EXT, GL_TEXTURE_RESIDENT, GL_TEXTURE_RESIDENT_EXT, GL_TEXTURE_WRAP_R, GL_TEXTURE_WRAP_R_EXT, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, and GL_TEXTURE_BORDER_COLOR are accepted. Returns the texture parameters. Notes If an error is generated, no change is made to the contents of ParameterValues. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Either Target or ParameterName is not an accepted value. The glGetTexParameter subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glTexParameter subroutine. 184 OpenGL 2.1 Reference Manual glHint Subroutine Purpose Specifies implementation-specific hints. Library OpenGL C bindings library: libGL.a C Syntax void glHint( GLenum GLenum Mode) Target, Description Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. Target is a symbolic constant indicating the behavior to be controlled, and Mode is another symbolic constant indicating the desired behavior. Mode can be one of the following three: GL_FASTEST GL_NICEST GL_DONT_CARE The most efficient option should be chosen. The most correct or highest quality option should be chosen. The client does not have a preference. This is the initial setting for all hints. Though the implementation aspects that can be hinted are well-defined, the interpretation of the hints depends on the implementation. The hint aspects that can be specified with Target, along with suggested semantics, are: GL_FOG_HINT GL_LINE_SMOOTH_HINT GL_PERSPECTIVE_CORRECTION_HINT GL_POINT_SMOOTH_HINT GL_POLYGON_SMOOTH_HINT GL_SUBPIXEL_HINT_IBM Indicates the accuracy of fog calculation. If per-pixel fog calculation is not efficiently supported by the GL implementation, hinting GL_DONT_CARE or GL_FASTEST can result in per-vertex calculation of fog effects. Indicates the sampling quality of antialiased lines. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied. Indicates the quality of color and texture coordinate interpolation. If perspective-corrected parameter interpolation is not efficiently supported by the GL implementation, hinting GL_DONT_CARE or GL_FASTEST can result in simple linear interpolation of colors and texture coordinates. Indicates the sampling quality of antialiased points. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied. Indicates the sampling quality of antialiased polygons. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied. Indicates if primitives are rendered using subpixel sampling techniques. Hinting GL_NICEST can result in a greater accuracy of pixels turned on when a primitive is rendered. GL_FASTEST and GL_DONT_CARE may result in faster, non-subpixel positioned, rendering of some primitives. Chapter 1. OpenGL Subroutines 185 GL_CLIP_VOLUME_CLIPPING_HINT_EXT GL_PIXEL_FILTER_HINT_IBM Indicates whether clip volume clipping is desirable. Hinting GL_NICEST can result in all clipping calculations being performed, while GL_FASTEST can suppress such clipping. GL_FASTEST should only be used when the user is confident that no attempts to render will occur outside the clip volume, for the behavior of the GL library is undefined if any primitive extends beyond the clip volume. If extension IBM_clip_check is present and GL_UPDATE_CLIP_VOLUME_HINT is enabled, this hint can be automatically updated by calls to glClipBoundingBoxIBM, glClipBoundingVolumeIBM, or glClipBoundingVerticesIBM. See these routines for details. This hint is supported only if the GL_EXT_clip_volume_hint extension is supported. Indicates desired quality of pixel filtering when rendering pixel images specified by glBitmap, glCopyPixel, and glDrawPixel. Hinting GL_NICEST should perform pixel filtering that provides the best image quality, regardless of performance. GL_FASTEST should perform pixel filtering that provides the fastest possible pixel zoom regardless of the image quality. GL_DONT_CARE should perform point-sampled blits in accordance with the OpenGL specification. Parameters Target Specifies a symbolic constant indicating the behavior to be controlled. GL_FOG_HINT, GL_LINE_SMOOTH_HINT, GL_PERSPECTIVE_CORRECTION_HINT, GL_POINT_SMOOTH_HINT, GL_POLYGON_SMOOTH_HINT, GL_SUBPIXEL_HINT_IBM, GL_CLIP_VOLUME_CLIPPING_HINT_EXT and GL_PIXEL_FILTER_HINT_IBM are accepted. Specifies a symbolic constant indicating the desired behavior. GL_FASTEST, GL_NICEST, and GL_DONT_CARE are accepted. Mode Notes The interpretation of hints depends on the implementation. The glHint subroutine can be ignored. GL_CLIP_VOLUME_CLIPPING_HINT_EXT is only valid if the GL_EXT_clip_volume_hint extension is present. Errors GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_ENUM Either Target or Mode is not an accepted value. The glHint subroutine is called between a call to glBegin and the corresponding call to glEnd. The GL_PIXEL_FILTER_HINT_IBM parameter is used in an OpenGL implementation that doesn’t support the GL_EXT_pixel_filter_hint extension. Files /usr/include/GL/gl.h 186 OpenGL 2.1 Reference Manual Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine. glIndex Subroutine Purpose Sets the current color index. Library OpenGL C bindings library: libGL.a C Syntax void glIndexd(GLdouble Current) void glIndexf(GLfloat Current) void glIndexi(GLint Current) void glIndexs(GLshort Current) void glIndexdv(const GLdouble *Current) void glIndexfv(const GLfloat *Current) void glIndexiv(const GLint *Current) void glIndexsv(const GLshort *Current) void glIndexub(GLubyte Current) void glIndexubv(const GLubyte *Current) Description The glIndex subroutine updates the current (single-valued) color index. It takes one argument, the new value for the current color index. The current index is stored as a floating-point value. Integer values are converted directly to floating-point values, with no special mapping. Index values outside the representable range of the color index buffer are not clamped. However, before an index is dithered (if enabled) and written to the frame buffer, it is converted to fixed-point format. Any bits in the integer portion of the resulting fixed-point value that do not correspond to bits in the frame buffer are masked out. Parameters Current In the case of glIndexd, glIndexf, glIndexi, glIndexs, and glIndexub this parameter specifies the new value for the current color index. In the case of glIndexdv, glIndexfv, glIndexiv, glIndexsv, and glIndexubv this parameter specifies a pointer to a one-element array that contains the new value for the current color index. Notes The current index can be updated at any time. In particular, glIndex can be called between a call to glBegin and the corresponding call to glEnd. Chapter 1. OpenGL Subroutines 187 Associated Gets Associated gets for the glIndex subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_CURRENT_INDEX. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin subroutine, glColor subroutine, glEnd subroutine, glIndexPointer subroutine, glIndexPointerEXT subroutine. glIndexMask Subroutine Purpose Controls the writing of individual bits in the color index buffers. Library OpenGL C bindings library: libGL.a C Syntax void glIndexMask(GLuint Mask) Description The glIndexMask subroutine controls the writing of individual bits in the color index buffers. The least significant n bits of the Mask parameter, where n is the number of bits in a color index buffer, specify a mask. Wherever a 1 (one) appears in the mask, the corresponding bit in the color index buffer (or buffers) is made writable. Where a 0 (zero) appears, the bit is write-protected. This mask is used only in color index mode, and it affects only the buffers currently selected for writing (see glDrawBuffer). Initially, all bits are enabled for writing. Parameters Mask Specifies a bit mask to enable and disable the writing of individual bits in the color index buffers. Initially, the mask is all 1’s. Errors GL_INVALID_OPERATION The glIndexMask subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glIndexMask subroutine are as follows. (See the glGet subroutine for more information.) 188 OpenGL 2.1 Reference Manual glGet with argument GL_INDEX_WRITEMASK. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColorMask subroutine, glDepthMask subroutine, glDrawBuffer subroutine, glIndex subroutine, glStencilMask subroutine. glIndexPointer Subroutine Purpose Defines an array of color indexes. Library OpenGL C bindings library: libGL.a C Syntax void glIndexPointer( GLenum GLsizei stride, const GLvoid * pointer) type, Description The glIndexPointer subroutine specifies the location and data format of an array of color indexes to use when rendering. The type parameter specifies the data type of each color index and stride gives the byte stride from one color index to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single array storage may be more efficient on some implementations; see glInterleavedArrays.) The parameters type, stride, and pointer are saved as client-side state. The color index array is initially disabled. To enable and disable the array, call glEnableClientState and glDisableClientState with the argument GL_INDEX_ARRAY. If enabled, the color index array is used when glDrawArrays, glDrawElements or glArrayElement is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Index array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type Specifies the data type of each color index in the array. Symbolic constants GL_UNSIGNED_BYTE, GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. Chapter 1. OpenGL Subroutines 189 stride Specifies the byte offset between consecutive color indexes. If stride is zero (the initial value), the color indexes are understood to be tightly packed in the array. Specifies a pointer to the first index in the array. The initial value is 0 (NULL pointer). pointer Notes The glIndexPointer subroutine is available only if the GL version is 1.1 or greater. The color index array is initially disabled, and it won’t be accessed when glArrayElement, glDrawElements or glDrawArrays is called. Execution of glIndexPointer is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glIndexPointer subroutine is typically implemented on the client side with no protocol. Since the color index array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. The glIndexPointer subroutine is not included in display lists. Errors GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride is negative. Associated Gets glIsEnabled with argument GL_INDEX_ARRAY glGet with argument GL_INDEX_ARRAY_TYPE glGet with argument GL_INDEX_ARRAY_STRIDE glGetPointerv with argument GL_INDEX_ARRAY_POINTER Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointerListIBM subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glIndexPointerEXT Subroutine Purpose Defines an array of color indexes. Library OpenGL C bindings library: libGL.a 190 OpenGL 2.1 Reference Manual C Syntax void glIndexPointerEXT(GLenum GLsizei stride, GLsizei count, const GLvoid *pointer) type, Description The glIndexPointerEXT subroutine specifies the location and data format of an array of color indexes to use when rendering. type specifies the data type of each color index and stride gives the byte stride from one color index to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a color index array is specified, type, stride, count and pointer are saved as client-side state, and static array elements may be cached by the implementation. The color index array is enabled and disabled using glEnable and glDisable with the argument GL_INDEX_ARRAY_EXT. If enabled, the color index array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Index array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type stride count pointer Specifies the data type of each color index in the array. Symbolic constants GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE_EXT, are accepted. Specifies the byte offset between consecutive color indexes. If stride is zero the color indexes are understood to be tightly packed in the array. Specifies the number of indexes, counting from the first, that are static. Specifies a pointer to the first index in the array. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the color index array is disabled and it won’t be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although, it is not an error to call glIndexPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glIndexPointerEXT will typically be implemented on the client side with no protocol. Since the color index array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glIndexPointerEXT commands are not entered into display lists. Chapter 1. OpenGL Subroutines 191 glIndexPointerEXT is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. Errors GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative. Associated Gets glIsEnabled with argument GL_INDEX_ARRAY_EXT. glGet with argument GL_INDEX_ARRAY_SIZE_EXT. glGet with argument GL_INDEX_ARRAY_TYPE_EXT. glGet with argument GL_INDEX_ARRAY_STRIDE_EXT. glGet with argument GL_INDEX_ARRAY_COUNT_EXT. glGetPointervEXT with argument GL_INDEX_ARRAY_POINTER_EXT. File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElementEXT subroutine, glColorPointerEXT subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glGetPointervEXT subroutine, glNormalPointerEXT subroutine, glTexCoordPointerEXT subroutine, glVertexPointerEXT subroutine. glIndexPointerListIBM Subroutine Purpose Defines a list of color index arrays. Library OpenGL C bindings library: libGL.a C Syntax void glIndexPointerListIBM( GLenum GLint stride, const GLvoid ** pointer, GLint ptrstride) type, Description The glIndexPointerListIBM subroutine specifies the location and data format of a list of arrays of color indices to use when rendering. The type parameter specifies the data type of each color index. The stride parameter gives the byte stride from one color index to the next allowing vertices and attributes to be 192 OpenGL 2.1 Reference Manual packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). The ptrstride parameter specifies the byte stride from one pointer to the next in the pointer array. When a color index array is specified, type, stride, pointer and ptrstride are saved as client side state. A stride value of 0 does not specify a ″tightly packed″ array as it does in glIndexPointer. Instead, it causes the first array element of each array to be used for each vertex. Also, a negative value can be used for stride, which allows the user to move through each array in reverse order. To enable and disable the color index arrays, call glEnableClientState and glDisableClientState with the argument GL_INDEX_ARRAY. The color index array is initially disabled. When enabled, the color index arrays are used when glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glDrawArrays, glDrawElements or glArrayElement is called. The last three calls in this list will only use the first array (the one pointed at by pointer[0]). See the descriptions of these routines for more information on their use. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Index array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type stride pointer ptrstride Specifies the data type of each color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. Specifies the byte offset between consecutive color indices. The initial value is 0. Specifies a list of color index arrays. The initial value is 0 (NULL pointer). Specifies the byte stride between successive pointers in the pointer array. The initial value is 0. Notes The glIndexPointerListIBM subroutine is available only if the GL_IBM_vertex_array_lists extension is supported. Execution of glIndexPointerListIBM is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glIndexPointerListIBM subroutine is typically implemented on the client side. Since the color index array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When a glIndexPointerListIBM call is encountered while compiling a display list, the information it contains does NOT contribute to the display list, but is used to update the immediate context instead. The glIndexPointer call and the glIndexPointerListIBM call share the same state variables. A glIndexPointer call will reset the color index list state to indicate that there is only one color index list, so that any and all lists specified by a previous glIndexPointerListIBM call will be lost, not just the first list that it specified. Chapter 1. OpenGL Subroutines 193 Error Codes GL_INVALID_ENUM is generated if type is not an accepted value. Associated Gets glIsEnabled with argument GL_INDEX_ARRAY. glGetPointerv with argument GL_INDEX_ARRAY_LIST_IBM. glGet with argument GL_INDEX_ARRAY_LIST_STRIDE_IBM. glGet with argument GL_INDEX_ARRAY_STRIDE. glGet with argument GL_INDEX_ARRAY_TYPE. Related Information The glArrayElement subroutine, glIndexPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glMultiDrawArraysEXT subroutine, glMultiDrawElementsEXT subroutine, glMultiModeDrawArraysIBM subroutine, glMultiModeDrawElementsIBM subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glInitNames Subroutine Purpose Initializes the name stack. Library OpenGL C bindings library: libGL.a C Syntax void glInitNames( void ) Description The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. The glInitNames subroutine causes the name stack to be initialized to its default empty state. The name stack is always empty while the render mode is not GL_SELECT. Calls to the glInitNames subroutine while the render mode is not GL_SELECT are ignored. Errors GL_INVALID_OPERATION The glInitNames subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glInitNames subroutine are as follows. (See the glGet subroutine for more information.) 194 OpenGL 2.1 Reference Manual glGet with argument GL_NAME_STACK_DEPTH glGet with argument GL_MAX_NAME_STACK_DEPTH. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glLoadName subroutine, glPushName subroutine, glRenderMode subroutine, glSelectBuffer subroutine. glInterleavedArrays Subroutine Purpose Simultaneously specifies and enables several interleaved arrays. Library OpenGL C bindings library: libGL.a C Syntax void glInterleavedArrays(GLenum GLsizei stride, const GLvoid *pointer) format, Description The glInterleavedArrays subroutine lets you specify and enable individual color, normal, texture and vertex arrays whose elements are part of a larger aggregate array element. For some implementations, this is more efficient than specifying the arrays seperately. If stride is zero then the aggregate element are stored consecutively, otherwise stride bytes occur between aggregate array elements. The format enumerant serves as a ’key’ describing the extraction of individual arrays from the aggregate array. If format contains a T, then texture coordinates are extracted from the interleaved array. If C is present, color values are extracted. If N is present, normal coordinates are extracted; Vertex coordinates are always extracted. The digits 2, 3, and 4 denote how many values are extracted. F indicates that values are extracted as floating point values. Colors may also be extracted as 4 unsigned bytes if 4UB follows the C. If a color is extracted as 4 unsigned bytes, the vertex array element which follows is located at the first possible floating point aligned address. Parameters format stride Specifies the type of array to enable. Symbolic constants GL_V2F, GL_V3F, GL_C4UB_V2F, GL_C4UB_V3F, GL_C3F_V3F, GL_N3F_V3F, GL_C4F_N3F_V3F, GL_T2F_V3F, GL_T4F_V4F, GL_T2F_C4UB_V3F, GL_T2F_C3F_V3F, GL_T2F_N3F_V3F, GL_T2F_C4F_N3F_V3F, or GL_T4F_C4F_N3F_V4F are accepted. Specifies the offset in bytes between each aggregate array element. Chapter 1. OpenGL Subroutines 195 Notes The glInterleavedArrays subroutine is available only if the GL version is 1.1 or greater. If glInterleavedArrays is called while compiling a display list, it is not compiled into the list, and it is executed immediately. Execution of glInterleavedArrays is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glInterleavedArrays subroutine is typically implemented on the client side with no protocol. Since the vertex array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. Errors GL_INVALID_ENUM is generated if format is not an accepted value. GL_INVALID_VALUE is generated if stride is negative. Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnableClientState subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glNormalPointer subroutine, PopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glIsEnabled Subroutine Purpose Tests whether a capability is enabled. Library OpenGL C bindings library: libGL.a C Syntax GLboolean glIsEnabled (GLenum Capability) Description The glIsEnabled subroutine returns GL_TRUE if the Capability parameter is an enabled capability and returns GL_FALSE otherwise. The following capabilities are accepted for Capability: GL_ALPHA_TEST GL_AUTO_NORMAL GL_BLEND GL_CLIP_PLANEi GL_COLOR_ARRAY GL_COLOR_ARRAY_EXT GL_COLOR_LOGIC_OP GL_COLOR_MATERIAL GL_COLOR_SUM_EXT GL_CULL_FACE GL_CULL_VERTEX_IBM GL_DEPTH_TEST 196 OpenGL 2.1 Reference Manual See See See See See See See See See See See See glAlphaFunc. glEvalCoord. glBlendFunc. glClipPlane. glColorPointer glColorPointerEXT glLogicOp. glColorMaterial. glSecondaryColorEXT. glCullFace. GL_CULL_VERTEX_IBM. glDepthFunc and glDepthRange. GL_DITHER GL_EDGE_FLAG_ARRAY GL_EDGE_FLAG_ARRAY_EXT GL_FOG GL_INDEX_ARRAY GL_INDEX_ARRAY_EXT GL_LIGHTi GL_LIGHTING GL_LINE_SMOOTH GL_LINE_STIPPLE GL_LOGIC_OP GL_MAP1_COLOR_4 GL_MAP1_INDEX GL_MAP1_NORMAL GL_MAP1_TEXTURE_COORD_1 GL_MAP1_TEXTURE_COORD_2 GL_MAP1_TEXTURE_COORD_3 GL_MAP1_TEXTURE_COORD_4 GL_MAP1_VERTEX_3 GL_MAP1_VERTEX_4 GL_MAP2_COLOR_4 GL_MAP2_INDEX GL_MAP2_NORMAL GL_MAP2_TEXTURE_COORD_1 GL_MAP2_TEXTURE_COORD_2 GL_MAP2_TEXTURE_COORD_3 GL_MAP2_TEXTURE_COORD_4 GL_MAP2_VERTEX_3 GL_MAP2_VERTEX_4 GL_NORMAL_ARRAY GL_NORMAL_ARRAY_EXT GL_NORMALIZE GL_OCCLUSION_CULLING_HP GL_POINT_SMOOTH GL_POLYGON_SMOOTH GL_POLYGON_STIPPLE GL_POLYGON_OFFSET_EXT GL_POLYGON_OFFSET_FILL GL_POLYGON_OFFSET_LINE GL_POLYGON_OFFSET_POINT GL_RESCALE_NORMAL_EXT GL_SCISSOR_TEST GL_STENCIL_TEST GL_TEXTURE_1D GL_TEXTURE_2D GL_TEXTURE_3D_EXT GL_TEXTURE_COLOR_TABLE_EXT GL_TEXTURE_COORD_ARRAY GL_VERTEX_ARRAY GL_TEXTURE_COORD_ARRAY_EXT GL_TEXTURE_GEN_Q GL_TEXTURE_GEN_R GL_TEXTURE_GEN_S GL_TEXTURE_GEN_T GL_UPDATE_CLIP_VOLUME_HINT See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See See glEnable. glEdgeFlagPointer. glEdgeFlagPointerEXT glFog. glIndexPointer. glIndexPointerEXT glLightModel and glLight. glMaterial, glLightModel, and glLight. glLineWidth. glLineStipple. glLogicOp. glMap1. glMap1. glMap1. glMap1. glMap1. glMap1. glMap1. glMap1. glMap1. glMap2. glMap2. glMap2. glMap2. glMap2. glMap2. glMap2. glMap2. glMap2. glNormalPointer. glNormalPointerEXT glNormal. glEnable. glPointSize. glPolygonMode. glPolygonStipple. glPolygonOffsetEXT glPolygonOffset. glPolygonOffset. glPolygonOffset. glEnable. glScissor. glStencilFunc and glStencilOp. glTexImage1D. glTexImage2D. glTexImage3DEXT glColorTable. glTexCoordPointer. glVertexPointer. glTexCoordPointerEXT glTexGen. glTexGen. glTexGen. glTexGen. glHint. Chapter 1. OpenGL Subroutines 197 GL_VERTEX_ARRAY_EXT See glVertexPointerEXT. Parameters Capability Specifies a symbolic constant indicating a GL capability. Notes If an error is generated, glIsEnabled returns 0 (zero). Errors GL_INVALID_ENUM GL_INVALID_OPERATION Capability is not an accepted value. The glIsEnabled subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable subroutine. glIsList Subroutine Purpose Tests for display list existence. Library OpenGL C bindings library: libGL.a C Syntax GLboolean glIsList(GLuint List) Description The glIsList subroutine returns GL_TRUE if the List parameter is the name of a display list and returns GL_FALSE otherwise. Parameters List Specifies a potential display-list name. Errors GL_INVALID_OPERATION 198 OpenGL 2.1 Reference Manual The glIsList subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallList subroutine, glCallLists subroutine, glDeleteLists subroutine, glGenLists subroutine, glNewList subroutine. glIsTexture Subroutine Purpose Determines if a name corresponds to a texture. Library OpenGL C bindings library: libGL.a C Syntax GLboolean glIsTexture(GLuint texture) Description The glIsTexture subroutine returns GL_TRUE if texture is currently the name of a texture. If texture is zero, or is a non-zero value that is not currently the name of a texture, or if an error occurs, glIsTexture returns GL_FALSE. The glIsTexture subroutine is not included in display lists. Parameters texture Specifies a value which may be the name of a texture. Notes The glIsTexture subroutine is available only if the GL version is 1.1 or greater. Errors GL_INVALID_OPERATION is generated if glIsTexture is executed between the execution of glBegin and the corresponding execution of glEnd. Related Information The glBindTexture subroutine, glDeleteTextures subroutine, glGenTextures subroutine, glGet subroutine, glGetTexParameter subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexParameter subroutine. glIsTextureEXT Subroutine Purpose Determines if a name corresponds to a texture. Chapter 1. OpenGL Subroutines 199 Library OpenGL C bindings library: libGL.a C Syntax GLboolean glIsTextureEXT( GLuint texture ) Description glIsTextureEXT returns GL_TRUE if texture is currently the name of a texture. If texture is zero, or is a non-zero value that is not currently the name of a texture, or if an error occurs, glIsTextureEXT returns GL_FALSE. glIsTextureEXT is not included in display lists. Parameters texture A value which might be the name of a texture. Notes glIsTextureEXT is part of the EXT_texture_object extension, not part of the core GL command set. If GL_EXT_texture_object is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_texture_object is supported by the connection. Errors GL_INVALID_OPERATION is generated if glIsTextureEXT is executed between the execution of glBegin and the corresponding execution of glEnd. File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBindTextureEXT subroutine, glDeleteTexturesEXT subroutine, glGenTexturesEXT subroutine, glGet subroutine, glGetTexParameter subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexParameter subroutine. glLight Subroutine Purpose Sets light source parameters. Library OpenGL C bindings library: libGL.a C Syntax void glLightf(GLenum Light, GLenum ParameterName, GLfloat Parameter) 200 OpenGL 2.1 Reference Manual void glLighti(GLenum Light, GLenum ParameterName, GLint Parameter) void glLightfv(GLenum Light, GLenum ParameterName, const GLfloat * ParameterValues) void glLightiv(GLenum Light, GLenum ParameterName, const GLint * ParameterValues) Description The glLight subroutine sets the values of individual light source parameters. Light names the light and is a symbolic name of the form GL_LIGHTi, where 0 is less than or equal to i which is less than GL_MAX_LIGHTS. ParameterName specifies one of 10 light source parameters, again by symbolic name. ParameterValues is either a single value or a pointer to an array that contains the new values. Lighting calculation is enabled and disabled using glEnable and glDisable with argument GL_LIGHTING. When lighting is enabled, light sources that are enabled contribute to the lighting calculation. Light source i is enabled and disabled using glEnable and glDisable with argument GL_LIGHTi. The 10 light parameters are as follows: GL_AMBIENT GL_DIFFUSE GL_SPECULAR ParameterValues contains four integer or floating-point values that specify the ambient red, green, blue, alpha (RGBA) intensity of the light. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default ambient light intensity is (0.0, 0.0, 0.0, 1.0). ParameterValues contains four integer or floating-point values that specify the diffuse RGBA intensity of the light. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default diffuse intensity is (0.0, 0.0, 0.0, 1.0) for all lights other than light zero. The default diffuse intensity of light zero is (1.0, 1.0, 1.0, 1.0). ParameterValues contains four integer or floating-point values that specify the specular RGBA intensity of the light. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default specular intensity is (0.0, 0.0, 0.0, 1.0) for all lights other than light zero. The default specular intensity of light zero is (1.0, 1.0, 1.0, 1.0). Chapter 1. OpenGL Subroutines 201 GL_POSITION GL_SPOT_DIRECTION GL_SPOT_EXPONENT GL_SPOT_CUTOFF GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, or GL_QUADRATIC_ATTENUATION 202 OpenGL 2.1 Reference Manual ParameterValues contains four integer or floating-point values that specify the position of the light in homogeneous object coordinates. Both integer and floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The position is transformed by the modelview matrix when glLight is called (just as if it were a point), and it is stored in eye coordinates. If the w component of the position is 0.0, the light is treated as a directional source. Diffuse and specular lighting calculations consider the light’s direction, but not its actual position, and attenuation is disabled. Otherwise, diffuse and specular lighting calculations are based on the actual location of the light in eye coordinates, and attenuation is enabled. The default position is (0,0,1,0); thus, the default light source is directional, as well as parallel to and in the direction of the -z axis. ParameterValues contains three integer or floating-point values that specify the direction of the light in homogeneous object coordinates. Both integer and floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The spot direction is transformed by the inverse of the modelview matrix when glLight is called (just as if it were a normal), and it is stored in eye coordinates. It is significant only when GL_SPOT_CUTOFF is not 180, which it is by default. The default direction is (0,0,-1). ParameterValues is a single integer or floating-point value that specifies the intensity distribution of the light. Integer and floating-point values are mapped directly. Only values in the range [0,128] are accepted. Effective light intensity is attenuated by the cosine of the angle between the direction of the light and the direction from the light to the vertex being lighted, raised to the power of the spot exponent. Thus, higher spot exponents result in a more focused light source, regardless of the spot cutoff angle. (See the GL_SPOT_CUTOFF description.) The default spot exponent is 0, resulting in uniform light distribution. ParameterValues is a single integer or floating-point value that specifies the maximum spread angle of a light source. Integer and floating-point values are mapped directly. Only values in the range [0,90] and the special value 180 are accepted. If the angle between the direction of the light and the direction from the light to the vertex being lighted is greater than the spot cutoff angle, the light is completely masked. Otherwise, its intensity is controlled by the spot exponent and the attenuation factors. The default spot cutoff is 180, resulting in uniform light distribution. ParameterValues is a single integer or floating-point value that specifies one of the three light attenuation factors. Integer and floating-point values are mapped directly. Only nonnegative values are accepted. If the light is positional, rather than directional, its intensity is attenuated by the reciprocal of the sum of the constant factor, the linear factor times the distance between the light and the vertex being lighted, and the quadratic factor times the square of the same distance. The default attenuation factors are (1,0,0), resulting in no attenuation. Parameters Light ParameterName Parameter ParameterValues Specifies a light. The number of lights depends on the implementation, but at least eight lights are supported. They are identified by symbolic names of the form GL_LIGHTi where 0 is less than or equal to i which is less than GL_MAX_LIGHTS. For glLightf, glLighti, and glLightv, this parameter specifies a single-valued light source parameter for Light. GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION are accepted. For glLightfv and glLightiv, this parameter specifies a light source parameter for Light. GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION, GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION are accepted. Specifies the value to which the parameter ParameterName of light source Light is set. Specifies a pointer to the value or values to which the parameter ParameterName of light source Light is set. This parameter is used only with glLightfv and glLightiv. Notes It is always the case that GL_LIGHTi = GL_LIGHT0 + i. Errors GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_OPERATION Either Light or ParameterName is not an accepted value. A spot exponent value is specified outside the range [0,128], or spot cutoff is specified outside the range [0,90] (except for the special value 180), or a negative attenuation factor is specified. The glLight subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLight subroutine are as follows. (See the glGet subroutine for more information.) glGetLight glIsEnabled with argument GL_LIGHTING. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColorMaterial subroutine, glEnable or glDisable subroutine, glLightModel subroutine, glMaterial subroutine. glLightModel Subroutine Purpose Sets the lighting model parameters. Chapter 1. OpenGL Subroutines 203 Library OpenGL C bindings library: libGL.a C Syntax void glLightModelf(GLenum ParameterName, GLfloat Parameter) void glLightModeli(GLenum ParameterName, GLint Parameter) void glLightModelfv(GLenum ParameterName, const GLfloat * ParameterValues) void glLightModeliv(GLenum ParameterName, const GLint * ParameterValues) Description The glLightModel subroutine sets the lighting model parameters. ParameterName names a parameter and ParameterValues gives the new value. There are three lighting model parameters: GL_LIGHT_MODEL_COLOR_CONTROL GL_LIGHT_MODEL_AMBIENT GL_LIGHT_MODEL_LOCAL_VIEWER GL_LIGHT_MODEL_TWO_SIDE 204 OpenGL 2.1 Reference Manual Lighting produces two colors at the vertex: a primary color and a secondary color. The values of the two colors depend on the light model color control. ParameterValues can be GL_SINGLE_COLOR or GL_SPECULAR_COLOR. GL_SINGLE_COLOR is the default value. Depending upon the ParameterValues, the lighting equations compute the two colors differently. All computations are carried out in eye coordinates ParameterValues contains four integer or floating-point values that specify the ambient red, green, blue, alpha (RGBA) intensity of the entire scene. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default ambient scene intensity is (0.2, 0.2, 0.2, 1.0). ParameterValues is a single integer or floating-point value that specifies how specular reflection angles are computed. If ParameterValues is 0 (or 0.0), specular reflections are computed from the origin of the eye coordinate system. Otherwise, reflection angles take the view direction to be parallel to and in the direction of the -z axis, regardless of the location of the vertex in eye coordinates. The default is False. ParameterValues is a single integer or floating-point value that specifies whether one-sided or two-sided lighting calculations are done for polygons. It has no effect on the lighting calculations for points, lines, or bitmaps. If ParameterValues is 0 (or 0.0), one-sided lighting is specified, and only the front material parameters are used in the lighting equation. Otherwise, two-sided lighting is specified. In this case, vertices of backfacing polygons are lighted using the back material parameters, and have their normals reversed before the lighting equation is evaluated. Vertices of frontfacing polygons are always lighted using the front material parameters, with no change to their normals. The default is False. In RGBA mode, the lighted color of a vertex is the sum of the material emission intensity, the product of the material ambient reflectance and the lighting model full-scene ambient intensity, and the contribution of each enabled light source. Each light source contributes the sum of three terms: ambient, diffuse, and specular. v The ambient light source contribution is the product of the material ambient reflectance and the light’s ambient intensity. v The diffuse light source contribution is the product of the material diffuse reflectance, the light’s diffuse intensity, and the dot product of the vertex’s normal with the normalized vector from the vertex to the light source. v The specular light source contribution is the product of the material specular reflectance, the light’s specular intensity, and the dot product of the normalized vertex-to-eye and vertex-to-light vectors, raised to the power of the shininess of the material. All three light source contributions are attenuated equally based on the distance from the vertex to the light source and on light source direction, spread exponent, and spread cutoff angle. All dot products are replaced with 0 (zero) if they are a negative value. The alpha component of the resulting lighted color is set to the alpha value of the material diffuse reflectance. In color index mode, the value of the lighted index of a vertex ranges from the ambient to the specular values passed to glMaterial using GL_COLOR_INDEXES. The extent to which the resulting index is above ambient is determined by diffuse and specular coefficients, computed with a weighting of the lights’ colors (.30, .59, .11); the shininess of the material; and the same reflection and attenuation equations as in the RGBA case. Parameters ParameterName Parameter ParameterValues For glLightModelf and glLightModeli, this parameter specifies a single-valued lighting model parameter. GL_LIGHT_MODEL_COLOR_CONTROL, GL_LIGHT_MODEL_LOCAL_VIEWER, and GL_LIGHT_MODEL_TWO_SIDE are accepted. For glLightModelfv and glLightModeliv, this parameter specifies a lighting model parameter. GL_LIGHT_MODEL_AMBIENT, GL_LIGHT_MODEL_COLOR_CONTROL, GL_LIGHT_MODEL_LOCAL_VIEWER, and GL_LIGHT_MODEL_TWO_SIDE are accepted. Specifies the value to which ParameterName is set. This parameter applies only to GL_LIGHT_MODEL_COLOR_CONTROL, glLightModelf, and glLightModeli. Specifies a pointer to the value or values to which ParameterName is set. This parameter applies only to glLightModelfv and glLightModeliv. Errors GL_INVALID_ENUM GL_INVALID_OPERATION ParameterName is not an accepted value. The glLightModel subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLightModel subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_LIGHT_MODEL_AMBIENT. Chapter 1. OpenGL Subroutines 205 glGet with argument GL_LIGHT_MODEL_LOCAL_VIEWER. glGet with argument GL_LIGHT_MODEL_TWO_SIDE. glIsEnabled with argument GL_LIGHTING. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable or glDisable subroutine, glLight subroutine, glMaterial subroutine. glLineStipple Subroutine Purpose Specifies the line stipple pattern. Library OpenGL C bindings library: libGL.a C Syntax void glLineStipple(GLint GLushort Pattern) Factor, Description Line stippling masks out certain fragments produced by rasterization; those fragments are not drawn. The masking is achieved by using three parameters: the 16-bit line stipple pattern (the Pattern parameter), the repeat count (the Factor parameter), and an integer stipple counter s. Counter s is reset to 0 (zero) whenever the glBegin subroutine is called, and before each line segment of a glBegin(GL_LINES)glEnd sequence is generated. It is incremented after each fragment of a unit width aliased line segment is generated, or after each of the i fragments of an i width line segment are generated. The i fragments associated with count s are masked out if Pattern bit floor (s/Factor) mod 16 is 0, otherwise these fragments are sent to the frame buffer. Bit 0 of the Pattern parameter is the least significant bit. Antialiased lines are treated as a sequence of 1 times width rectangles for purposes of stippling. Rectangle s is rasterized or not rasterized, based on the fragment rule described for aliased lines, counting rectangles rather than groups of fragments. Line stippling is enabled or disabled using the glEnable and glDisable subroutines with the GL_LINE_STIPPLE argument. When enabled, the line stipple pattern is applied as described in the preceding section. When disabled, it is as if the pattern were all 1s. Initially, line stippling is disabled. 206 OpenGL 2.1 Reference Manual Parameters Factor Pattern Specifies a multiplier for each bit in the line stipple pattern. If Factor is 3, for example, each bit in the pattern is used three times before the next bit in the pattern is used. Factor is clamped to the range [1, 255] and defaults to 1. Specifies a 16-bit integer whose bit pattern determines which fragments of a line is drawn when the line is rasterized. Bit 0 is used first, and the default pattern is all 1s. Errors GL_INVALID_OPERATION The glLineStipple subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLineStipple subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_LINE_STIPPLE_PATTERN glGet with argument GL_LINE_STIPPLE_REPEAT glIsEnabled with argument GL_LINE_STIPPLE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin subroutine, glEnable or Disable subroutine, glLineWidth subroutine, glPolygonStipple subroutine. glLineWidth Subroutine Purpose Specifies the width of rasterized lines. Library OpenGL C bindings library: libGL.a C Syntax void glLineWidth(GLfloat Width) Description The glLineWidth subroutine specifies the rasterized width of both aliased and antialiased lines. Using a line width other than 1.0 has different effects, depending on whether line antialiasing is enabled. Line antialiasing is controlled by calling the glEnable and glDisable subroutines with the GL_LINE_SMOOTH argument. Chapter 1. OpenGL Subroutines 207 If line antialiasing is disabled, the actual width is determined by rounding the supplied width to the nearest integer. (If the rounding results in the value 0 (zero), it is as if the line width were 1 (one).) If | DELTAx | > | DELTAy |, i pixels are filled in each column that is rasterized, where i is the rounded value of Width. Otherwise, i pixels are filled in each row that is rasterized. If antialiasing is enabled, line rasterization produces a fragment for each pixel square that intersects the region lying within the rectangle. The fragment has a width equal to the current line width, a length equal to the actual length of the line, and is centered on the mathematical line segment. The coverage value for each fragment is the window coordinate area of the intersection of the rectangular region with the corresponding pixel square. This value is saved and used in the final rasterization step. Not all widths can be supported when line antialiasing is enabled. If an unsupported width is requested, the nearest supported width is used. Only width 1.0 is guaranteed to be supported; others depend on the implementation. The range of supported widths and the size difference between supported widths within the range can be queried by calling the glGet subroutine with the GL_LINE_WIDTH_RANGE and GL_LINE_WIDTH_GRANULARITY arguments. Parameters Width Specifies the width of rasterized lines. The default is 1.0. Notes The line width specified by glLineWidth is always returned when GL_LINE_WIDTH is queried. Clamping and rounding for aliased and antialiased lines have no effect on the specified value. Non-antialiased line width may be clamped to an implementation-dependent maximum. Although this maximum cannot be queried, it must be no less than the maximum value for antialiased lines, rounded to the nearest integer value. Errors GL_INVALID_VALUE GL_INVALID_OPERATION Width is less than or equal to 0. The glLineWidth subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLineWidth subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_LINE_WIDTH glGet with argument GL_LINE_WIDTH_RANGE glGet with argument GL_LINE_WIDTH_GRANULARITY glIsEnabled with argument GL_LINE_SMOOTH. Files /usr/include/GL/gl.h 208 OpenGL 2.1 Reference Manual Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable or Disable subroutine. glListBase Subroutine Purpose Sets the display-list base for the glCallLists subroutine. Library OpenGL C bindings library: libGL.a C Syntax void glListBase(GLuint Base) Description The glCallLists subroutine specifies an array of offsets. Display-list names are generated by adding the Base parameter to each offset. Names that reference valid display lists are executed; the others are ignored. Parameters Base Specifies an integer offset that is added to glCallLists offsets to generate display-list names. Initial value is 0 (zero). Errors GL_INVALID_OPERATION The glListBase subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glListBase subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_LIST_BASE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallLists subroutine. glLoadIdentity Subroutine Purpose Replaces the current matrix with the identity matrix. Chapter 1. OpenGL Subroutines 209 Library OpenGL C bindings library: libGL.a C Syntax void glLoadIdentity( void ) Description The glLoadIdentity subroutine replaces the current matrix with the identity matrix. It is semantically equivalent to calling the glLoadMatrix subroutine with the following identity matrix: Figure 6. Identity Matrix. This diagram shows a matrix enclosed in brackets. The matrix consists of four lines containing four characters each. The first line contains the following (from left to right): one, zero, zero, zero. The second line contains the following (from left to right): zero, one, zero, zero. The third line contains the following (from left to right): zero, zero, one, zero. The fourth line contains the following (from left to right): zero, zero, zero, one. Calling glLoadIdentity is in some cases more efficient. Errors GL_INVALID_OPERATION The glLoadIdentity subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLoadIdentity subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glLoadMatrix subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glPushMatrix subroutine. 210 OpenGL 2.1 Reference Manual glLoadMatrix Subroutine Purpose Replaces the current matrix with an arbitrary matrix. Library OpenGL C bindings library: libGL.a C Syntax void glLoadMatrixd(const GLdouble void glLoadMatrixf(const GLfloat *Matrix) *Matrix) Description The glLoadMatrix subroutine replaces the current matrix with the one specified in the Matrix parameter. The current matrix is the projection matrix, model view matrix, or texture matrix, determined by the current matrix mode. (See the glMatrixMode subroutine for information on specifiying the current matrix.) The Matrix parameter points to a 4 x 4 matrix of single- or double-precision floating-point values stored in column-major order. That is, the matrix is stored as the following: a0 a4 a8 a12 a1 a5 a9 a13 a2 a6 a10 a14 a3 a7 a11 a15 Figure 7. Stored Matrix. This diagram shows a matrix enclosed in brackets. The matrix consists of four lines containing four characters each. The first line contains the following (from left to right): a subscript zero, a subscript four, a subscript eight, a subscript twelve. The second line contains the following (from left to right): a subscript one, a subscript five, a subscript nine, a subscript thirteen. The third line contains the following (from left to right): a subscript two, a subscript six, a subscript ten, a subscript fourteen. The fourth line contains the following (from left to right): a subscript three, a subscript seven, a subscript eleven, a subscript fifteen. Parameters Matrix Specifies a pointer to 4 x 4 matrix stored in column-major order as 16 consecutive values. Errors GL_INVALID_OPERATION The glLoadMatrix subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLoadMatrix subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX Chapter 1. OpenGL Subroutines 211 glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glLoadIdentity subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glPushMatrix subroutine, glLoadTransposeMatrixARB subroutine. glLoadName Subroutine Purpose Loads a name onto the name stack. Library OpenGL C bindings library: libGL.a C Syntax void LoadName(GLuint Name) Description The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. The glLoadName subroutine causes the Name parameter to replace the value on the top of the name stack, which is initially empty. The name stack is always empty while the render mode is not GL_SELECT. Calls to glLoadName while the render mode is not GL_SELECT are ignored. Parameters Name Specifies a name that replaces the top value on the name stack. Errors GL_INVALID_OPERATION GL_INVALID_OPERATION The glLoadName subroutine is called while the name stack is empty. The glLoadName subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLoadName subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_NAME_STACK_DEPTH. glGet with argument GL_MAX_NAME_STACK_DEPTH. 212 OpenGL 2.1 Reference Manual Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glInitNames subroutine, glPushName subroutine, glRenderMode subroutine, glSelectBuffer subroutine. glLoadNamedMatrixIBM Subroutine Purpose Loads a pre-defined matrix into the top of the named matrix stack. Library OpenGL C bindings library: (libGL.a) C Syntax void glLoadNamedMatrixIBM(GLenum GLenum matrix, name) Description Using this subroutine, a predefined matrix can be loaded into any matrix stack, regardless of the current matrix mode in use. glLoadNamedMaxtrixIBM(matrix, GL_IDENTITY_MATRIX_IBM) is functionally equivalent to: PushAttrib(GL_TRANSFORM_BIT); MatrixMode(matrix); LoadIdentity(); PopAttrib(); This subroutine does NOT change the current matrix mode. Parameters matrix name specifies which of the matrices to load. Acceptable values are GL_COLOR, GL_TEXTURE, GL_MODELVIEW, and GL_PROJECTION. specifies the named matrix to load. Acceptable values and their corresponding matrices are: GL_IDENTITY_MATRIX_IBM 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 GL_YCRCB_TO_RGB_MATRIX_IBM 1.164 0.000 1.596 -0.874 1.164 -0.392 -0.813 0.532 1.164 2.017 0.000 1.000 0.000 0.000 0.000 1.000 GL_RGB_TO_YCRCB_MATRIX_IBM 0.257 0.504 0.098 0.063 -0.148 -0.291 0.439 0.502 0.439 -0.368 -0.071 0.502 0.000 0.000 0.000 1.000 Note that the second and third parameters above are only valid if the GL_IBM_YCbCr extension is present. Chapter 1. OpenGL Subroutines 213 Notes This subroutine is only available if the GL_IBM_load_matrix extension is present. Error Codes GL_INVALID_ENUM GL_INVALID_ENUM is generated if matrix is not one of the acceptable values. is generated if name is not one of the acceptable values. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. glLoadTransposeMatrixARB Subroutine Purpose Loads a matrix in row-major order, rather than column-major order. Library OpenGL C bindings library: (libGL.a) C Syntax void glLoadTransposeMatrixfARB(const GLfloat *Matrix) void glLoadTransposeMatrixdARB(const GLdouble *Matrix) Description The glLoadTransposeMatrixARB subroutine replaces the current matrix with the one specified in the Matrix parameter. The current matrix is the projection matrix, model view matrix, or texture matrix, determined by the current matrix mode. (See the glMatrixMode subroutine for information on specifiying the current matrix.) The Matrix parameter points to a 4 x 4 matrix of single- or double-precision floating-point values stored in row-major order. That is, the matrix is stored as the following: / | | \ a0 a4 a8 a12 a1 a5 a9 a13 a2 a6 a10 a14 a3 a7 a11 a15 \ | | / Parameters Matrix is an array of 16 values, specified in row-major order. Error Codes GL_INVALID_OPERATION 214 OpenGL 2.1 Reference Manual is generated if glLoadTransposeMatrixARB is executed between the execution of glBegin and the corresponding execution of glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glLoadMatrix subroutine, the glMatrixMode subroutine. glLockArraysEXT Subroutine Purpose Locks the currently enabled vertex arrays. Library OpenGL C bindings library: libGL.a C Syntax void glLockArraysEXT (int sizei count) first, Description The currently enabled vertex arrays can be locked with the subroutine glLockArraysEXT. When the vertex arrays are locked, the GL can compile the array data or the transformed results of array data associated with the currently enabled vertex arrays. The vertex arrays are unlocked by the glUnlockArraysEXT subroutine. Between glLockArraysEXT and glUnlockArraysEXT the application should ensure that none of the array data in the range of elements specified by first and count are changed. Changes to the array data between the execution of glLockArraysEXT and glUnlockArraysEXT subroutines may affect calls to DrawArrays, ArrayElement, or DrawElements subroutines in non-sequential ways. While using a compiled vertex array, references to array elements by the subroutines DrawArrays, ArrayElement, or DrawElements which are outside of the range specified by first and count are undefined. This extension defines an interface which allows static vertex array data to be cached or pre-compiled for more efficient rendering. This is useful for implementations which can cache the transformed results of array data for reuse by several DrawArrays, ArrayElement, or DrawElements subroutines. It is also useful for implementations which can transfer array data to fast memory for more efficient processing. For example, rendering an M by N mesh of quadrilaterals can be accomplished by setting up vertex arrays containing all of the vertexes in the mesh and issuing M DrawElements subroutines each of which operate on 2 * N vertexes. Each DrawElements subroutine after the first will share N vertexes with the preceding DrawElements subroutine. If the vertex array data is locked while the DrawElements subroutines are executed, then OpenGL may be able to transform each of these shared vertexes just once. Parameters first count The first element in the locked range. The number of elements to be contained in the locked range. Chapter 1. OpenGL Subroutines 215 Errors INVALID_VALUE INVALID_OPERATION First is less than or equal to zero. The glLockArraysEXT subroutine is called between execution of glLockArraysEXT and the corresponding execution of glUnlockArraysEXT. The glLockArraysEXT subroutine is called between execution of Begin and the corresponding execution of End. INVALID_OPERATION Related Information The glUnlockArraysEXT subroutine. glLogicOp Subroutine Purpose Specifies a logical pixel operation for color index rendering. Library OpenGL C bindings library: libGL.a C Syntax void LogicOp(GLenum OperatorCode) Description The glLogicOp subroutine specifies a logical operation that, when enabled, is applied between the incoming color and the color at the corresponding location in the frame buffer. The logical operation is enabled or disabled with the glEnable and glDisable subroutines using the GL_LOGIC_OP symbolic constant for color index mode or the GL_COLOR_LOGIC_OP for RGB mode. The OperatorCode parameter specifies a symbolic constant chosen from the following list. In the explanation of the logical operations, s represents the incoming color index and d represents the index in the frame buffer. Standard C-language operators are used. As these bit-wise operators suggest, the logical operation is applied independently to each bit pair of the source and destination indexes. Operation GL_CLEAR GL_SET GL_COPY GL_COPY_INVERTED GL_NOOP GL_INVERT GL_AND GL_NAND GL_OR GL_NOR GL_XOR GL_EQUIV GL_AND_REVERSE GL_AND_INVERTED GL_OR_REVERSE GL_OR_INVERTED 216 Resulting Value 0 1 s !s d !d s&d !(s & d) s|d !(s | d) s|d !(s | d) s & !d !s & d s | !d !s | d OpenGL 2.1 Reference Manual Parameters OperatorCode Specifies a symbolic constant that selects a logical operation. The following symbols are accepted: v GL_CLEAR v GL_SET v GL_COPY v GL_COPY_INVERTED v GL_NOOP v GL_INVERT v GL_AND v GL_NAND v GL_OR v GL_NOR v GL_XOR v GL_EQUIV v GL_AND_REVERSE v GL_AND_INVERTED v GL_OR_REVERSE v GL_OR_INVERTED Notes When more than one color index buffer is enabled for drawing, logical operations are done separately for each enabled buffer, using the contents of that buffer for the destination index. (See the glDrawBuffer subroutine for information about specifying color buffers for drawing.) The OperatorCode parameter must be one of the 16 accepted values. Other values result in an error. Errors GL_INVALID_ENUM GL_INVALID_OPERATION OperatorCode is not an accepted value. The glLogicOp subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glLogicOp subroutine are as follows. (See the glGet subroutine for more information.) glEnable or glDisable with argument GL_COLOR_LOGIC_OP for RGB mode or GL_INDEX_LOGIC_OP for color index mode. glGet with argument GL_LOGIC_OP_MODE. glIsEnabled with argument GL_LOGIC_OP. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Chapter 1. OpenGL Subroutines 217 Related Information The glAlphaFunc subroutine, glBegin or glEnd subroutine, glBlendEquationEXT subroutine, glBlendFunc subroutine, glDrawBuffer subroutine, glEnable or Disable subroutine, glStencilOp subroutine. glMap1 Subroutine Purpose Defines a 1-dimensional (1D) evaluator. Library OpenGL C bindings library: libGL.a C Syntax void glMap1d(GLenum Target, GLdouble u1, GLdouble u2, GLint Stride, GLint Order, const GLdouble * Points) void glMap1f(GLenum Target, GLfloat u1, GLfloat u2, GLint Stride, GLint Order, const GLfloat * Points) Description Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent to further stages of GL processing just as if they had been presented using the glVertex, glNormal, glTexCoord, and glColor subroutines, except that the generated values do not update the current normal, texture coordinates, or color. All polynomial or rational polynomial splines of any degree (up to the maximum degree supported by the GL implementation) can be described using evaluators. These include almost all splines used in computer graphics, such as B-splines, Bezier curves, and Hermite splines. Evaluators define curves based on Bernstein polynomials. Define p(t) as the following: Let p(t) = Bn0(t)R0 + Bn1(t)R1 + . . . + Bnn(t)Rn where Ri is a control point and Bni(t) is the ith Bernstein polynomial of degree: n (Order = n+1) See the figure: 218 OpenGL 2.1 Reference Manual n k n! n is the binomial coefficient given by = k k! (n–k)! Figure 8. Binomial Coefficient Equation. This figure shows that the binomial coefficient with original set of size n and subset of size k is the binomial coefficient given by the following equation: the binomial coefficient with original set of size n and subset of size k is equal to n! / k! (n-k)!. See the figure: 00 1 and n 1 k Figure 9. Definition. This figure shows that zero to the power of zero is eqivalent to one and the binomial coefficient with original set of size n and subset of size k is also eqivalent to one. The glMap1 subroutine is used to define the basis and to specify what kind of values are produced. Once defined, a map can be enabled and disabled by calling the glEnable and glDisable subroutines with the map name, one of the nine predefined values for the Target parameter. The glEvalCoord1 subroutine evaluates the 1D maps that are enabled. When glEvalCoord1 presents a value u, the Bernstein functions are evaluated using t, as in the following figure: u – u1 t= u2 – u1 Figure 10. Value of t. This figure shows that t is equal to u-u1 / u2–u1. The Target parameter specifies a symbolic constant that indicates what kind of control points are provided in the Points parameter, and what output is generated when the map is evaluated. It can assume one of the following nine predefined values: GL_MAP1_VERTEX_3 GL_MAP1_VERTEX_4 GL_MAP1_INDEX GL_MAP1_COLOR_4 Each control point is three floating-point values representing x, y, and z. Internal glVertex3 subroutines are generated when the map is evaluated. Each control point is four floating-point values representing x, y, z, and w. Internal glVertex4 subroutines are generated when the map is evaluated. Each control point is a single floating-point value representing a color index. Internal glIndex subroutines are generated when the map is evaluated. However, the current index is not updated with the value of these glIndex subroutines. Each control point is four floating-point values representing red, green, blue, and alpha (RGBA). Internal glColor4 subroutines are generated when the map is evaluated. However, the current color is not updated with the value of these glColor4 subroutines. Chapter 1. OpenGL Subroutines 219 GL_MAP1_NORMAL GL_MAP1_TEXTURE_COORD_1 GL_MAP1_TEXTURE_COORD_2 GL_MAP1_TEXTURE_COORD_3 GL_MAP1_TEXTURE_COORD_4 Each control point is three floating-point values representing the x, y, and z components of a normal vector. Internal glNormal subroutines are generated when the map is evaluated. However, the current normal is not updated with the value of these glNormal subroutines. Each control point is a single floating-point value representing the s texture coordinate. Internal glTexCoord1 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. Each control point is two floating-point values representing the s and t texture coordinates. Internal glTexCoord2 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. Each control point is three floating-point values representing the s, t, and r texture coordinates. Internal glTexCoord3 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. Each control point is four floating-point values representing the s, t, r and q texture coordinates. Internal glTexCoord4 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. The Stride, Order, and Points parameters define the array addressing for accessing the control points. Points is the location of the first control point, which occupies one, two, three, or four contiguous memory locations, depending on which map is being defined. Order is the number of control points in the array. Stride tells how many float or double locations to advance the internal memory pointer to reach the next control point. Parameters Target Specifies the values that are generated by the evaluator. The following symbolic constants are accepted: v GL_MAP1_VERTEX_3 v GL_MAP1_VERTEX_4 v GL_MAP1_INDEX v GL_MAP1_COLOR_4 v GL_MAP1_NORMAL v GL_MAP1_TEXTURE_COORD_1 v GL_MAP1_TEXTURE_COORD_2 v GL_MAP1_TEXTURE_COORD_3 v GL_MAP1_TEXTURE_COORD_4 Specify a linear mapping of u, as presented to glEvalCoord1, to u1, the variable that is evaluated by the equations specified by this subroutine. Specifies the number of floats or doubles between the beginning of one control point and the beginning of the next one in the data structure referenced in Points. This allows control points to be embedded in arbitrary data structures. The only constraint is that the values for a particular control point must occupy contiguous memory locations. Specifies the number of control points. Must be positive. Specifies a pointer to the array of control points. u1, u2 Stride Order Points Notes As is the case with all GL subroutines that accept pointers to data, it is as if the contents of Points were copied by glMap1 before it returned. Changes to the contents of Points have no effect after glMap1 is called. 220 OpenGL 2.1 Reference Manual Errors GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_VALUE GL_INVALID_VALUE GL_INVALID_OPERATION Target is not an accepted value. u1 is equal to u2. Stride is less than the number of values in a control point. Order is less than one or greater than GL_MAX_EVAL_ORDER. The glMap1 subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glMap1 subroutine are as follows. (See the glGet subroutine for more information.) glGetMap. glGet with argument GL_MAX_EVAL_ORDER. glIsEnabled with argument GL_MAP1_VERTEX_3. glIsEnabled with argument GL_MAP1_VERTEX_4. glIsEnabled with argument GL_MAP1_INDEX. glIsEnabled with argument GL_MAP1_COLOR_4. glIsEnabled with argument GL_MAP1_NORMAL. glIsEnabled with argument GL_MAP1_TEXTURE_COORD_1. glIsEnabled with argument GL_MAP1_TEXTURE_COORD_2 glIsEnabled with argument GL_MAP1_TEXTURE_COORD_3 glIsEnabled with argument GL_MAP1_TEXTURE_COORD_4. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColor subroutine, glEnable or glDisable subroutine, glEvalCoord subroutine, glEvalMesh subroutine, glEvalPoint subroutine, glGetMap subroutine, glIndex subroutine, glMap2 subroutine, glMapGrid subroutine, glNormal subroutine, glTexCoord subroutine, glVertex subroutine. glMap2 Subroutine Purpose Defines a 2-dimensional (2D) evaluator. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 221 C Syntax void glMap2d(GLenum Target, GLdouble u1, GLdouble u2, GLint uStride, GLint uOrder, GLdouble v1, GLdouble v2, GLint vStride, GLint vOrder, const GLdouble * Points) void glMap2f(GLenum Target, GLfloat u1, GLfloat u2, GLint uStride, GLint uOrder, GLfloat v1, GLfloat v2, GLint vStride, GLint vOrder, const GLfloat * Points) Description Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The values produced by an evaluator are sent on to further stages of GL processing just as if they had been presented using the glVertex, glNormal, glTexCoord, and glColor subroutines, except that the generated values do not update the current normal, texture coordinates, or color. All polynomial or rational polynomial splines of any degree (up to the maximum degree supported by the GL implementation) can be described using evaluators. These include almost all surfaces used in computer graphics, such as B-spline surfaces, non-uniform rational B-spline surfaces (NURBS), and Bezier surfaces. Evaluators define surfaces based on bivariate Bernstein polynomials. Define p(s, t) as follows: Let p(s, t) = Bn0Bm0R00 + Bn1Bm0R01 + . . . + BnnBm0Rn0 +Bn0Bm1R01 + . . . + BnnBm1Rn1 . . . +Bn0BmmR0m + . . . + BnnBmmRnm where Rij is a control point, Bni (s) is the ith Bernstein polynomial of degree: n (uOrder = n +1) See the following figure: 222 OpenGL 2.1 Reference Manual n Bni (s) = s i (1 – s) n – i i Figure 11. Value of Bni (s). This figure shows that Bni (s) is equal to [the binomial coefficient with original set of size n and subset of size i] s to the power of i (1–s) to the power of n-i. and Bmj (t) is the jth Bernstein polynomial of degree: m (vOrder = m + 1) See the following figure: m Bmj (t) = t j (1 – t) m – j j Figure 12. Value of Bmj (t). This figure shows that Bmj (t) is equal to [the binomial coefficient with original set of size m and subset of size j] t to the power of j (1–t) to the power of m-j. See the following figure: 00 1 and n 1 0 Figure 13. Definition. This figure shows that zero to the power of zero is eqivalent to one and the binomial coefficient with original set of size n and subset of size zero is also eqivalent to one. The glMap2 subroutine is used to define the basis and to specify what kind of values are produced. Once defined, a map can be enabled and disabled by calling the glEnable and glDisable subroutines with the map name, which is one of the nine predefined values for the Target parameter. When the glEvalCoord2 subroutine presents values u and v, the bivariate Bernstein polynomials are evaluated using s and t, as in the following figure: u – u1 s= u2 – u1 v – v1 t= v2 – v1 Figure 14. Value of s and t. This figure shows two equations. The first equation shows that s is equal to u–u1 / u2–u1. The second equation shows that t is equal to v–v1 / v2–v1. The Target parameter specifies a symbolic constant that indicates what kind of control points are provided in the Points parameter, and what output is generated when the map is evaluated. It can assume one of Chapter 1. OpenGL Subroutines 223 the following nine predefined values: GL_MAP2_VERTEX_3 GL_MAP2_VERTEX_4 GL_MAP2_INDEX GL_MAP2_COLOR_4 GL_MAP2_NORMAL GL_MAP2_TEXTURE_COORD_1 GL_MAP2_TEXTURE_COORD_2 GL_MAP2_TEXTURE_COORD_3 GL_MAP2_TEXTURE_COORD_4 Each control point is three floating-point values representing x, y, and z. Internal glVertex3 subroutines are generated when the map is evaluated. Each control point is four floating-point values representing x, y, z, and w. Internal glVertex4 subroutines are generated when the map is evaluated. Each control point is a single floating-point value representing a color index. Internal glIndex subroutines are generated when the map is evaluated. However, the current index is not updated with the value of these glIndex subroutines. Each control point is four floating-point values representing red, green, blue, and alpha. Internal glColor4 subroutines are generated when the map is evaluated. However, the current color is not updated with the value of these glColor4 subroutines. Each control point is three floating-point values representing the x, y, and z components of a normal vector. Internal glNormal subroutines are generated when the map is evaluated. However, the current normal is not updated with the value of these glNormal subroutines. Each control point is a single floating-point value representing the s texture coordinate. Internal glTexCoord1 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. Each control point is two floating-point values representing the s and t texture coordinates. Internal glTexCoord2 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. Each control point is three floating-point values representing the s, t, and r texture coordinates. Internal glTexCoord3 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. Each control point is four floating-point values representing the s, t, r, and q texture coordinates. Internal glTexCoord4 subroutines are generated when the map is evaluated. However, the current texture coordinates are not updated with the value of these glTexCoord subroutines. The uStride, uOrder, vStride, vOrder, and Points parameters define the array addressing for accessing the control points. The Points parameter is the location of the first control point, which occupies one, two, three, or four contiguous memory locations, depending on which map is being defined. There are uOrder times vOrder control points in the array. The uStride parameter tells how many float or double locations are skipped to advance the internal memory pointer from control point Rij to control point R(i+1)j. The vStride parameter tells how many float or double locations are skipped to advance the internal memory pointer from control point Rij to control point Ri(j+1). 224 OpenGL 2.1 Reference Manual Parameters Target Specifies the kind of values that are generated by the evaluator. The following symbolic constants are accepted: v GL_MAP2_VERTEX_3 v GL_MAP2_VERTEX_4 v GL_MAP2_INDEX v GL_MAP2_COLOR_4 v GL_MAP2_NORMAL v GL_MAP2_TEXTURE_COORD_1 v GL_MAP2_TEXTURE_COORD_2 v GL_MAP2_TEXTURE_COORD_3 u1, u2 uStride uOrder v1, v2 vStride vOrder Points v GL_MAP2_TEXTURE_COORD_4 Specify a linear mapping of u, as presented to glEvalCoord2, to u1, one of the two variables that is evaluated by the equations specified by this subroutine. Specifies the number of floats or doubles between the beginning of control point Rij and the beginning of control point R(i+1)j, where i and j are the u and y control-point indexes, respectively. This allows control points to be embedded in arbitrary data structures. The only constraint is that the values for a particular control point must occupy contiguous memory locations. Specifies the dimension of the control point array in the u axis. Must be positive. Specify a linear mapping of v, as presented to glEvalCoord2, to v1, one of the two variables that is evaluated by the equations specified by this subroutine. Specifies the number of floats or doubles between the beginning of control point Rij and the beginning of control point Ri(j+1), where i and j are the u and v control point indexes, respectively. This allows control points to be embedded in arbitrary data structures. The only constraint is that the values for a particular control point must occupy contiguous memory locations. Specifies the dimension of the control point array in the v axis. Must be positive. Specifies a pointer to the array of control points. Notes For all GL subroutines that accept pointers to data, it is as if the contents of Points were copied by glMap2 before it returned. Changes to the contents of Points have no effect after glMap2 is called. Errors GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_VALUE GL_INVALID_VALUE GL_INVALID_OPERATION Target is not an accepted value. u1 is equal to u2, or if v1 is equal to v2. uStride or vStride is less than the number of values in a control point. uOrder or vOrder is less than one or greater than GL_MAX_EVAL_ORDER. The glMap2 subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glMap2 subroutine are as follows. (See the glGet subroutine for more information.) glGetMap glGet with argument GL_MAX_EVAL_ORDER glIsEnabled with argument GL_MAP2_VERTEX_3 glIsEnabled with argument GL_MAP2_VERTEX_4 Chapter 1. OpenGL Subroutines 225 glIsEnabled with argument GL_MAP2_INDEX glIsEnabled with argument GL_MAP2_COLOR_4 glIsEnabled with argument GL_MAP2_NORMAL glIsEnabled with argument GL_MAP2_TEXTURE_COORD_1 glIsEnabled with argument GL_MAP2_TEXTURE_COORD_2 glIsEnabled with argument GL_MAP2_TEXTURE_COORD_3 glIsEnabled with argument GL_MAP2_TEXTURE_COORD_4. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColor subroutine, glEnable or Disable subroutine, glEvalCoord subroutine, glEvalMesh subroutine, glEvalPoint subroutine, glGetMap subroutine, glIndex subroutine, glMap1 subroutine, glMapGrid subroutine, glNormal subroutine, glTexCoord subroutine, glVertex subroutine. glMapGrid Subroutine Purpose Defines a 1-dimensional (1D) or 2-dimensional (2D) mesh. Library OpenGL C bindings library: libGL.a C Syntax void glMapGrid1d(GLint GLdouble u1, GLdouble u2) un, void glMapGrid1f(GLint GLfloat u1, GLfloat u2) un, void glMapGrid2d(GLint GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) un, void glMapGrid2f(GLint GLfloat u1, GLfloat u2, un, 226 OpenGL 2.1 Reference Manual GLint vn, GLfloat v1, GLfloat v2) Description The glMapGrid and glEvalMesh subroutines are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. The glEvalMesh subroutine steps through the integer domain of a 1D or 2D grid, whose range is the domain of the evaluation maps specified by the glMap1 and glMap2 subroutines. The glMapGrid1 and glMapGrid2 subroutines specify the linear grid mappings between the i (or i and j) integer grid coordinates, to the u (or u and v) floating-point evaluation map coordinates. See the glMap1 subroutine and the glMap2 subroutine for details of how u and v coordinates are evaluated. The glMapGrid1 subroutine specifies a single linear mapping such that integer grid coordinate 0 (zero) maps exactly to u1, and integer grid coordinate un maps exactly to u2. All other integer grid coordinates i are mapped such that u = i(u2 - u1)/un + u1 The glMapGrid2 subroutine specifies two such linear mappings. One maps integer grid coordinate i=0 exactly to u1, and integer grid coordinate i=un exactly to u2. The other maps integer grid coordinate j=0 exactly to v1, and integer grid coordinate j=vn exactly to v2. Other integer grid coordinates i and j are mapped such that u = i(u2 - u1)/un + u1 v = j(v2 - v1)/vn + v1 The mappings specified by glMapGrid are identically used by glEvalMesh and glEvalPoint. Parameters un u1, u2 vn v1, v2 Specifies the number of partitions in the grid range interval [u1, u2]. Must be positive. Specify the mappings for integer grid domain values i=0 and i=un. Specifies the number of partitions in the grid range interval [v1, v2] (glMapGrid2 only). Specify the mappings for integer grid domain values j=0 and j=vn (glMapGrid2 only). Errors GL_INVALID_VALUE GL_INVALID_OPERATION un or vn is not positive. The glMapGrid subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glMapGrid subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MAP1_GRID_DOMAIN glGet with argument GL_MAP2_GRID_DOMAIN glGet with argument GL_MAP1_GRID_SEGMENTS glGet with argument GL_MAP2_GRID_SEGMENTS. Chapter 1. OpenGL Subroutines 227 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEvalCoord subroutine, glEvalMesh subroutine, glEvalPoint subroutine, glMap1 subroutine, glMap2 subroutine. glMaterial Subroutine Purpose Specifies material parameters for the lighting model. Library OpenGL C bindings library: libGL.a C Syntax void glMaterialf(GLenum Face, GLenum pName, GLfloat Parameter) void glMateriali(GLenum GLenum pName, GLint Parameter) Face, void glMaterialfv(GLenum Face, GLenum pName, const GLfloat * Parameters) void glMaterialiv(GLenum Face, GLenum pName, const GLint * Parameters) Description The glMaterial subroutine assigns values to material parameters. There are two matched sets of material parameters. One, the frontfacing set, is used to shade points, lines, bitmaps, and all polygons (when two-sided lighting is disabled), or just frontfacing polygons (when two-sided lighting is enabled). The other set, backfacing, is used to shade backfacing polygons only when two-sided lighting is enabled. See the glLightModel subroutine for details concerning one- and two-sided lighting calculations. The glMaterial subroutine takes three arguments: v The Face parameter specifies whether the GL_FRONT materials, the GL_BACK materials, or both GL_FRONT_AND_BACK materials are modified. v The pName parameter specifies which of several parameters in one or both sets are modified. v The Parameters parameter specifies what value or values are assigned to the specified parameter. Material parameters are used in the lighting equation that is optionally applied to each vertex. See the glLightModel subroutine for details about the lighting equation. The following parameters and their interpretations by the lighting equation can be specified using glMaterial: 228 OpenGL 2.1 Reference Manual GL_AMBIENT GL_DIFFUSE GL_SPECULAR GL_EMISSION GL_SHININESS GL_AMBIENT_AND_DIFFUSE GL_COLOR_INDEXES Parameters contains four integer or floating-point values that specify the ambient red, green, blue, alpha (RGBA) reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default ambient reflectance for both front and backfacing materials is (0.2, 0.2, 0.2, 1.0). Parameters contains four integer or floating-point values that specify the diffuse RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default diffuse reflectance for both front and backfacing materials is (0.8, 0.8, 0.8, 1.0). Parameters contains four integer or floating-point values that specify the specular RGBA reflectance of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default specular reflectance for both front and backfacing materials is (0.0, 0.0, 0.0, 1.0). Parameters contains four integer or floating-point values that specify the RGBA emitted light intensity of the material. Integer values are mapped linearly such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly. Neither integer nor floating-point values are clamped. The default emission intensity for both front and backfacing materials is (0.0, 0.0, 0.0, 1.0). Parameters is a single integer or floating-point value that specifies the RGBA specular exponent of the material. Integer and floating-point values are mapped directly. Only values in the range [0,128] are accepted. The default specular exponent for both frontfacing and backfacing materials is 0. Equivalent to calling glMaterial twice with the same parameter values, once with GL_AMBIENT and once with GL_DIFFUSE. Parameters contains three integer or floating-point values specifying the color indices for ambient, diffuse, and specular lighting. These three values, and GL_SHININESS, are the only material values used by the color index mode lighting equation. See the glLightModel subroutine for a discussion of color index lighting. Parameters materialf and materiali Face pName Parameter Specifies which face or faces are being updated. The Face parameter must be one of GL_FRONT, GL_BACK or GL_FRONT_AND_BACK. Specifies the single-valued material parameter of the face or faces that is being updated. Must be GL_SHININESS. Specifies the value to which GL_SHININESS is set. materialfv and materialiv Face Specifies which face or faces are being updated. Must be one of GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. Chapter 1. OpenGL Subroutines 229 pName Specifies the material parameter of the face or faces that is being updated. Must be one of the following: v GL_AMBIENT v GL_DIFFUSE v GL_SPECULAR v GL_EMISSION v GL_SHININESS v GL_AMBIENT_AND_DIFFUSE Parameters v GL_COLOR_INDEXES Specifies a pointer to the value or values to which the pName parameter is set. Notes The material parameters can be updated at any time. In particular, glMaterial can be called between a call to the glBegin subroutine and the corresponding call to the glEnd subroutine. If only a single material parameter is to be changed per vertex, however, glColorMaterial is preferred over glMaterial. (See the glColorMaterial subroutine for information on tracking the current color with the material color.) Errors GL_INVALID_ENUM GL_INVALID_VALUE Face or pName is not an accepted value. A specular exponent outside the range [0,128] is specified. Associated Gets Associated get for the glMaterial subroutine is as follows. (See the glGet subroutine for more information.) glGetMaterial. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColorMaterial subroutine, glGetMaterial subroutine, glLight subroutine, glLightModel subroutine. glMatrixMode Subroutine Purpose Specifies the current matrix. Library OpenGL C bindings library: libGL.a C Syntax void glMatrixMode(GLenum 230 Mode) OpenGL 2.1 Reference Manual Description The glMatrixMode subroutine sets the current matrix mode. The Mode parameter can assume one of the following three values: GL_MODELVIEW GL_PROJECTION GL_TEXTURE Applies subsequent matrix operations to the model view matrix stack. Applies subsequent matrix operations to the projection matrix stack. Applies subsequent matrix operations to the texture matrix stack. Parameters Mode Specifies which matrix stack is the target for subsequent matrix operations. The following three values are accepted: v GL_MODELVIEW v GL_PROJECTION v GL_TEXTURE Associated Gets Associated gets for the glMatrixMode subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Mode is not an accepted value. The glMatrixMode subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glLoadMatrix subroutine, glPushMatrix subroutine. glMultiDrawArraysEXT Subroutine Purpose Renders multiple primitives from array data. Library OpenGL C bindings library: libGL.a C Syntax void glMultiDrawArraysEXT(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) Chapter 1. OpenGL Subroutines 231 Description The glMultiDrawArraysEXT subroutine lets you specify multiple geometric primitives with very few subroutine calls. Instead of calling a GL procedure to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertexes, normals, and colors and use them to construct a sequence of primitives with a single call to glMultiDrawArraysEXT. When glMultiDrawArraysEXT is called, it uses count sequential elements from each enabled array to construct a sequence of geometric primitives, beginning with element first. The mode parameter specifies what kind of primitives are constructed, and how the array elements construct these primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated. Vertex attributes that are modified by glMultiDrawArraysEXT have an unspecified value after glMultiDrawArraysEXT returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glMultiDrawArraysEXT executes. Attributes that are not modified remain well defined. Behaves identically to DrawArrays except that a list of arrays is specified instead. The number of lists is specified in the primcount parameter. It has the same effect as: for(i=0; i<primcount; i++) { if (*(count+i)>0) DrawArrays(mode, *(first+i), *(count+i)); } Parameters mode first count primcount Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Points to an array of the starting indeces in the enabled arrays. Points to an array of the number of indices to be rendered. Specifies the size of first and count. Notes The glMultiDrawArraysEXT subroutine is included in display lists. If glMultiDrawArraysEXT is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_VALUE is generated if count is negative. GL_INVALID_OPERATION is generated if glMultiDrawArraysEXT is executed between the execution of glBegin and the corresponding glEnd. Related Information The glArrayElement subroutine, glColorPointer subroutine, glMultiDrawElementsEXT subroutine, glEdgeFlagPointer subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glNormalPointer subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. 232 OpenGL 2.1 Reference Manual glMultiDrawElementsEXT Subroutine Purpose Renders multiple primitives from array data. Library OpenGL C bindings library: libGL.a C Syntax void glMultiDrawElementsEXT(GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount) Description The glMultiDrawElementsEXT subroutine lets you specify multiple geometric primitives with very few subroutine calls. Instead of calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can prespecify separate arrays of vertexes, normals, and so on and use them to construct a sequence of primitives with a single call to glMultiDrawElementsEXT. When glMultiDrawElementsEXT is called, it uses count sequential elements from indices to construct a sequence of geometric primitives. GLenum mode specifies what kind of primitives are constructed and how the array elements construct these primitives. If GL_VERTEX_ARRAY is not enabled, no geometric primitives are generated. Vertex attributes that are modified by glMultiDrawElementsEXT have an unspecified value after glMultiDrawElementsEXT returns. For example, if GL_COLOR_ARRAY is enabled, the value of the current color is undefined after glMultiDrawElementsEXT executes. Attributes that are not modified remain well defined. Parameters mode count type indices primcount Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Points to an array of the element counts. Specifies the type of the values in indices. Must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. Specifies a pointer to the location where the indices are stored. Specifies the size of the count array. Notes The glMultiDrawElementsEXT subroutine is included in display lists. If glMultiDrawElementsEXT is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. glMultiDrawElementsEXT is part of the _extname(EXT_multi_draw_arrays) extension, not part of the core GL command set. If _extstring(EXT_multi_draw_arrays) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_multi_draw_arrays) is supported. Chapter 1. OpenGL Subroutines 233 Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_VALUE is generated if count is negative. GL_INVALID_OPERATION is generated if glMultiDrawElementsEXT is executed between the execution of glBegin and the corresponding glEnd. Associated Gets glGetTexImage, glIsEnabled with argument GL_TEXTURE_1D. Related Information The glArrayElement subroutine, glColorPointer subroutine, glMultiDrawArraysEXT subroutine, glEdgeFlagPointer subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glNormalPointer subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glMultiModeDrawArraysIBM Subroutine Purpose Renders primitives of multiple primitive types from array data. Library OpenGL C bindings library: libGL.a C Syntax void glMultiModeDrawArraysIBM( GLenum * mode, GLint * first, GLsizei * count, GLsizei primcount, GLint modestride) Description The glMultiModeDrawArraysIBM subroutine behaves identically to glDrawArrays except that a list of arrays and a list of primitive modes is specified instead. The number of lists is specified in the primcount parameter. It has the same effect as: for(i=0; i < primcount; i++) { if (*(count+i) > 0) glDrawArrays(*((GLenum *)((char *)mode+i*modestride)), *(first+i), *(count+i)); } Parameters mode first count primcount modestride 234 Points to an array of primitive modes. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Points to an array of the starting indices in the enabled arrays. Points to an array of the number of indices to be rendered for each primitive. Specifies the word size of the mode, first and count arrays. Specifies how to stride through the mode array. Typical values are 0 (single primitive mode for all primitives) and sizeof(GLenum) (separate primitive mode for each primitive). OpenGL 2.1 Reference Manual Notes The glMultiModeDrawArraysIBM subroutine is available only if the IBM_multi_mode_draw_arrays extension is supported. The glMultiModeDrawArraysIBM subroutine is included in display lists. If glMultiModeDrawArraysIBM is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Error Codes v GL_INVALID_ENUM is generated if any of the primitive modes in the mode array is not an accepted value. v GL_INVALID_OPERATION is generated if glMultiModeDrawArraysIBM is executed between the execution of glBegin and the corresponding glEnd. Related Information The glArrayElement subroutine, glColorPointer subroutine, glColorPointerListIBM subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEdgeFlagPointerListIBM subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glIndexPointerListIBM subroutine, glInterleavedArrays subroutine, glMultiModeDrawElementsIBM subroutine, glNormalPointer subroutine, glNormalPointerListIBM subroutine, glTexCoordPointer subroutine, glTexCoordPointerListIBM subroutine, glVertexPointer subroutine, glVertexPointerListIBM subroutine. glMultiModeDrawElementsIBM Subroutine Purpose Renders primitives of multiple primitive types from array data. Library OpenGL C bindings library: libGL.a C Syntax void glMultiModeDrawElementsIBM(GLenum GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount, GLint modestride) *mode, Description glMultiModeDrawElementsIBM behaves identically to glDrawElements except that a list of arrays and a list of primitive modes is specified instead. The number of lists is specified in the primcount parameter. It has the same effect as: for(i=0; i < primcount; i++) { if (*(count+i) > 0) glDrawElements(*((GLenum *)((char *)mode+i*modestride)), *(count+i), type, *(indices+i)); } Chapter 1. OpenGL Subroutines 235 Parameters mode count type indices primcount modestride Points to an array of primitive modes, Specifying what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted. Points to an array of the element counts. Each count specifies the number of elements to be rendered for that primitive. Specifies the type of the values in indices. Must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. Specifies a pointer to the list of index arrays. Specifies the number of elements to be read from the mode array and from the count array (and how many arrays there are in the indices list). Each such (mode,count,indices[]) triple tells us how many vertices of the indicated mode are to be rendered, and the location of their array of indices. Specifies how to stride through the mode array. Typical values are 0 (single primitive mode for all primitives)and sizeof(GLenum) (separate primitive mode for each primitive) Notes The glMultiModeDrawElementsIBM subroutine is available only if the IBM_multimode_draw_arrays extension is supported. The glMultiModeDrawElementsIBM subroutine is included in display lists. If glMultiModeDrawElementsIBM is entered into a display list, the necessary array data (determined by the array pointers and enables) is also entered into the display list. Because the array pointers and enables are client side state, their values affect display lists when the lists are created, not when the lists are executed. Errors GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_OPERATION is generated if glMultiModeDrawElementsIBM is executed between the execution of glBegin and the corresponding glEnd. Related Information The glArrayElement subroutine, glColorPointer subroutine, glColorPointerListIBM subroutine, glDrawArrays subroutine, glEdgeFlagPointer subroutine, glEdgeFlagPointerListIBM subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glIndexPointerListIBM subroutine, glMultiModeDrawArraysIBM subroutine, glNormalPointer subroutine, glNormalPointerListIBM subroutine, glTexCoordPointer subroutine, glTexCoordPointerListIBM subroutine, glVertexPointer subroutine, glVertexPointerListIBM subroutine. glMultiTexCoordARB Subroutine Purpose Sets the current texture coordinates. Library OpenGL C bindings library: (libGL.a) 236 OpenGL 2.1 Reference Manual C Syntax void glMultiTexCoord1dARB( GLenum target, GLdouble s ) void glMultiTexCoord1fARB( GLenum target, GLfloat s ) void glMultiTexCoord1iARB( GLenum target, GLint s ) void glMultiTexCoord1sARB( GLenum target, GLshort s ) void glMultiTexCoord2dARB( GLenum target, GLdouble s, GLdouble t ) void glMultiTexCoord2fARB( GLenum target, GLfloat s, GLfloat t ) void glMultiTexCoord2iARB( GLenum target, GLint s, GLint t ) void glMultiTexCoord2sARB( GLenum target, GLshort s, GLshort t ) void glMultiTexCoord3dARB( GLenum target, GLdouble s, GLdouble t, GLdouble r ) void glMultiTexCoord3fARB( GLenum target, GLfloat s, GLfloat t, GLfloat r ) void glMultiTexCoord3iARB( GLenum target, GLint s, GLint t, GLint r ) void glMultiTexCoord3sARB( GLenum target, GLshort s, GLshort t, GLshort r ) void glMultiTexCoord4dARB( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ) void glMultiTexCoord4fARB( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) void glMultiTexCoord4iARB( GLenum target, GLint s, GLint t, GLint r, GLint q ) void glMultiTexCoord4sARB( GLenum target, GLshort s, GLshort t, Chapter 1. OpenGL Subroutines 237 void void void void void void void void void void void void void void void void GLshort r, GLshort q ) glMultiTexCoord1dvARB( GLenum target, GLdouble *v ) glMultiTexCoord1fvARB( GLenum target, GLfloat *v ) glMultiTexCoord1ivARB( GLenum target, GLint *v ) glMultiTexCoord1svARB( GLenum target, GLshort *v ) glMultiTexCoord2dvARB( GLenum target, GLdouble *v ) glMultiTexCoord2fvARB( GLenum target, GLfloat *v ) glMultiTexCoord2ivARB( GLenum target, GLint *v ) glMultiTexCoord2svARB( GLenum target, GLshort *v ) glMultiTexCoord3dvARB( GLenum target, GLdouble *v ) glMultiTexCoord3fvARB( GLenum target, GLfloat *v ) glMultiTexCoord3ivARB( GLenum target, GLint *v ) glMultiTexCoord3svARB( GLenum target, GLshort *v ) glMultiTexCoord4dvARB( GLenum target, GLdouble *v ) glMultiTexCoord4fvARB( GLenum target, GLfloat *v ) glMultiTexCoord4ivARB( GLenum target, GLint *v ) glMultiTexCoord4svARB( GLenum target, GLshort *v ) Description glMultiTexCoordARB specifies texture coordinates in one, two, three or four dimensions. If t is not specified it is taken to be 0. If r is not specified it is taken to be 0. If q is not specified, it is taken to be 1. The current texture coordinates are part of the data that is associated with each vertex and with the current raster position. Initially, the values for s, t, r and q are (0, 0, 0, 1). Parameters target s, t, r, q v 238 OpenGL 2.1 Reference Manual specifies texture unit whose coordinates should be modified. The number of texture units is implementation dependent, but must be at least two. Must be one of GL_TEXTUREi_ARB, where 0 <= i < the implementation-dependent value of GL_MAX_TEXTURE_UNITS_ARB. specifies the s, t, r, and q texture coordinates for target texture unit. Not all parameters are present in all forms of the command. specifies a pointer to an array of one, two, three or four elements, which in turn specify the s, t, r, and q texture coordinates. Notes glMultiTexCoordARB is only supported if GL_ARB_multitexture is included in the string returned by glGetString when called with the argument GL_EXTENSIONS. The current texture coordinates can be updated at any time. In particular, glMultiTexCoordARB can be called between a call to glBegin and the corresponding call to glEnd. It is always the case that GL_TEXTUREi_ARB = GL_TEXTURE0_ARB + i. Associated Gets Associated gets for the glMultiTexCoordARB subroutine are as follows. (See the glGet subroutine for more information.) glGet GL_CURRENT_TEXTURE_COORDS with appropriate texture unit selected. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glActiveTextureARB subroutine, the glClientActiveTextureARB subroutine, the glTexCoord subroutine, the glTexCoordPointer subroutine. glMultMatrix Subroutine Purpose Multiplies the current matrix by an arbitrary matrix. Library OpenGL C bindings library: libGL.a C Syntax void glMultMatrixd(const GLdouble void glMultMatrixf(const GLfloat *Matrix) *Matrix) Description The glMultMatrix subroutine multiplies the current matrix with the one specified in the Matrix parameter. For example, if M is the current matrix and T is the matrix passed to glMultMatrix, M is replaced with MT. The current matrix is the projection matrix, model view matrix, or texture matrix, determined by the current matrix mode. (See the glMatrixMode subroutine for information on specifying the current matrix.) The Matrix parameter points to a 4 x 4 matrix of single- or double-precision floating-point values stored in column-major order. That is, the matrix is stored as in the following figure: Chapter 1. OpenGL Subroutines 239 a0 a4 a8 a12 a1 a5 a9 a13 a2 a6 a10 a14 a3 a7 a11 a15 Figure 15. Stored Matrix. This diagram shows a matrix enclosed in brackets. The matrix consists of four lines containing four characters each. The first line contains the following (from left to right): a subscript zero, a subscript four, a subscript eight, a subscript twelve. The second line contains the following (from left to right): a subscript one, a subscript five, a subscript nine, a subscript thirteen. The third line contains the following (from left to right): a subscript two, a subscript six, a subscript ten, a subscript fourteen. The fourth line contains the following (from left to right): a subscript three, a subscript seven, a subscript eleven, a subscript fifteen. Parameters Matrix Specifies a pointer to 4 x 4 matrix stored in column-major order as 16 consecutive values. Errors GL_INVALID_OPERATION The glMultMatrix subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glMultMatrix subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE. glGet with argument GL_MODELVIEW_MATRIX. glGet with argument GL_PROJECTION_MATRIX. glGet with argument GL_TEXTURE_MATRIX. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glLoadIdentity subroutine, glLoadMatrix subroutine, glMatrixMode subroutine, glPushMatrix subroutine, glMultTransposeMatrixARB subroutine. glMultTransposeMatrixARB Subroutine Purpose Multiplies the current matrix by a matrix specified in row-major order, rather than column-major order. 240 OpenGL 2.1 Reference Manual Library OpenGL C bindings library: (libGL.a) C Syntax void glMultTransposeMatrixfARB(const GLfloat *Matrix) void glMultTransposeMatrixdARB(const GLdouble *Matrix) Description The glMultTransposeMatrixARB subroutine replaces the current matrix with the product of the current matrix and the one specified in the Matrix parameter. The current matrix is the projection matrix, model view matrix, or texture matrix, determined by the current matrix mode. (See the glMatrixMode subroutine for information on specifiying the current matrix.) The Matrix parameter points to a 4 x 4 matrix of singleor double-precision floating-point values stored in row-major order. That is, the matrix is stored as the following: / | | \ a0 a4 a8 a12 a1 a5 a9 a13 a2 a6 a10 a14 a3 a7 a11 a15 \ | | / The effect on an input vertex is as if it is first multiplied by the matrix specified in this call, and then subsequently multiplied by the previous ″current″ matrix. Parameters Matrix is an array of 16 values, specified in row-major order. Error Codes GL_INVALID_OPERATION is generated if glMultTransposeMatrixARB is executed between the execution of glBegin and the corresponding execution of glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glMultMatrix subroutine, the glMatrixMode subroutine. glNewList or glEndList Subroutine Purpose Creates or replaces a display list. Library OpenGL C bindings library: libGL.a Chapter 1. OpenGL Subroutines 241 C Syntax void glNewList(GLuint GLenum Mode) List, Description Display lists are groups of GL commands that have been stored for subsequent execution. The display lists are created with the glNewList subroutine. All subsequent commands are placed in the display list, in the order issued, until the glEndList subroutine is called. The glNewList subroutine has two arguments. The first argument, List, is a positive integer that becomes the unique name for the display list. Names can be created and reserved with the glGenLists subroutine and tested for uniqueness with the glIsList subroutine. The second argument, Mode, is a symbolic constant that can assume one of two values: GL_COMPILE GL_COMPILE_AND_EXECUTE Commands are compiled only. Commands are performed as they are compiled into the display list. The following subroutines are not compiled into the display list, but are performed immediately, regardless of the display-list mode: v v v v v glIsList glGenLists glDeleteLists glFeedbackBuffer glSelectBuffer v glRenderMode v glReadPixels v v v v v glPixelStore glFlush glFinish glIsEnabled All glGet subroutines When glEndList is encountered, the display-list definition is completed by associating the list with the unique name List (specified in glNewList). If a display list with the name List already exists, it is replaced only when glEndList is called. Parameters List Mode Specifies the display list name. Specifies the compilation mode, which can be GL_COMPILE or GL_COMPILE_AND_EXECUTE. Notes The glCallList and glCallLists subroutines can be entered into display lists. The commands in the display list or lists run by glCallList or glCallLists are not included in the display list being created, even if the list creation mode is GL_COMPILE_AND_EXECUTE. Error Codes GL_INVALID_VALUE GL_INVALID_ENUM 242 OpenGL 2.1 Reference Manual List is 0 (zero). Mode is not an accepted value. GL_INVALID_OPERATION The glEndList subroutine is called without a preceding glNewList. OR GL_INVALID_OPERATION The glNewList subroutine is called while a display list is being defined. The glNewList subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glNewList and glEndList subroutines are as follows. (See the glGet subroutine for more information.) glIsList. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallList subroutine, glCallLists subroutine, glDeleteLists subroutine, glGenLists subroutine. glNormal Subroutine Purpose Set the current normal vector; for use in lighting calculations. Library OpenGL C bindings library: libGL.a C Syntax void glNormal3b( GLbyte nx, GLbyte ny, GLbyte nz) void glNormal3d( GLdouble nx, GLdouble ny, GLdouble nz) void glNormal3f( GLfloat nx, GLfloat ny, GLfloat nz) void glNormal3i( GLint nx, GLint ny, GLint nz) void glNormal3s( GLshort nx, GLshort ny, GLshort nz) Chapter 1. OpenGL Subroutines 243 void glNormal3bv( const GLbyte *v) void glNormal3dv( const GLdouble *v) void glNormal3fv( const GLfloat *v) void glNormal3iv( const GLint *v) void glNormal3sv( const GLshort *v) Description The current normal is set to the given coordinates whenever glNormal is issued. Byte, short, or integer arguments are converted to floating-point format with a linear mapping that maps the most positive representable integer value to 1.0, and the most negative representable integer value to - 1.0. Normals specified with glNormal need not have unit length. If normalization is enabled, then normals specified with glNormal are normalized after transformation. To enable and disable normalization, call glEnable and glDisable with the argument GL_NORMALIZE. Normalization is initially disabled. Parameters nx, ny, nz v Specify the x, y, and z coordinates of the new current normal. The initial value of the current normal is the unit vector, (0, 0, 1). Specifies a pointer to an array of three elements: the x, y, and z coordinates of the new current normal. Notes The current normal can be updated at any time. In particular, glNormal can be called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_CURRENT_NORMAL glIsEnabled with argument GL_NORMALIZE Related Information The glBegin subroutine, glColor subroutine, glIndex subroutine, glNormalPointer subroutine, glTexCoord subroutine, and the glVertex subroutine. glNormalPointer Subroutine Purpose Defines an array of normals. Library OpenGL C bindings library: libGL.a 244 OpenGL 2.1 Reference Manual C Syntax void glNormalPointer( GLenum GLsizei stride, const GLvoid * pointer) type, Description The glNormalPointer subroutine specifies the location and data format of an array of normals to use when rendering. The type parameter specifies the data type of the normal coordinates and stride gives the byte stride from one normal to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single array storage may be more efficient on some implementations; see glInterleavedArrays). When a normal array is specified, type, stride, and pointer are saved as client side state. To enable and disable the normal array, call glEnableClientState and glDisableClientState with the argument GL_NORMAL_ARRAY. If enabled, the normal array is used when glDrawArrays, glDrawElements or glArrayElement is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Normal array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type stride pointer Specifies the the data type of each coordinate in the array. Symbolic constants GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. Specifies the byte offset between consecutive normals. The initial value is 0. Specifies a pointer to the first coordinate of the first normal in the array. The initial value is 0 (NULL pointer). Notes The glNormalPointer subroutine is available only if the GL version is 1.1 or greater. The normal array is initially disabled and it won’t be accessed when glArrayElement, glDrawElements or glDrawArrays is called. Execution of glNormalPointer is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glNormalPointer subroutine is typically implemented on the client side with no protocol. Since the normal array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. The glNormalPointer subroutine is not included in display lists. Chapter 1. OpenGL Subroutines 245 Errors v GL_INVALID_ENUM is generated if type is not an accepted value. v GL_INVALID_VALUE is generated if stride is negative. Associated Gets v v v v glIsEnabled with argument GL_NORMAL_ARRAY glGet with argument GL_NORMAL_ARRAY_TYPE glGet with argument GL_NORMAL_ARRAY_STRIDE glGetPointerv with argument GL_NORMAL_ARRAY_POINTER Related Information The glArrayElement subroutine, glColorPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glNormalPointerListIBM subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glNormalPointerEXT Subroutine Purpose Defines an array of normals. Library OpenGL C bindings library: libGL.a C Syntax void glNormalPointerEXT(GLenum GLsizei stride, GLsizei count, const GLvoid *pointer) type, Description glNormalPointerEXT specifies the location and data format of an array of normals to use when rendering. type specifies the data type of the normal coordinates and stride gives the byte stride from one normal to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a normal array is specified, type, stride, count and pointer are saved as client-side state, and static array elements may be cached by the implementation. The normal array is enabled and disabled using glEnable and glDisable with the argument GL_NORMAL_ARRAY_EXT. If enabled, the normal array is used when glDrawArraysEXT or glArrayElementEXT is called. Use glDrawArraysEXT to define a sequence of primitives (all of the same type) from pre-specified vertex and vertex attribute arrays. Use glArrayElementEXT to specify primitives by indexing vertexes and vertex attributes. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives 246 OpenGL 2.1 Reference Manual by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Normal array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type stride count pointer Specifies the the data type of each coordinate in the array. Symbolic constants GL_BYTE, GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE_EXT are accepted. Specifies the byte offset between consecutive normals. Specifies the number of normals, counting from the first, that are static. Specifies a pointer to the first coordinate of the first normal in the array. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the normal array is disabled and it won’t be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although, it is not an error to call glNormalPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glNormalPointerEXT will typically be implemented on the client side with no protocol. Since the normal array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glNormalPointerEXT commands are not entered into display lists. glNormalPointerEXT is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. Errors GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative. Associated Gets glIsEnabled with argument GL_NORMAL_ARRAY_EXT . glGet with argument GL_NORMAL_ARRAY_TYPE_EXT. glGet with argument GL_NORMAL_ARRAY_STRIDE_EXT. glGet with argument GL_NORMAL_ARRAY_COUNT_EXT. glGetPointervEXT with argument GL_NORMAL_ARRAY_POINTER_EXT. Chapter 1. OpenGL Subroutines 247 File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElementEXT subroutine, glColorPointerEXT subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glGetPointervEXT subroutine, glIndexPointerEXT subroutine, glTexCoordPointerEXT subroutine, glVertexPointerEXT subroutine. glNormalPointerListIBM Subroutine Purpose Defines a list of normal arrays. Library OpenGL C bindings library: libGL.a C Syntax void glNormalPointerListIBM(GLenum GLint stride, const GLvoid ** pointer, GLint ptrstride) type, Description The glNormalPointerListIBM subroutine specifies the location and data format of a list of arrays of normal components to use when rendering. The type parameter specifies the data type of each normal component. The stride parameter gives the byte stride from one normal to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). The ptrstride parameter specifies the byte stride from one pointer to the next in the pointer array. When a normal array is specified, type, stride, pointer and ptrstride are saved as client side state. A stride value of 0 does not specify a ″tightly packed″ array as it does in glNormalPointer. Instead, it causes the first array element of each array to be used for each vertex. Also, a negative value can be used for stride, which allows the user to move through each array in reverse order. To enable and disable the normal arrays, call glEnableClientState and glDisableClientState with the argument GL_NORMAL_ARRAY. The normal array is initially disabled. When enabled, the normal arrays are used when glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glDrawArrays, glDrawElements or glArrayElement is called. The last three calls in this list will only use the first array (the one pointed at by pointer[0]). See the descriptions of these routines for more information on their use. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. 248 OpenGL 2.1 Reference Manual If enabled, the Normal array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters type stride pointer ptrstride Specifies the data type of each normal component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. Specifies the byte offset between consecutive normal. The initial value is 0. Specifies a list of normal arrays. The initial value is 0 (NULL pointer). Specifies the byte stride between successive pointers in the pointer array. The initial value is 0. Notes The glNormalPointerListIBM subroutine is available only if the GL_IBM_vertex_array_lists extension is supported. Execution of glNormalPointerListIBM is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glNormalPointerListIBM subroutine is typically implemented on the client side. Since the normal array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When a glNormalPointerListIBM call is encountered while compiling a display list, the information it contains does NOT contribute to the display list, but is used to update the immediate context instead. The glNormalPointer call and the glNormalPointerListIBM call share the same state variables. A glNormalPointer call will reset the normal list state to indicate that there is only one normal list, so that any and all lists specified by a previous glNormalPointerListIBM call will be lost, not just the first list that it specified. Error Codes GL_INVALID_ENUM is generated if type is not an accepted value. Associated Gets glIsEnabled with argument GL_NORMAL_ARRAY glGetPointerv with argument GL_NORMAL_ARRAY_LIST_IBM glGet with argument GL_NORMAL_ARRAY_LIST_STRIDE_IBM glGet with argument GL_NORMAL_ARRAY_STRIDE glGet with argument GL_NORMAL_ARRAY_TYPE Related Information The glArrayElement subroutine, glDrawArrays subroutine, glDrawElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glMultiDrawArraysEXT subroutine, glMultiDrawElementsEXT subroutine, glMultiModeDrawArraysIBM subroutine, Chapter 1. OpenGL Subroutines 249 glMultiModeDrawElementsIBM subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glNormalVertexSUN Subroutine Purpose Specifies a normal and a vertex in one call. Library OpenGL C bindings library: (libGL.a) C Syntax void glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) void glNormal3fVertex3fvSUN (const GLfloat const GLfloat *n, *v) Description This subroutine can be used as a replacement for the following calls: glNormal(); glVertex(); For example, glNormal3fVertex3fvSUN replaces the following calls: glNormal3f(); glVertex3fv(); The only reason for using this call is that it reduces the use of bus bandwidth. Parameters x, y, z v nx, ny, nz n Specifies the x, y, and z coordinates of a vertex. Not all parameters are present in all forms of the command. Specifies a pointer to an array of the three elements x, y, and z. Specify x, y, and z coordinates of the normal vector for this vertex. Specifies a pointer to an array of the three elements nx, ny and nz. Notes Calling glNormalVertexSUN outside of a glBegin/glEnd subroutine pair results in undefined behavior. This subroutine is only valid if the GL_SUN_vertex extension is defined. 250 OpenGL 2.1 Reference Manual Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, the glColor subroutine, the glNormal subroutine, the glTexCoord subroutine, the glVertex subroutine. glOrtho Subroutine Purpose Multiplies the current matrix by an orthographic matrix. Library OpenGL C bindings library: libGL.a C Syntax void glOrtho(GLdouble Left, GLdouble Right, GLdouble Bottom, GLdouble Top, GLdouble Near, GLdouble Far) Description The glOrtho subroutine describes a perspective matrix that produces a parallel projection. (Left, Bottom, -Near) and (Right, Top, -Near) specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the window, respectively, assuming that the eye is located at (0, 0, 0). -Far specifies the location of the far clipping plane. Both Near and Far can be either positive or negative. The corresponding matrix is as follows: 2 0 0 tx 0 ty Right–Left 2 0 Top–Bottom –2 0 0 Far–Near 0 0 0 tz 1 Figure 16. Parallel Projection Perspective Matrix. This diagram shows a matrix enclosed in brackets. The matrix consists of four lines containing four characters each. The first line contains the following (from left to right): 2 / Right-Left, zero, zero, t subscript x. The second line contains the following (from left to right): zero, 2 / Top-Bottom, zero, t subscript y. The third line contains the following (from left to right): zero, zero, -2 / Far-Near, t subscript z. The fourth line contains the following (from left to right): zero, zero, zero, one. where the following statements apply: Chapter 1. OpenGL Subroutines 251 Right+Left tx = – Right–Left Top+Bottom ty = – Top–Bottom Far+Near tz = – Far–Near Figure 17. Statements. This figure shows three equations. The first equation shows that t subscript x (from the above matrix) is equal to negative Right+Left / Right–Left. The second equation shows that t subscript y (from the above matrix) is equal to negative Top+Bottom / Top–Bottom. The third equation shows that t subscript z (from the above matrix) is equal to negative Far+Near / Far–Near. The current matrix is multiplied by this matrix with the result replacing the current matrix. That is, if M is the current matrix and O is the ortho matrix, M is replaced with MO. Use the glPushMatrix and glPopMatrix subroutines to save and restore the current matrix stack. Parameters Left, Right Bottom, Top Near, Far Specify the coordinates for the left and right vertical clipping planes. Specify the coordinates for the bottom and top horizontal clipping planes. Specify the distances to the nearer and farther depth clipping planes. These distances are negative if the plane is to be behind the viewer. Errors GL_INVALID_OPERATION The glOrtho subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glOrtho subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFrustum subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glPushMatrix subroutine, glViewport subroutine. 252 OpenGL 2.1 Reference Manual glPassThrough Subroutine Purpose Places a marker in the feedback buffer. Library OpenGL C bindings library: libGL.a C Syntax void glPassThrough(GLfloat Token) Description Feedback is a GL render mode. The mode is selected by calling the glRenderMode subroutine with GL_FEEDBACK. When the GL is in feedback mode, no pixels are produced by rasterization. Instead, information about primitives that would have been rasterized is fed back to the application using the GL. See the glFeedbackBuffer subroutine for a description of the feedback buffer and the values in the feedback buffer. The glPassThrough subroutine inserts a user-defined marker in the feedback buffer when it is executed in feedback mode. The Token parameter is returned as if it were a primitive; it is indicated with its own unique identifying value: GL_PASS_THROUGH_TOKEN. The order of glPassThrough commands with respect to the specification of graphics primitives is maintained. Parameters Token Specifies a marker value to be placed in the feedback buffer following a GL_PASS_THROUGH_TOKEN value. Notes The glPassThrough subroutine is ignored if the GL is not in feedback mode. Errors GL_INVALID_OPERATION The glPassThrough subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glPassThrough subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_RENDER_MODE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFeedbackBuffer subroutine, glRenderMode subroutine. Chapter 1. OpenGL Subroutines 253 glPixelMap Subroutine Purpose Sets up pixel transfer maps. Library OpenGL C bindings library: libGL.a C Syntax void glPixelMapfv(GLenum Map, GLint MapSize, const GLfloat * Values) void glPixelMapuiv(GLenum Map, GLint MapSize, const GLuint * Values) void glPixelMapusv(GLenum Map, GLint MapSize, const GLushort * Values) Description The glPixelMap subroutine sets up translation tables, or maps, used by the glDrawPixels, glReadPixels, glCopyPixels, glTexImage1D, and glTexImage2D subroutines. See the glPixelTransfer subroutine for a complete description on using these maps. Use of these maps is also described in part in the pixel and texture image subroutines. Only the specification of the maps is described here. The Map parameter is a symbolic map name, indicating one of 10 maps to set. The MapSize parameter specifies the number of entries in the map, and the Values parameter is a pointer to an array of MapSize map values. The 10 maps are: GL_PIXEL_MAP_I_TO_I GL_PIXEL_MAP_S_TO_S GL_PIXEL_MAP_I_TO_R GL_PIXEL_MAP_I_TO_G GL_PIXEL_MAP_I_TO_B GL_PIXEL_MAP_I_TO_A GL_PIXEL_MAP_R_TO_R GL_PIXEL_MAP_G_TO_G GL_PIXEL_MAP_B_TO_B GL_PIXEL_MAP_A_TO_A Maps Maps Maps Maps Maps Maps Maps Maps Maps Maps color indexes to color indexes. stencil indexes to stencil indexes. color indexes to red components. color indexes to green components. color indexes to blue components. color indexes to alpha components. red components to red components. green components to green components. blue components to blue components. alpha components to alpha components. The entries in a map can be specified as single precision floating-point numbers, unsigned short integers, or unsigned long integers. Maps that store color component values (all but the GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S maps) retain their values in floating-point format, with unspecified mantissa and exponent sizes. Floating-point values specified by glPixelMapfv are converted directly to the internal floating-point format of these maps, then clamped to the range [0,1]. Unsigned integer values specified by glPixelMapusv and glPixelMapuiv are converted linearly such that the largest representable integer maps to 1.0, and 0 (zero) maps to 0.0. 254 OpenGL 2.1 Reference Manual Maps that store indices, GL_PIXEL_MAP_I_TO_I and GL_PIXEL_MAP_S_TO_S, retain their values in fixed-point format, with an unspecified number of bits to the right of the binary point. Floating-point values specified by glPixelMapfv are converted directly to the internal fixed-point format of these maps. Unsigned integer values specified by glPixelMapusv and glPixelMapuiv specify integer values, with all 0s to the right of the binary point. The following table shows the initial sizes and values for each of the maps. Maps that are indexed by either color or stencil indexes must have MapSize = 2n for some n or results are undefined. The maximum allowable size for each map depends on the implementation and can be determined by calling the glGet subroutine with argument GL_MAX_PIXEL_MAP_TABLE. The single maximum applies to all maps, and it is at least 32. Map Lookup Index Lookup Value Initial Size Initial Value GL_PIXEL_MAP_I_TO_I color index color index 1 0.0 GL_PIXEL_MAP_S_TO_S stencil index stencil index 1 0 GL_PIXEL_MAP_I_TO_R color index R 1 0.0 GL_PIXEL_MAP_I_TO_G color index G 1 0.0 GL_PIXEL_MAP_I_TO_B color index B 1 0.0 GL_PIXEL_MAP_I_TO_A color index A 1 0.0 GL_PIXEL_MAP_R_TO_R R R 1 0.0 GL_PIXEL_MAP_G_TO_G G G 1 0.0 GL_PIXEL_MAP_B_TO_B B B 1 0.0 GL_PIXEL_MAP_A_TO_A A A 1 0.0 Parameters Map Specifies a symbolic map name. Map must be one of the following: v GL_PIXEL_MAP_I_TO_I v GL_PIXEL_MAP_S_TO_S v GL_PIXEL_MAP_I_TO_R v GL_PIXEL_MAP_I_TO_G v GL_PIXEL_MAP_I_TO_B v GL_PIXEL_MAP_I_TO_A v GL_PIXEL_MAP_R_TO_R v GL_PIXEL_MAP_G_TO_G v GL_PIXEL_MAP_B_TO_B MapSize Values v GL_PIXEL_MAP_A_TO_A Specifies the size of the map being defined. Specifies an array of MapSize values. Errors GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_VALUE Map is not an accepted value. MapSize is negative or larger than GL_MAX_PIXEL_MAP_TABLE. Map is GL_PIXEL_MAP_I_TO_I, GL_PIXEL_MAP_S_TO_S, GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, or GL_PIXEL_MAP_I_TO_A, and MapSize is not a power of two. Chapter 1. OpenGL Subroutines 255 GL_INVALID_OPERATION The glPixelMap subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glPixelMap subroutine are as follows. (See the glGet subroutine for more information.) glGetPixelMap glGet with argument GL_PIXEL_MAP_I_TO_I_SIZE glGet with argument GL_PIXEL_MAP_S_TO_S_SIZE glGet with argument GL_PIXEL_MAP_I_TO_R_SIZE glGet with argument GL_PIXEL_MAP_I_TO_G_SIZE glGet with argument GL_PIXEL_MAP_I_TO_B_SIZE glGet with argument GL_PIXEL_MAP_I_TO_A_SIZE glGet with argument GL_PIXEL_MAP_R_TO_R_SIZE glGet with argument GL_PIXEL_MAP_G_TO_G_SIZE glGet with argument GL_PIXEL_MAP_B_TO_B_SIZE glGet with argument GL_PIXEL_MAP_A_TO_A_SIZE glGet with argument GL_MAX_PIXEL_MAP_TABLE. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCopyPixels subroutine, glDrawPixels subroutine, glGetPixelMap subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glReadPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine. glPixelStore Subroutine Purpose Sets pixel storage modes. Library OpenGL C bindings library: libGL.a 256 OpenGL 2.1 Reference Manual C Syntax void glPixelStoref(GLenum GLfloat Parameter) pName, void glPixelStorei(GLenum GLint Parameter) pName, Description The glPixelStore subroutine sets pixel storage modes that affect the operation of subsequent glDrawPixels and glReadPixels subroutines as well as the unpacking of polygon stipple patterns (see the glPolygonStipple subroutine ), bitmaps (see the glBitmap subroutine ), and texture patterns (see the glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexSubImage1D subroutine, glTexSubImage2D subroutine, and the glTexSubImage3DEXT subroutine). The pName parameter is a symbolic constant indicating the parameter to be set, and the Parameter parameter is the new value. The following parameters affect how pixel data is returned to client memory, and are therefore significant only for glReadPixels commands. They are as follows: GL_PACK_SWAP_BYTES GL_PACK_LSB_FIRST GL_PACK_ROW_LENGTH If True, byte ordering for multibyte color components, depth components, color indexes, or stencil indexes is reversed. That is, if a 4-byte component is made up of bytes b0, b1, b2, b3, it is stored in memory as b3, b2, b1, b0 if GL_PACK_SWAP_BYTES is True. GL_PACK_SWAP_BYTES has no effect on the memory order of components within a pixel, only on the order of bytes within components or indexes. For example, the three components of a GL_RGB format pixel are always stored with red first, green second, and blue third, regardless of the value of GL_PACK_SWAP_BYTES. If True, bits are ordered within a byte from least significant to most significant; otherwise, the first bit in each byte is the most significant one. This parameter is significant for bitmap data only. If greater than 0 (zero), GL_PACK_ROW_LENGTH defines the number of pixels in a row. If the first pixel of a row is placed at location p in memory, the location of the first pixel of the next row is obtained by skipping the result of the equation in Figure 18. Where n is the number of components or indexes in a pixel, l is the number of pixels in a row (GL_PACK_ROW_LENGTH if it is greater than 0; otherwise, the width argument to the pixel routine), a is the value of GL_PACK_ALIGNMENT, and s is the size, in bytes, of a single component (if a < s, it is as if a = s). In the case of 1-bit values, the location of the next row is obtained by skipping the result of the equation in Figure 19 on page 258. The word component in this description refers the nonindex values red, green, blue, alpha, and depth. Storage format GL_RGB, for example, has three components per pixel; first red, then green, and finally blue. nl k= s>a a snl s a s<a components or indexes Figure 18. GL_PACK_ROW_LENGTH Equation. This figure shows an equation where k is equal to the following two lines preceded by a single curly brace: nl s greater than or equal to a. Below the first line is the second line as follows: a / s [snl / a] s less than a components or indexes. Chapter 1. OpenGL Subroutines 257 nl k = 8a 8a components or indexes Figure 19. GL_PACK_ROW_LENGTH 1–bit Values Equation. This figure shows an equation where k is equal to 8a[nl / 8a] components or indexes. GL_PACK_IMAGE_HEIGHT GL_PACK_SKIP_PIXELS, GL_PACK_SKIP_ROWS, and GL_PACK_SKIP_IMAGES GL_PACK_ALIGNMENT If greater than 0 (zero), GL_PACK_IMAGE_HEIGHT defines the number of rows in a 3D image, otherwise the number of rows is defined to be the height of the 3D image. These values are provided as a convenience to the programmer; they provide no functionality that cannot be duplicated simply by incrementing the pointer passed to the glReadPixels subroutine. Setting GL_PACK_SKIP_PIXELS to i is equivalent to incrementing the pointer by in components or indexes, where n is the number of components or indexes in each pixel. Setting GL_PACK_SKIP_ROWS to j is equivalent to incrementing the pointer by jk components or indexes, where k is the number of components or indexes per row, as computed in the GL_PACK_ROW_LENGTH section. Setting the GL_PACK_SKIP_IMAGES to l is equivalent to incrementing the pointer by lmk components or indexes, where m is the number of rows per image as specified by GL_PACK_IMAGE_HEIGHT. Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (one) (byte alignment), 2 (rows aligned to even-numbered bytes), 4 (word alignment), and 8 (rows start on double-word boundaries). The remaining parameters affect how pixel data is read from client memory. These values are significant for the glDrawPixels, glTexImage1D, glTexImage2D, glBitmap, and glPolygonStipple subroutines. They are as follows: GL_UNPACK_SWAP_BYTES GL_UNPACK_LSB_FIRST 258 OpenGL 2.1 Reference Manual If True, byte ordering for a multibyte color components, depth components, color indexes, or stencil indexes is reversed. That is, if a 4-byte component is made up of bytes b0, b1, b2, b3, it is taken from memory as b3, b2, b1, b0 if GL_UNPACK_SWAP_BYTES is True. GL_UNPACK_SWAP_BYTES has no effect on the memory order of components within a pixel, only on the order of bytes within components or indexes. For example, the three components of a GL_RGB format pixel are always stored with red first, green second, and blue third, regardless of the value of GL_UNPACK_SWAP_BYTES. If True, bits are ordered within a byte from least significant to most significant; otherwise, the first bit in each byte is the most significant one. This is significant for bitmap data only. GL_UNPACK_ROW_LENGTH If greater than 0, GL_UNPACK_ROW_LENGTH defines the number of pixels in a row. If the first pixel of a row is placed at location p in memory, then the location of the first pixel of the next row is obtained by skipping the result of the equation in Figure 20. Where n is the number of components or indexes in a pixel, i is the number of pixels in a row (GL_UNPACK_ROW_LENGTH if it is greater than 0; otherwise, the width argument to the pixel routine), a is the value of GL_UNPACK_ALIGNMENT, and s is the size, in bytes, of a single component (if a < s, it is as if a = s). In the case of 1-bit values, the location of the next row is obtained by skipping the result of the equation in Figure 21. The word component in this description refers the nonindex values red, green, blue, alpha, and depth. Storage format GL_RGB, for example, has three components per pixel, first red, then green, and finally blue. nl k= s>a a snl s a s<a components or indexes Figure 20. GL_UNPACK_ROW_LENGTH Equation. This figure shows an equation where k is equal to the following two lines preceded by a single curly brace: nl s greater than or equal to a. Below the first line is the second line as follows: a / s [snl / a] s less than a components or indexes. nl k = 8a 8a components or indexes Figure 21. GL_UNPACK_ROW_LENGTH 1–bit Values Equation. This figure shows an equation where k is equal to 8a[nl / 8a] components or indexes. GL_UNPACK_IMAGE_HEIGHT GL_UNPACK_SKIP_PIXELS, GL_UNPACK_SKIP_ROWS, and GL_UNPACK_SKIP_IMAGES If greater than 0 (zero), GL_UNPACK_IMAGE_HEIGHT defines the number of rows in a 3D image, otherwise the number of rows is defined to be the height of the 3D image. These values are provided as a convenience to the programmer; they provide no functionality that cannot be duplicated simply by incrementing the pointer passed to glDrawPixels, glTexImage1D, glTexImage2D, glTexImage3DEXT, glBitmap, or glPolygonStipple. Setting GL_UNPACK_SKIP_PIXELS to i is equivalent to incrementing the pointer by in components or indexes, where n is the number of components or indexes in each pixel. Setting GL_UNPACK_SKIP_ROWS to j is equivalent to incrementing the pointer by jk components or indexes, where k is the number of components or indexes per row, as computed in the GL_UNPACK_ROW_LENGTH section. Setting the GL_UNPACK_SKIP_IMAGES to l is equivalent to incrementing the pointer by lmk components or indexes, where m is the number of rows per image as specified by GL_UNPACK_IMAGE_HEIGHT. Chapter 1. OpenGL Subroutines 259 GL_UNPACK_ALIGNMENT Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte alignment), 2 (rows aligned to even-numbered bytes), 4 (word alignment), and 8 (rows start on double-word boundaries). The following table gives the type, initial value, and range of valid values for each of the storage parameters that can be set with glPixelStore. pName Type Initial Value Valid Range GL_PACK_SWAP_BYTES Boolean False True or False GL_PACK_LSB_FIRST Boolean False True or False GL_PACK_ROW_LENGTH integer 0 [0,+infinity) GL_PACK_SKIP_ROWS integer 0 [0,+infinity) GL_PACK_SKIP_PIXELS integer 0 [0,+infinity) GL_PACK_ALIGNMENT integer 4 1, 2, 4, or 8 GL_PACK_IMAGE_HEIGTH integer 0 [0,+infinity) GL_PACK_SKIP_IMAGES integer 0 [0,+infinity) GL_UNPACK_SWAP_BYTES Boolean False True or False GL_UNPACK_LSB_FIRST Boolean False True or False GL_UNPACK_ROW_LENGTH integer 0 [0,+infinity) GL_UNPACK_SKIP_ROWS integer 0 [0,+infinity) GL_UNPACK_SKIP_PIXELS integer 0 [0,+infinity) GL_UNPACK_ALIGNMENT integer 4 1, 2, 4, or 8 GL_UNPACK_IMAGE_HEIGTH integer 0 [0,+infinity) GL_UNPACK_SKIP_IMAGES integer 0 [0,+infinity) The glPixelStoref subroutine can be used to set any pixel store parameter. If the parameter type is Boolean, and if Parameter is 0.0, the parameter is False; otherwise it is set to True. If pName is an integer type parameter, Parameter is rounded to the nearest integer. Likewise, glPixelStorei can also be used to set any of the pixel store parameters. Boolean parameters are set to False if Parameter is 0 and True otherwise. Parameter is converted to floating-point format before being assigned to real-valued parameters. 260 OpenGL 2.1 Reference Manual Parameters pName Specifies the symbolic name of the parameter to be set. The following values affect the packing of pixel data into memory: v GL_PACK_SWAP_BYTES v GL_PACK_LSB_FIRST v GL_PACK_ROW_LENGTH v GL_PACK_SKIP_PIXELS v GL_PACK_SKIP_ROWS v GL_PACK_ALIGNMENT v GL_PACK_IMAGE_HEIGHT v GL_PACK_SKIP_IMAGES The following values affect the unpacking of pixel data from memory: v GL_UNPACK_SWAP_BYTES v GL_UNPACK_LSB_FIRST v GL_UNPACK_ROW_LENGTH v GL_UNPACK_SKIP_PIXELS v GL_UNPACK_SKIP_ROWS v GL_UNPACK_ALIGNMENT v GL_UNPACK_IMAGE_HEIGHT v GL_UNPACK_SKIP_IMAGES Notes The pixel storage modes in effect when glDrawPixels, glReadPixels, glTexImage, glBitmap, or glPolygonStipple is placed in a display list control the interpretation of memory data. The pixel storage modes in effect when a display list is executed are not significant. Errors GL_INVALID_ENUM GL_INVALID_VALUE pName is not an accepted value. A negative row length, pixel skip, or row skip value is specified, or alignment is specified as other than 1, 2, 4, or 8. Associated Gets Associated gets for the glPixelStore subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_PACK_SWAP_BYTES glGet with argument GL_PACK_LSB_FIRST glGet with argument GL_PACK_ROW_LENGTH glGet with argument GL_PACK_SKIP_ROWS glGet with argument GL_PACK_SKIP_PIXELS glGet with argument GL_PACK_ALIGNMENT glGet with argument GL_PACK_IMAGE_HEIGTH Chapter 1. OpenGL Subroutines 261 glGet with argument GL_PACK_SKIP_IMAGES glGet with argument GL_UNPACK_SWAP_BYTES glGet with argument GL_UNPACK_LSB_FIRST glGet with argument GL_UNPACK_ROW_LENGTH glGet with argument GL_UNPACK_SKIP_ROWS glGet with argument GL_UNPACK_SKIP_PIXELS glGet with argument GL_UNPACK_ALIGNMENT. glGet with argument GL_UNPACK_IMAGE_HEIGTH glGet with argument GL_UNPACK_SKIP_IMAGES GL_INVALID_OPERATION The glPixelStore subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glBitmap subroutine, glDrawPixels subroutine, glPixelMap subroutine, glPixelTransfer subroutine, glPixelZoom subroutine, glPolygonStipple subroutine, glReadPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexSubImage1D subroutine, glTexSubImage2D subroutine, glTexSubImage3DEXT subroutine. glPixelTransfer Subroutine Purpose Sets pixel transfer modes. Library OpenGL C bindings library: libGL.a C Syntax void glPixelTransferf(GLenum GLfloat Parameter) pName, void glPixelTransferi(GLenum GLint Parameter) pName, Description The glPixelTransfer subroutine sets pixel transfer modes that affect the operation of subsequent glDrawPixels, glReadPixels, glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glCopyTexSubImage3DEXT, glTexImage1D, 262 OpenGL 2.1 Reference Manual glTexImage2D, glTexImage3DEXT, glTexSubImage1D, glTexSubImage2D, and glTexSubImage3DEXT subroutines. The algorithms that are specified by pixel transfer modes operate on pixels after they are read from the frame buffer (glReadPixels and glCopyPixels) or unpacked from client memory (glDrawPixels, glReadPixels, glCopyPixels, glCopyTexImage1D, glCopyTexImage2D, glCopyTexSubImage1D, glCopyTexSubImage2D, glCopyTexSubImage3DEXT, glTexImage1D, glTexImage2D, glTexImage3DEXT, glTexSubImage1D, glTexSubImage2D, and glTexSubImage3DEXT subroutines). Pixel transfer operations happen in the same order, and in the same manner, regardless of the command that resulted in the pixel operation. Pixel storage modes control the unpacking of pixels being read from client memory and the packing of pixels being written back into client memory. (See the glPixelStore subroutine for information on setting pixel storage modes.) Pixel transfer operations handle four fundamental pixel types: color, color index, depth, and stencil. Color pixels are made up of four floating-point values with unspecified mantissa and exponent sizes, scaled such that 0.0 represents 0 (zero) intensity and 1.0 represents full intensity. Color indexes comprise a single fixed-point value, with unspecified precision to the right of the binary point. Depth pixels comprise a single floating-point value, with unspecified mantissa and exponent sizes, scaled such that 0.0 represents the minimum depth buffer value and 1.0 represents the maximum depth buffer value. Finally, stencil pixels comprise a single fixed-point value, with unspecified precision to the right of the binary point. The pixel transfer operations performed on the four basic pixel types are as follows: color Each of the four color components is multiplied by a scale factor, then added to a bias factor. That is, the red component is multiplied by GL_RED_SCALE, then added to GL_RED_BIAS; the green component is multiplied by GL_GREEN_SCALE, then added to GL_GREEN_BIAS; the blue component is multiplied by GL_BLUE_SCALE, then added to GL_BLUE_BIAS; and the alpha component is multiplied by GL_ALPHA_SCALE, then added to GL_ALPHA_BIAS. After all four color components are scaled and biased, each is clamped to the range [0,1]. All color scale and bias values are specified with glPixelTransfer. If GL_MAP_COLOR is True, each color component is scaled by the size of the corresponding color-to-color map, then replaced by the contents of that map indexed by the scaled component. That is, the red component is scaled by GL_PIXEL_MAP_R_TO_R_SIZE, then replaced by the contents of GL_PIXEL_MAP_R_TO_R indexed by itself. The green component is scaled by GL_PIXEL_MAP_G_TO_G_SIZE, then replaced by the contents of GL_PIXEL_MAP_G_TO_G indexed by itself. The blue component is scaled by GL_PIXEL_MAP_B_TO_B_SIZE, then replaced by the contents of GL_PIXEL_MAP_B_TO_B indexed by itself. The alpha component is scaled by GL_PIXEL_MAP_A_TO_A_SIZE, then replaced by the contents of GL_PIXEL_MAP_A_TO_A indexed by itself. All components taken from the maps are then clamped to the range [0,1]. GL_MAP_COLOR is specified with glPixelTransfer. The contents of the various maps are specified with the glPixelMap subroutine. Chapter 1. OpenGL Subroutines 263 color index Each color index is shifted left by GL_INDEX_SHIFT bits, and any bits beyond the number of fraction bits carried by the fixed-point index are filled with 0s. If GL_INDEX_SHIFT is negative, the shift is to the right, again 0 filled. Then GL_INDEX_OFFSET is added to the index. GL_INDEX_SHIFT and GL_INDEX_OFFSET are specified with glPixelTransfer. From this point, operation diverges depending on the required format of the resulting pixels. If the resulting pixels are to be written to a color index buffer, or if they are being read back to client memory in GL_COLOR_INDEX format, the pixels continue to be treated as indexes. If GL_MAP_COLOR is True, each index is masked by 2n-1, where n is GL_PIXEL_MAP_I_TO_I_SIZE, then replaced by the contents of GL_PIXEL_MAP_I_TO_I indexed by the masked value. GL_MAP_COLOR is specified with glPixelTransfer. The contents of the index map are specified with the glPixelMap subroutine. If the resulting pixels are to be written to a red, green, blue, alpha (RGBA) color buffer, or if they are being read back to client memory in a format other than GL_COLOR_INDEX, the pixels are converted from indexes to colors by referencing the four maps GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A. Before being dereferenced, the index is masked by 2n-1, where n is GL_PIXEL_MAP_I_TO_R_SIZE for the red map, GL_PIXEL_MAP_I_TO_G_SIZE for the green map, GL_PIXEL_MAP_I_TO_B_SIZE for the blue map, and GL_PIXEL_MAP_I_TO_A_SIZE for the alpha map. All components taken from the maps are then clamped to the range [0,1]. The contents of the four maps are specified with the glPixelMap subroutine. Each depth value is multiplied by GL_DEPTH_SCALE, added to GL_DEPTH_BIAS, then clamped to the range [0,1]. Each index is shifted GL_INDEX_SHIFT bits just as a color index is, then added to GL_INDEX_OFFSET. If GL_MAP_STENCIL is True, each index is masked by 2n-1, where n is GL_PIXEL_MAP_S_TO_S_SIZE, then replaced by the contents of GL_PIXEL_MAP_S_TO_S indexed by the masked value. depth stencil The following table gives the type, initial value, and range of valid values for each of the pixel transfer parameters that are set with glPixelTransfer. pName Type Initial Value Valid Range GL_MAP_COLOR Boolean False True or False GL_MAP_STENCIL Boolean False True or False GL_INDEX_SHIFT integer 0 (-infinity,+infinity) GL_INDEX_OFFSET integer 0 (-infinity,+infinity) GL_RED_SCALE float 1.0 (-infinity,+infinity) GL_GREEN_SCALE float 1.0 (-infinity,+infinity) GL_BLUE_SCALE float 1.0 (-infinity,+infinity) GL_ALPHA_SCALE float 1.0 (-infinity,+infinity) GL_DEPTH_SCALE float 1.0 (-infinity,+infinity) GL_RED_BIAS float 0.0 (-infinity,+infinity) GL_GREEN_BIAS float 0.0 (-infinity,+infinity) GL_BLUE_BIAS float 0.0 (-infinity,+infinity) GL_ALPHA_BIAS float 0.0 (-infinity,+infinity) GL_DEPTH_BIAS float 0.0 (-infinity,+infinity) The glPixelTransferf subroutine can be used to set any pixel transfer parameter. If the parameter type is Boolean, 0.0 implies False and any other value implies True. If pName is an integer parameter, Parameter is rounded to the nearest integer. 264 OpenGL 2.1 Reference Manual Likewise, glPixelTransferi can be used to set any of the pixel transfer parameters. Boolean parameters are set to False if Parameter is 0 and True otherwise. Parameter is converted to floating-point format before being assigned to real-valued parameters. Parameters pName Specifies the symbolic name of the pixel transfer parameter to be set. Must be one of the following: v GL_MAP_COLOR v GL_MAP_STENCIL v GL_INDEX_SHIFT v GL_INDEX_OFFSET v GL_RED_SCALE v GL_RED_BIAS v GL_GREEN_SCALE v GL_GREEN_BIAS v GL_BLUE_SCALE v GL_BLUE_BIAS v GL_ALPHA_SCALE v GL_ALPHA_BIAS v GL_DEPTH_SCALE Parameter v GL_DEPTH_BIAS Specifies the value to which pName is set. Notes If a glDrawPixels, glReadPixels, glCopyPixels, glTexImage1D, or glTexImage2D subroutine is placed in a display list (see the glNewList subroutine and the glCallList subroutine for information about display lists), the pixel transfer mode settings in effect when the display list is executed are the ones that are used. They may be different from the settings when the command was compiled into the display list. Errors GL_INVALID_ENUM GL_INVALID_OPERATION pName is not an accepted value. The glPixelTransfer subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glPixelTransfer subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MAP_COLOR glGet with argument GL_MAP_STENCIL glGet with argument GL_INDEX_SHIFT glGet with argument GL_INDEX_OFFSET glGet with argument GL_RED_SCALE glGet with argument GL_RED_BIAS Chapter 1. OpenGL Subroutines 265 glGet with argument GL_GREEN_SCALE glGet with argument GL_GREEN_BIAS glGet with argument GL_BLUE_SCALE glGet with argument GL_BLUE_BIAS glGet with argument GL_ALPHA_SCALE glGet with argument GL_ALPHA_BIAS glGet with argument GL_DEPTH_SCALE glGet with argument GL_DEPTH_BIAS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCallList subroutine, glCopyPixels subroutine, glCopyTexImage1D subroutine, glCopyTexImage2D subroutine, glCopyTexSubImage1D subroutine, glCopyTexSubImage2D subroutine, glCopyTexSubImage3DEXT subroutine, glDrawPixels subroutine, glNewList subroutine, glPixelMap subroutine, glPixelStore subroutine, glPixelZoom subroutine, glReadPixels subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexSubImage1D subroutine, glTexSubImage2D subroutine, glTexSubImage3DEXT subroutine, . glPixelZoom Subroutine Purpose Specifies the pixel zoom factors. Library OpenGL C bindings library: libGL.a C Syntax void glPixelZoom(GLfloat xFactor, GLfloat yFactor) Parameters xFactor and yFactor Specify the x and y zoom factors for pixel write operations. Description The glPixelZoom subroutine specifies values for the x and y zoom factors. During the execution of the glDrawPixels or glCopyPixels subroutines, if (xr, yr) is the current raster position, and a given element is in the nth row and mth column of the pixel rectangle, then pixels whose centers are in the rectangle with corners at (xr + n x xFactor, yr + m x yFactor) 266 OpenGL 2.1 Reference Manual and (xr + (n+1) x xFactor, yr + (m+1) x yFactor) are candidates for replacement. Any pixel whose center lies on the bottom or left edge of this rectangular region is also modified. Pixel zoom factors are not limited to positive values. Negative zoom factors reflect the resulting image about the current raster position. Errors GL_INVALID_OPERATION The glPixelZoom subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glPixelZoom subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_ZOOM_X. glGet with argument GL_ZOOM_Y. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCopyPixels subroutine, glDrawPixels subroutine. glPointSize Subroutine Purpose Specifies the diameter of rasterized points. Library OpenGL C bindings library: libGL.a C Syntax void glPointSize(GLfloat Size) Description The glPointSize subroutine specifies the rasterized diameter of both aliased and antialiased points. Using a point size other than 1.0 has different effects, depending on whether point antialiasing is enabled. Point antialiasing is controlled by calling the glEnable and glDisable subroutines with argument GL_POINT_SMOOTH. If point antialiasing is disabled, the actual size is determined by rounding the supplied size to the nearest integer. (If the rounding results in the value 0 (zero), it is as if the point size were 1 (one).) If the rounded size is odd, the center point (x, y) of the pixel fragment that represents the point is computed as Chapter 1. OpenGL Subroutines 267 (floor(xw) + 0.5, floor(yw) + 0.5) where w subscripts indicate window coordinates. All pixels that lie within the square grid of the rounded size centered at (x, y) make up the fragment. If the size is even, the center point is (floor(xw + 0.5), floor(yw + 0.5)) and the rasterized fragment’s centers are the half-integer window coordinates within the square of the rounded size centered at (x, y). All pixel fragments produced in rasterizing a nonantialiased point are assigned the same associated data, that of the vertex corresponding to the point. If antialiasing is enabled, point rasterization produces a fragment for each pixel square that intersects the region lying within the circle having diameter equal to the current point size and centered at the point’s (xw, yw). The coverage value for each fragment is the window coordinate area of the intersection of the circular region with the corresponding pixel square. This value is saved and used in the final rasterization step. The data associated with each fragment is the data associated with the point being rasterized. Not all sizes are supported when point antialiasing is enabled. If an unsupported size is requested, the nearest supported size is used. Only size 1.0 is guaranteed to be supported; others are dependent on the implementation. The range of supported sizes and the size difference between supported sizes within the range can be queried by calling the glGet subroutine with the GL_POINT_SIZE_RANGE and GL_POINT_SIZE_GRANULARITY arguments. Notes The point size specified by glPointSize is always returned when GL_POINT_SIZE is queried. Clamping and rounding for aliased and antialiased points have no effect on the specified value. Nonantialiased point size may be clamped to a maximum that depends on the implementation. Although this maximum cannot be queried, it must be no less than the maximum value for antialiased points, rounded to the nearest integer value. Parameters Size Specifies the diameter of rasterized points. The default is 1.0. Errors GL_INVALID_VALUE GL_INVALID_OPERATION Size is less than or equal to 0. The glPointSize subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glPointSize subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_POINT_SIZE glGet with argument GL_POINT_SIZE_RANGE glGet with argument GL_POINT_SIZE_GRANULARITY glIsEnabled with argument GL_POINT_SMOOTH. 268 OpenGL 2.1 Reference Manual Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable or Disable subroutine. glPolygonMode Subroutine Purpose Selects a polygon rasterization mode. Library OpenGL C bindings library: libGL.a C Syntax void glPolygonMode(GLenum GLenum Mode) Face, Description The glPolygonMode subroutine controls the interpretation of polygons for rasterization. The Face parameter describes which polygons the Mode parameters applies to: frontfacing polygons (GL_FRONT), backfacing polygons (GL_BACK), or both (GL_FRONT_AND_BACK). The polygon mode affects only the final rasterization of polygons. In particular, a polygon’s vertices are lit and the polygon is clipped and possibly culled before these modes are applied. Three modes are defined and can be specified in the Mode parameter: GL_POINT GL_LINE GL_FILL Polygon vertices that are marked as the start of a boundary edge are drawn as points. Point attributes such as GL_POINT_SIZE and GL_POINT_SMOOTH control the rasterization of the points. Polygon rasterization attributes other than GL_POLYGON_MODE have no effect. Boundary edges of the polygon are drawn as line segments. They are treated as connected line segments for line stippling; the line stipple counter and pattern are not reset between segments. (See the glLineStipple subroutine for information on specifying the line stipple pattern.) Line attributes such as GL_LINE_WIDTH and GL_LINE_SMOOTH control the rasterization of the lines. Polygon rasterization attributes other than GL_POLYGON_MODE have no effect. The interior of the polygon is filled. Polygon attributes such as GL_POLYGON_STIPPLE and GL_POLYGON_SMOOTH control the rasterization of the polygon. Parameters Face Mode Specifies the polygons to which Mode applies. Must be GL_FRONT for frontfacing polygons, GL_BACK for backfacing polygons, or GL_FRONT_AND_BACK for frontfacing and backfacing polygons. Specifies the way polygons are rasterized. Accepted values are GL_POINT, GL_LINE, and GL_FILL. The default is GL_FILL for both frontfacing and backfacing polygons. Notes Vertices are marked as boundary or nonboundary with an edge flag. Edge flags are generated internally by the GL when it decomposes polygons, and they can be set explicitly with the glEdgeFlag subroutine. Chapter 1. OpenGL Subroutines 269 Errors GL_INVALID_ENUM GL_INVALID_OPERATION Face or Mode is not an accepted value. The glPolygonMode subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glPolygonMode subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_POLYGON_MODE. Examples To draw a surface with filled backfacing polygons and outlined frontfacing polygons, enter the following: glPolygonMode(GL_FRONT, GL_LINE); Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEdgeFlag subroutine, glLineStipple subroutine, glLineWidth subroutine, glPointSize subroutine, glPolygonStipple subroutine. glPolygonOffset Subroutine Purpose Sets the scale and bias used to calculate depth values. Library OpenGL C bindings library: libGL.a C Syntax void glPolygonOffset(GLfloat GLfloat units) factor, Description When GL_POLYGON_OFFSET is enabled, each fragment’s depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The value of the offset is factor * DZ + r * units, where DZ is a measurement of the change in depth relative to the screen area of the polygon, and r is the smallest value which is guaranteed to produce a resolveable offset for a given implementation. The offset is added before the depth test is performed and before the value is written into the depth buffer. This is useful for rendering hidden line images, for applying decals to surfaces, and for rendering solids with highlighted edges. 270 OpenGL 2.1 Reference Manual Parameters factor units Specifies a scale factor which is used to create a variable depth offset for each polygon. The initial value is 0. Is multiplied by an implementation specific value to create a constant depth offset. The initial value is 0. Notes The glPolygonOffset subroutine is available only if the GL version is 1.1 or greater. Errors GL_INVALID_OPERATION is generated if glPolygonOffset is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsEnabled with argument GL_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_LINE, or GL_POLYGON_OFFSET_POINT. glGet with argument GL_POLYGON_OFFSET_FACTOR or GL_POLYGON_OFFSET_UNITS. Related Information The glDepthFunc subroutine, glDisable subroutine, glEnable subroutine, glGet subroutine, glIsEnabled subroutine, glLineWidth subroutine, glStencilOp subroutine, glTexEnv subroutine. glPolygonOffsetEXT Subroutine Purpose Sets the scale and bias used to calculate z values. Library OpenGL C bindings library: libGL.a C Syntax void glPolygonOffsetEXT(GLfloat GLfloat bias) factor, Description When GL_POLYGON_OFFSET_EXT is enabled, each fragment’s z value will be offset after it is interpolated from the z values of the appropriate vertices. The value of the offset is factor * DZ + bias, where DZ is a measurement of the change in z relative to the screen area of the polygon. The offset is added before the Depth Test is performed and before the value is written into the Depth Buffer. Initially GL_POLYGON_OFFSET_FACTOR_EXT and GL_POLYGON_OFFSET_BIAS_EXT are both set to 0.0. This is useful for rendering hidden line images, for applying decals to surfaces, and for rendering solids with highlighted edges. Parameters factor specifies a scale factor which is used to create a offset for each polygon. Chapter 1. OpenGL Subroutines 271 bias specifies a constant which is added to each polygon’s z offset. Notes glPolygonOffsetEXT is part of the EXT_polygon_offset extension, not part of the core GL command set. If GL_EXT_polygon_offset is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_polygon_offset is supported by the connection. Errors GL_INVALID_OPERATION is generated if glPolygonOffsetEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glIsEnabled with argument GL_POLYGON_OFFSET_EXT. glGet with argument GL_POLYGON_OFFSET_FACTOR_EXT or GL_POLYGON_OFFSET_BIAS_EXT . File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glDepthFunc subroutine, glEnable orglDisable subroutine, glGet subroutine, glIsEnabled subroutine, glLineWidth subroutine, glStencilOp subroutine, glTexEnv subroutine. glPolygonStipple Subroutine Purpose Sets the polygon stippling pattern. Library OpenGL C bindings library: libGL.a C Syntax void glPolygonStipple(const GLubyte * Mask) Description Polygon stippling, like line stippling, masks out certain fragments produced by rasterization, creating a pattern. (See the glLineStipple subroutine .) Stippling is independent of polygon antialiasing. The Mask parameter is a pointer to a 32 x 32 stipple pattern that is stored in memory just like the pixel data supplied to a glDrawPixels subroutine with height and width both equal to 32, a pixel format of GL_COLOR_INDEX, and data type of GL_BITMAP. That is, the stipple pattern is represented as a 32 x 32 array of 1-bit color indexes packed in unsigned bytes. The glPixelStore subroutine parameters such as GL_UNPACK_SWAP_BYTES and GL_UNPACK_LSB_FIRST affect the assembling of the bits into a stipple pattern. Pixel transfer operations (shift, offset, pixel map) are not applied to the stipple image, however. 272 OpenGL 2.1 Reference Manual Polygon stippling is enabled and disabled with the glEnable/glDisable subroutine pair, using argument GL_POLYGON_STIPPLE. If enabled, a rasterized polygon fragment with window coordinates xw and yw is sent to the next stage of the GL if and only if the (xw mod 32)th bit in the (yw mod 32)th row of the stipple pattern is 1 (one). When polygon stippling is disabled, it is as if the stipple pattern were all 1s. Parameters Mask Specifies a pointer to a 32 x 32 stipple pattern that is unpacked from memory in the same way that the glDrawPixels subroutine unpacks pixels. Associated Gets Associated gets for the glPolygonStipple subroutine are as follows. (See the glGet subroutine for more information.) glGetPolygonStipple glIsEnabled with argument GL_POLYGON_STIPPLE. Error Codes GL_INVALID_OPERATION The glPolygonStipple subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glDrawPixels subroutine, glEnable or glDisable subroutine, glGetPolygonStipple subroutine, glLineStipple subroutine, glPixelStore subroutine, glPixelTransfer subroutine. glPrioritizeTextures Subroutine Purpose Sets texture residence priority. Library OpenGL C bindings library: libGL.a C Syntax void glPrioritizeTextures(GLsizei n, const GLuint *textures, const GLclampf *priorities) Parameters n textures Specifies the number of textures to be prioritized. Specifies an array containing the names of the textures to be prioritized. Chapter 1. OpenGL Subroutines 273 priorities Specifies an array containing the texture priorities. A priority given in an element of priorities applies to the texture named by the corresponding element of textures. Description The glPrioritizeTextures subroutine assigns the n texture priorities given in priorities to the n textures named in textures. On machines with a limited amount of texture memory, GL establishes a ′′working set’’ of textures that are resident in texture memory. These textures may be bound to a texture target much more efficiently than textures that are not resident. By specifying a priority for each texture, glPrioritizeTextures allows applications to guide the GL implementation in determining which textures should be resident. The priorities given in priorities are clamped to the range [0.0, 1.0] before being assigned. Zero indicates the lowest priority; textures with priority zero are least likely to be resident. One indicates the highest priority; textures with priority one are most likely to be resident. However, textures are not guaranteed to be resident until they are bound. The glPrioritizeTextures subroutine silently ignores attempts to prioritize texture zero, or any texture name that does not correspond to an existing texture. The glPrioritizeTextures subroutine does not require that any of the textures named by textures be bound to a texture target. It can also be used to set the priority of a texture, but only if the texture is currently bound. This is the only way to set the priority of a default texture. The glPrioritizeTextures subroutine is included in display lists. Notes The glPrioritizeTextures subroutine is available only if the GL version is 1.1 or greater. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_OPERATION is generated if glPrioritizeTextures is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexParameter with parameter name GL_TEXTURE_PRIORITY retrieves the priority of a currently bound texture. Related Information The glAreTexturesResident subroutine, glBindTexture subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. glPrioritizeTexturesEXT Subroutine Purpose Sets texture residence priority. Library OpenGL C bindings library: libGL.a 274 OpenGL 2.1 Reference Manual C Syntax void glPrioritizeTexturesEXT(GLsizei n, const GLuint *textures, const GLclampf *priorities) Parameters n textures priorities The number of textures to be prioritized. An array containing the names of the textures to be prioritized. An array containing the texture priorities. A priority given in an element of priorities applies to the texture named by the corresponding element of textures. Description glPrioritizeTexturesEXT assigns the n texture priorities given in priorities to the n textures named in textures. On machines with a limited amount of texture memory, OpenGL establishes a ′′working set’’ of textures that are resident in texture memory. These textures may be bound to a texture target much more efficiently than textures that are not resident. By specifying a priority for each texture, glPrioritizeTexturesEXT allows applications to guide the OpenGL implementation in determining which textures should be resident. The priorities given in priorities are clamped to the range [0.0, 1.0] before being assigned. Zero indicates the lowest priority, and hence textures with priority zero are least likely to be resident. One indicates the highest priority, and hence textures with priority one are most likely to be resident. However, textures are not guaranteed to be resident until they are bound. glPrioritizeTexturesEXT silently ignores attempts to prioritize texture zero, or any texture name that does not correspond to an existing texture. glPrioritizeTexturesEXT does not require that any of the textures named by textures be bound to a texture target. glTexParameter may also be used to set a texture’s priority, but only if the texture is currently bound. This is the only way to set the priority of a default texture. glPrioritizeTexturesEXT is included in display lists. Notes glPrioritizeTexturesEXT is part of the EXT_texture_object extension, not part of the core GL command set. If GL_EXT_texture_object is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension EXT_texture_object is supported by the connection. Errors GL_INVALID_VALUE is generated if n is negative. GL_INVALID_OPERATION is generated if glPrioritizeTexturesEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexParameter with parameter name GL_TEXTURE_PRIORITY_EXT retrieves the priority of a currently-bound texture. Chapter 1. OpenGL Subroutines 275 File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glAreTexturesResidentEXT subroutine, glBindTextureEXT subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. glPushAttrib or glPopAttrib Subroutine Purpose Pushes and pops the attribute stack. Library OpenGL C bindings library: libGL.a C Syntax void glPushAttrib(GLbitfield mask) void glPopAttrib(void) Parameters mask Specifies a mask that indicates which attributes to save. Values for Mask are provided in the preceding list. Description The glPushAttrib subroutine takes one argument, a mask that indicates which groups of state variables to save on the attribute stack. Symbolic constants are used to set bits in the mask. The Mask parameter is typically constructed by ORing several of these constants together. The GL_ALL_ATTRIB_BITS special mask can be used to save all stackable states. The symbolic mask constants and their associated GL states are in the following list. Mask GL_ACCUM_BUFFER_BIT Attributes saved Accumulation buffer clear value GL_COLOR_BUFFER_BIT GL_ALPHA_TEST enable bit Alpha test function and reference value GL_BLEND enable bit Blending source and destination functions GL_COLOR_LOGIC_OP enable bit GL_DITHER enable bit GL_DRAW_BUFFER setting GL_LOGIC_OP enable bit Logic op function Color mode and index mode clear values Color mode and index mode write masks GL_BLEND_EQUATION_EXT setting GL_CURRENT_BIT Current red, green, blue, alpha (RGBA) color 276 OpenGL 2.1 Reference Manual GL_DEPTH_BUFFER_BIT GL_ENABLE_BIT GL_EVAL_BIT GL_FOG_BIT Current color index Current normal vector Current texture coordinates Current raster position GL_CURRENT_RASTER_POSITION_VALID flag RGBA color associated with current raster position Color index associated with current raster position Texture coordinates associated with current raster position GL_EDGE_FLAG flag GL_DEPTH_TEST enable bit Depth buffer test function Depth buffer clear value GL_DEPTH_WRITEMASK enable bit GL_ALPHA_TEST flag GL_AUTO_NORMAL flag GL_BLEND flag Enable bits for the user-definable clipping planes GL_COLOR_LOGIC_OP flag GL_COLOR_MATERIAL GL_CULL_FACE flag GL_DEPTH_TEST flag GL_DITHER flag GL_FOG flag GL_LIGHTi, where 0 < i<GL_MAX_LIGHTS GL_LIGHTING flag GL_LINE_SMOOTH flag GL_LINE_STIPPLE flag GL_LOGIC_OP flag GL_MAP1_x, where x is a map type GL_MAP2_x, where x is a map type GL_NORMALIZE flag GL_POINT_SMOOTH flag GL_POLYGON_OFFSET_EXT flag GL_POLYGON_OFFSET_FILL flag GL_POLYGON_OFFSET_LINE flag GL_POLYGON_OFFSET_POINT flag GL_POLYGON_SMOOTH flag GL_POLYGON_STIPPLE flag GL_SCISSOR_TEST flag GL_STENCIL_TEST flag GL_TEXTURE_1D flag GL_TEXTURE_2D flag GL_TEXTURE_3D_EXT flag Flags GL_TEXTURE_GEN_x, where x is S, T, R, or Q GL_MAP1_x enable bits, where x is a map type GL_MAP2_x enable bits, where x is a map type 1-dimensional (1D) grid endpoints and divisions 2-dimensional (2D) grid endpoints and divisions GL_AUTO_NORMAL enable bit GL_FOG enable flag Fog color Fog density Linear fog start Linear fog end Fog index Chapter 1. OpenGL Subroutines 277 GL_HINT_BIT GL_LIGHTING_BIT GL_LINE_BIT GL_LIST_BIT GL_PIXEL_MODE_BIT GL_POINT_BIT GL_POLYGON_BIT GL_POLYGON_STIPPLE_BIT GL_SCISSOR_BIT 278 OpenGL 2.1 Reference Manual GL_FOG_MODE value GL_PERSPECTIVE_CORRECTION_HINT setting GL_POINT_SMOOTH_HINT setting GL_LINE_SMOOTH_HINT setting GL_POLYGON_SMOOTH_HINT setting GL_FOG_HINT setting GL_SUBPIXEL_HINT_IBM setting GL_COLOR_MATERIAL enable bit GL_COLOR_MATERIAL_FACE value Color material parameters that are tracking the current color Ambient scene color GL_LIGHT_MODEL_LOCAL_VIEWER value GL_LIGHT_MODEL_TWO_SIDE setting GL_LIGHTING enable bit Enable bit for each light Ambient, diffuse, and specular intensity for each light Direction, position, exponent, and cutoff angle for each light Constant, linear, and quadratic attenuation factors for each light Ambient, diffuse, specular, and emissive color for each material Ambient, diffuse, and specular color indices for each material Specular exponent for each material GL_SHADE_MODEL setting GL_LINE_SMOOTH flag GL_LINE_STIPPLE enable bit Line stipple pattern and repeat counter Line width GL_LIST_BASE setting GL_RED_BIAS and GL_RED_SCALE settings GL_GREEN_BIAS and GL_GREEN_SCALE values GL_BLUE_BIAS and GL_BLUE_SCALE GL_ALPHA_BIAS and GL_ALPHA_SCALE GL_DEPTH_BIAS and GL_DEPTH_SCALE GL_INDEX_OFFSET and GL_INDEX_SHIFT values GL_MAP_COLOR and GL_MAP_STENCIL flags GL_ZOOM_X and GL_ZOOM_Y factors GL_READ_BUFFER setting GL_POINT_SMOOTH flag Point size GL_CULL_FACE enable bit GL_CULL_FACE_MODE value GL_FRONT_FACE indicator GL_POLYGON_OFFSET_BIAS_EXT setting GL_POLYGON_OFFSET_EXT flag GL_POLYGON_OFFSET_FACTOR setting GL_POLYGON_OFFSET_FACTOR_EXT setting GL_POLYGON_OFFSET_FILL flag GL_POLYGON_OFFSET_LINE flag GL_POLYGON_OFFSET_POINT flag GL_POLYGON_OFFSET_UNITS setting GL_POLYGON_MODE setting GL_POLYGON_SMOOTH flag GL_POLYGON_STIPPLE enable bit Polygon stipple image GL_SCISSOR_TEST flag Scissor box GL_STENCIL_BUFFER_BIT GL_TEXTURE_BIT GL_TRANSFORM_BIT GL_VIEWPORT_BIT GL_STENCIL_TEST enable bit Stencil function and reference value Stencil value mask Stencil fail, pass, and depth buffer pass actions Stencil buffer clear value Stencil buffer writemask Enable bits for the four texture coordinates Border color for each texture image Minification function for each texture image Magnification function for each texture image Texture coordinates and wrap mode for each texture image Color and mode for each texture environment Enable bits GL_TEXTURE_GEN_x, x is S, T, R, and Q GL_TEXTURE_GEN_MODE setting for S, T, R, and Q glTexGen plane equations for S, T, R, and Q Enables for 1D, 2D, and 3D_EXT testures Coefficients of the six clipping planes Enable bits for the user-definable clipping planes GL_MATRIX_MODE value GL_NORMALIZE flag Depth range (near and far) Viewport origin and extent The glPopAttrib subroutine restores the values of the state variables saved with the last glPushAttrib subroutine. Those not saved are left unchanged. It is an error to push attributes onto a full stack, or to pop attributes off an empty stack. In either case, the error flag is set, and no other change is made to GL state. Initially, the attribute stack is empty. Notes Not all values for the GL state can be saved on the attribute stack. For example, pixel pack and unpack state, render mode state, and select and feedback state cannot be saved. The depth of the attribute stack is dependent on the implementation, but it must be at least 16. Errors GL_STACK_OVERFLOW GL_STACK_UNDERFLOW GL_INVALID_OPERATION The glPushAttrib subroutine is called while the attribute stack is full. The glPopAttrib subroutine is called while the attribute stack is empty. The glPushAttrib subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets glGet with argument GL_ATTRIB_STACK_DEPTH glGet with argument GL_MAX_ATTRIB_STACK_DEPTH. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Chapter 1. OpenGL Subroutines 279 Related Information The glBegin subroutine, glEnd subroutine, glGet subroutine, glGetClipPlane subroutine, glGetError subroutine, glGetLight subroutine, glGetMap subroutine, glGetMaterial subroutine, glGetPixelMap subroutine, glGetPolygonStipple subroutine, glGetString subroutine, glGetTexEnv subroutine, glGetTexGen subroutine, glGetTexImage subroutine, glGetTexLevelParameter subroutine, glGetTexParameter subroutine, glIsEnabled subroutine, glPushClientAttrib or PopClientAttrib subroutine. glPushClientAttrib or glPopClientAttrib Subroutine Purpose Pushes and pops the attribute stack. Library OpenGL C bindings library: libGL.a C Syntax void glPushClientAttrib(GLbitfield mask) void glPopClientAttrib(void) Parameters mask Specifies a mask that indicates which attributes to save. Values for mask are listed below. Description The glPushClientAttrib subroutine takes one argument, a mask that indicates which groups of client state variables to save on the client attribute stack. Symbolic constants are used to set bits in the mask. The mask parameter is typically constructed by OR’ing several of these constants together. The special mask GL_CLIENT_ALL_ATTRIB_BITS can be used to save all stackable client state. The symbolic mask constants and their associated GL client state are as follows (the second column lists which attributes are saved): GL_CLIENT_PIXEL_STORE_BIT GL_CLIENT_VERTEX_ARRAY_BIT Pixel storage modes Vertex arrays (and enables) The glPopClientAttrib subroutine restores the values of the client state variables saved with the last glPushClientAttrib. Those not * saved are left unchanged. It is an error to push attributes onto a full client attribute stack, or to pop attributes off an empty stack. In either case, the error flag is set, and no other change is made to GL state. Initially, the client attribute stack is empty. Notes The glPushClientAttrib subroutine is available only if the GL version is 1.1 or greater. Not all values for GL client state can be saved on the attribute stack. For example, select and feedback state cannot be saved. 280 OpenGL 2.1 Reference Manual The depth of the attribute stack depends on the implementation, but it must be at least 16. The glPushClientAttrib and glPopClientAttrib subroutines are not compiled into display lists, but are executed immediately. Use glPushAttrib and glPopAttrib to push and restore state which is kept on the server. Only pixel storage modes and vertex array state may be pushed and popped with glPushClientAttrib and glPopClientAttrib. Errors GL_STACK_OVERFLOW is generated if glPushClientAttrib is called while the attribute stack is full. GL_STACK_UNDERFLOW is generated if glPopClientAttrib is called while the attribute stack is empty. Associated Gets glGet with argument GL_ATTRIB_STACK_DEPTH glGet with argument GL_MAX_CLIENT_ATTRIB_STACK_DEPTH Related Information The glColorPointer subroutine, glDisableClientState subroutine, glEdgeFlagPointer subroutine, glEnableClientState subroutine, glGet subroutine, glGetError subroutine, glIndexPointer subroutine, glNewList subroutine, glNormalPointer subroutine, glPixelStore subroutine, glPushAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glPushMatrix or glPopMatrix Subroutine Purpose Pushes and pops the current matrix stack. Library OpenGL C bindings library: libGL.a C Syntax void glPushMatrix(void) void glPopMatrix(void) Description There is a stack of matrices for each of the matrix modes. In GL_MODELVIEW mode, the stack depth is at least 32. In the other two modes, GL_PROJECTION and GL_TEXTURE, the depth is at least 2. The current matrix in any mode is the matrix on the top of the stack for that mode. The glPushMatrix subroutine pushes the current matrix stack down by one, duplicating the current matrix. That is, after a glPushMatrix call, the matrix on the top of the stack is identical to the one below it. The glPopMatrix subroutine pops the current matrix stack, replacing the current matrix with the one below it on the stack. Initially, each of the stacks contains one matrix, an identity matrix. Chapter 1. OpenGL Subroutines 281 It is an error to push a full matrix stack, or to pop a matrix stack that contains only a single matrix. In either case, the error flag is set, and no other change is made to GL state. Error Codes GL_STACK_OVERFLOW GL_STACK_UNDERFLOW GL_INVALID_OPERATION The glPushMatrix subroutine is called while the current matrix stack is full. The glPopMatrix subroutine is called while the current matrix stack contains only a single matrix. The glPushMatrix subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glPushMatrix or glPopMatrix subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX glGet with argument GL_MODELVIEW_STACK_DEPTH glGet with argument GL_PROJECTION_STACK_DEPTH glGet with argument GL_TEXTURE_STACK_DEPTH glGet with argument GL_MAX_MODELVIEW_STACK_DEPTH glGet with argument GL_MAX_PROJECTION_STACK_DEPTH glGet with argument GL_MAX_TEXTURE_STACK_DEPTH. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFrustum subroutine, glLoadIdentity subroutine, glLoadMatrix subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glOrtho subroutine, glRotate subroutine, glScale subroutine, glTranslate subroutine, glViewport subroutine. glPushName or glPopName Subroutine Purpose Pushes and pops the name stack. Library OpenGL C bindings library: libGL.a 282 OpenGL 2.1 Reference Manual C Syntax void glPushName(GLuint Name) void glPopName(void) Parameters Name Specifies a name that will be pushed onto the name stack. Description The name stack is used during selection mode to allow sets of rendering commands to be uniquely identified. It consists of an ordered set of unsigned integers. The glPushName subroutine causes the Name parameter to be pushed onto the name stack, which is initially empty. The glPopName subroutine pops one name off the top of the stack. It is an error to push a name onto a full stack, or to pop a name off an empty stack. It is also an error to manipulate the name stack between a call to the glBegin subroutine and the corresponding call to the glEnd subroutine. In any of these cases, the error flag is set and no other change is made to GL state. The name stack is always empty while the render mode is not GL_SELECT. Calls to glPushName or glPopName while the render mode is not GL_SELECT are ignored. Associated Gets Associated gets for the glPushName or glPopName subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_NAME_STACK_DEPTH glGet with argument GL_MAX_NAME_STACK_DEPTH. Error Codes GL_STACK_OVERFLOW GL_STACK_UNDERFLOW GL_INVALID_OPERATION The glPushName subroutine is called while the name stack is full. The glPopName subroutine is called while the name stack is empty. The glPushName or glPopName subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glInitNames subroutine, glLoadName subroutine, glRenderMode subroutine, glSelectBuffer subroutine. glRasterPos Subroutine Purpose Specifies the raster position for pixel operations. Chapter 1. OpenGL Subroutines 283 Library OpenGL C bindings library: libGL.a C Syntax void glRasterPos2d(GLdouble GLdouble Y) void glRasterPos2f(GLfloat void glRasterPos2i(GLint GLint Y) X, X, X, void glRasterPos2s(GLshort GLshort Y) X, void glRasterPos3d(GLdouble GLdouble Y, GLdouble Z) void glRasterPos3f(GLfloat GLfloat Y, GLfloat Z) void glRasterPos3i(GLint GLint Y, GLint Z) X, X, X, void glRasterPos3s(GLshort GLshort Y, GLshort Z) X, void glRasterPos4d(GLdouble GLdouble Y, GLdouble Z, GLdouble W) void glRasterPos4f(GLfloat GLfloat Y, GLfloat Z, GLfloat W) void glRasterPos4i(GLint GLint Y, GLint Z, GLint W) void glRasterPos4s(GLshort GLshort Y, GLshort Z, GLshort W) GLfloat X, X, X, X, void glRasterPos2dv(const GLdouble * V) void glRasterPos2fv(const GLfloat * V) 284 OpenGL 2.1 Reference Manual Y) void glRasterPos2iv(const GLint * V) void glRasterPos2sv(const GLshort * V) void glRasterPos3dv(const GLdouble * V) void glRasterPos3fv(const GLfloat * V) void glRasterPos3iv(const GLint * V) void glRasterPos3sv(const GLshort * V) void glRasterPos4dv(const GLdouble * V) void glRasterPos4fv(const GLfloat * V) void glRasterPos4iv(const GLint * V) void glRasterPos4sv(const GLshort * V) Parameters X, Y, Z, W V Specify the x, y, z, and w object coordinates (if present) for the raster position. Specifies a pointer to an array of two, three, or four elements, specifying x, y, z, and w coordinates, respectively. Description The GL maintains a 3-dimensional (3D) position in window coordinates. This position, called the raster position, is maintained with subpixel accuracy. It is used to position pixel and bitmap write operations. (See the glBitmap subroutine for information on drawing bitmaps; the glCopyPixels subroutine for information on copying pixels to the frame buffer; and the glDrawPixels subroutine for information on writing a block of pixels to the frame buffer.) The current raster position consists of four window coordinates (X, Y, Z, W), a valid bit, and associated color data and texture coordinates. The W coordinate is actually a clip coordinate, because W is not projected to window coordinates. The glRasterPos4 subroutine specifies object coordinates X, Y, Z, and W explicitly. The glRasterPos3 subroutine specifies object coordinates X, Y, and Z explicitly, while W is implicitly set to 1 (one). The glRasterPos2 subroutine uses the argument values for X and Y while implicitly setting Z and W to 0 (zero) and 1. The object coordinates presented by glRasterPos are treated just like those of a glVertex subroutine: they are transformed by the current modelview and projection matrices and passed to the clipping stage. If the vertex is not culled, it is projected and scaled to window coordinates, which become the new current raster position, and the GL_CURRENT_RASTER_POSITION_VALID flag is set. If the vertex is culled, the valid bit is cleared and the current raster position and associated color and texture coordinates are undefined. The current raster position also includes some associated color data and texture coordinates. If lighting is enabled, GL_CURRENT_RASTER_COLOR in red, green, blue, alpha (RGBA) mode or the GL_CURRENT_RASTER_INDEX in color index mode is set to the color produced by the lighting calculation. (See the glLight subroutine for information on setting light source parameters; the glLightModel subroutine for information on setting lighting model parameters; and the glShadeModel subroutine for information on selecting flat or smooth shading.) If lighting is disabled, current color (in RGBA mode, state variable GL_CURRENT_COLOR) or color index (in color index mode, state variable GL_CURRENT_INDEX) is used to update the current raster color. Chapter 1. OpenGL Subroutines 285 Likewise, the GL_CURRENT_RASTER_TEXTURE_COORDS is updated as a function of the GL_CURRENT_TEXTURE_COORDS, based on the texture matrix and the texture generation functions. (See the glTexGen subroutine for information on generating texture coordinates.) Initially, the current raster position is (0,0,0,1), the valid bit is set, the associated RGBA color is (1,1,1,1), the associated color index is 1, and the associated texture coordinates are (0,0,0,1). In RGBA mode, GL_CURRENT_RASTER_INDEX is always 1; in color index mode, the current raster RGBA color always maintains its initial value. Notes The raster position is modified both by glRasterPos and by glBitmap. When the raster position coordinates are not valid, drawing commands that are based on the raster position are ignored (that is, they do not result in changes to GL state). Errors GL_INVALID_OPERATION The glRasterPos subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glRasterPos subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_CURRENT_RASTER_POSITION glGet with argument GL_CURRENT_RASTER_POSITION_VALID glGet with argument GL_CURRENT_RASTER_COLOR glGet with argument GL_CURRENT_RASTER_INDEX glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glBitmap subroutine, glCopyPixels subroutine, glDrawPixels subroutine, glLight subroutine, glLightModel subroutine, glShadeModel subroutine, glTexCoord subroutine, glTexGen subroutine, glVertex subroutine. glReadBuffer Subroutine Purpose Selects a color buffer source for pixels. Library OpenGL C bindings library: libGL.a 286 OpenGL 2.1 Reference Manual C Syntax void glReadBuffer(GLenum Mode) Parameters Mode Specifies a color buffer. Accepted values are as follows: v GL_FRONT_LEFT v GL_FRONT_RIGHT v GL_BACK_LEFT v GL_BACK_RIGHT v GL_FRONT, GL_BACK v GL_LEFT v GL_RIGHT v GL_AUXi, where i is between 0 (zero) and GL_AUX_BUFFERS - 1 Description The glReadBuffer subroutine specifies a color buffer as the source for subsequent glReadPixels and glCopyPixels subroutines. The Mode parameter accepts one of twelve or more predefined values. (GL_AUX0 through GL_AUX3 are always defined.) In a fully configured system, GL_FRONT, GL_LEFT, and GL_FRONT_LEFT all name the front left buffer, GL_FRONT_RIGHT and GL_RIGHT name the front right buffer, and GL_BACK_LEFT and GL_BACK name the back left buffer. Nonstereo configurations have only a left buffer, or a front left and a back left buffer if double-buffered. Single-buffered configurations have only a front buffer, or a front left and a front right buffer if stereo. It is an error to specify a nonexistent buffer to glReadBuffer. By default, the Mode parameter is GL_FRONT in single-buffered configurations and GL_BACK in double-buffered configurations. Error Codes GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_OPERATION Mode is not one of the twelve (or more) accepted values. Mode specifies a buffer that does not exist. The glReadBuffer subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glReadBuffer subroutine are as follows. (See the glGet subroutine.) glGet with argument GL_READ_BUFFER. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCopyPixels subroutine, glDrawBuffer subroutine, glReadPixels subroutine. Chapter 1. OpenGL Subroutines 287 glReadPixels Subroutine Purpose Reads a block of pixels from the frame buffer. Library OpenGL C bindings library: libGL.a C Syntax void glReadPixels(GLint X, GLint Y, GLsizei Width, GLsizei Height, GLenum Format, GLenum Type, GLvoid *Pixels) Parameters X, Y Width, Height Format Type Pixels Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels. Specify the dimensions of the pixel rectangle. Width and Height of 1 (one) correspond to a single pixel. Specifies the format of the pixel data. Symbolic constants GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, GL_ABGR_EXT, GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT and GL_422_REV_AVERAGE_EXT are accepted. Specifies the data type for Pixels. Sybolic constants GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, GL_UNSIGNED_INT_2_10_10_10_REV are accepted. Returns the pixel data. Description The glReadPixels subroutine returns pixel data from the frame buffer, starting with the pixel whose lower left corner is at location (X, Y), and puts it into client memory starting at the location specified by the Pixels parameter. Several parameters control the processing of the pixel data before it is placed into client memory. These parameters are set with three subroutines: glPixelStore, glPixelTransfer, and glPixelMap. The effects on glReadPixels of most, but not all, of the parameters specified by these three subroutines are described here. The glReadPixels subroutine returns values from each pixel with the lower left-hand corner at (x + i, y + j) for 0 < i < Width and 0 < j < Height. This pixel is said to be the ith pixel in the jth row. Pixels are returned in row order from the lowest to the highest row, left to right in each row. The Format parameter specifies the format for the returned pixel values. Accepted values for Format are as follows: 288 OpenGL 2.1 Reference Manual GL_COLOR_INDEX GL_STENCIL_INDEX GL_DEPTH_COMPONENT GL_ABGR_EXT GL_RED GL_GREEN GL_BLUE GL_ALPHA GL_RGB Color indexes are read from the color buffer selected by the glReadBuffer subroutine. Each index is converted to fixed-point format, shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET. If GL_MAP_COLOR is GL_TRUE, indexes are replaced by their mappings in the table GL_PIXEL_MAP_I_TO_I. Stencil values are read from the stencil buffer. Each index is converted to fixed-point format, shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET. If GL_MAP_STENCIL is GL_TRUE, indexes are replaced by their mappings in the table GL_PIXEL_MAP_S_TO_S. Depth values are read from the depth buffer. Each component is converted to floating-point format such that the minimum depth value maps to 0.0 and the maximum value maps to 1.0. Each component is then multiplied by GL_DEPTH_SCALE, added to GL_DEPTH_BIAS, and finally clamped to the range [0,1]. Each pixel is a four-component group: for GL_RGBA, the red component is first, followed by green, followed by blue, followed by alpha; for GL_BGRA, the blue component is first, followed by green, followed by red, followed by alpha; for GL_ABGR_EXT the order is alpha, blue, green, and then red. Floating-point values are converted directly to an internal floatingpoint format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and zero maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. Each pixel is a single red component. This component is converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then it is converted to an RGBA pixel with green and blue set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel. Each pixel is a single green component. This component is converted to the internal floating-point format in the same way as the green component of an RGBA pixel is, then it is converted to an RGBA pixel with red and blue set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel. Each pixel is a single blue component. This component is converted to the internal floating-point format in the same way as the blue component of an RGBA pixel is, then it is converted to an RGBA pixel with red and green set to 0.0, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel. Each pixel is a single alpha component. This component is converted to the internal floating-point format in the same way as the alpha component of an RGBA pixel is, then it is converted to an RGBA pixel with red, green, and blue set to 0.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel. Each pixel is a three-component group, red first, followed by green, followed by blue. Each component is converted to the internal floating-point format in the same way as the red, green, and blue components of an RGBA pixel are. The color triple is converted to an RGBA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel. Chapter 1. OpenGL Subroutines 289 GL_RGBA Each pixel is a four-component group, red first, followed by green, followed by blue, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data are mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively. GL_BGR GL_BGRA The resulting RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a three-component group, blue first, followed by green, followed by red. Each component is converted to the internal floating-point format in the same way as the blue, green, and red components of an BGRA pixel are. The color triple is converted to an BGRA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an BGRA pixel. Each pixel is a four-component group, blue first, followed by green, followed by red, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data are mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is BLUE, GREEN, RED, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is B, G, R, or A, respectively. GL_LUMINANCE 290 OpenGL 2.1 Reference Manual The resulting BGRA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a single luminance component. This component is converted to the internal floating-point format in the same way as the red component of an RGBA pixel is, then it is converted to an RGBA pixel with red, green, and blue set to the converted luminance value, and alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an RGBA pixel. GL_LUMINANCE_ALPHA Processing differs depending on whether color buffers store color indexes or red, green, blue, alpha (RGBA) color components. If color indexes are stored, they are read from the color buffer selected by glReadBuffer. Each index is converted to fixed-point format, shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET. Indexes are then replaced by the RGBA values obtained by indexing the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables. If RGBA color components are stored in the color buffers, they are read from the color buffer selected by glReadBuffer. Each color component is converted to floating-point format such that zero intensity maps to 0.0 and full intensity maps to 1.0. Each component is then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is GL_RED, GL_GREEN, GL_BLUE, and GL_ALPHA. Each component is clamped to the range [0,1]. Finally, if GL_MAP_COLOR is GL_TRUE, each color component c is replaced by its mapping in the table GL_PIXEL_MAP_c_TO_c, where c again is GL_RED, GL_GREEN, GL_BLUE, and GL_ALPHA. Each component is scaled to the size its corresponding table before the lookup is performed. GL_422_EXT GL_422_REV_EXT Finally, unneeded data is discarded. For example, GL_RED discards the green, blue, and alpha components, while GL_RGB discards only the alpha component. GL_LUMINANCE computes a single component value as the sum of the red, green, and blue components, and GL_LUMINANCE_ALPHA does the same, while keeping alpha as a second value. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_RGB_TO_YCBCR_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glReadPixels is called with this parameter. The internal RGB values are sent through the RGB_to_YCbCr matrix to create Y, Cb, and Cr values. Each returned pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. The Cb for each even pixel comes from the Cb value for that pixel. The Cr in each odd pixel comes from the Cr value of its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.). This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_RGB_TO_YCBCR_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glReadPixels is called with this parameter. The internal RGB values are sent through the RGB_to_YCbCr matrix to create Y, Cb, and Cr values. Each returned pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. The Cb for each even pixel comes from the Cb value for that pixel. The Cr in each odd pixel comes from its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.). Chapter 1. OpenGL Subroutines 291 GL_422_AVERAGE_EXT GL_422_REV_AVERAGE_EXT This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_RGB_TO_YCBCR_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glReadPixels is called with this parameter. The internal RGB values are sent through the RGB_to_YCbCr matrix to create Y, Cb, and Cr values. Each returned pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its own Cb and that of its left neighbor, and gets its Cr from the average of its own Cr and that of its left neighbor. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_EXT to compute that fragment.). This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_RGB_TO_YCBCR_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glReadPixels is called with this parameter. The internal RGB values are sent through the RGB_to_YCbCr matrix to create Y, Cb, and Cr values. Each returned pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its own Cb and that of its left neighbor, and gets its Cr from the average of its own Cr and that of its left neighbor. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_EXT to compute that fragment.). The shift, scale, bias, and lookup factors described in the preceding section are all specified by glPixelTransfer. The lookup table contents themselves are specified by the glPixelMap subroutine. The final step involves converting the indexes or components to the proper format, as specified by the Type parameter. If the Format parameter is GL_COLOR_INDEX or GL_STENCIL_INDEX and Type is not GL_FLOAT, each index is masked with the mask value given in the following table. If the Type parameter is GL_FLOAT, each integer index is converted to single-precision floating-point format. If the Format parameter is any legal value other than GL_COLOR_INDEX, GL_STENCIL_INDEX, or GL_DEPTH_COMPONENT, and the Type parameter is not GL_FLOAT, each component is multiplied by the multiplier shown in the following table. If Type is GL_FLOAT, each component is passed as is (or converted to the client’s single-precision floating-point format if it is different from the one used by the GL). Type Index Mask 8 Component Conversion GL_UNSIGNED_BYTE 2 -1 (28 -1)c GL_BYTE 27 -1 [(27 -1)c-1]/2 GL_BITMAP 1 1 16 -1 (216 -1)c GL_UNSIGNED_SHORT 2 GL_SHORT 215 -1 [(215 -1)c-1]/2 GL_UNSIGNED_INT 232 -1 (232 -1)c GL_INT 231 -1 [(231 -1)c-1]/2 GL_FLOAT none c GL_UNSIGNED_BYTE_3_3_2 GL_UNSIGNED_BYTE_2_3_3_REV 292 OpenGL 2.1 Reference Manual 8 (2N -1)c 8 (2N -1)c 2 -1 2 -1 Type Index Mask GL_UNSIGNED_SHORT_5_6_5 GL_UNSIGNED_SHORT_5_6_5_REV GL_UNSIGNED_SHORT_4_4_4_4 GL_UNSIGNED_SHORT_4_4_4_4_REV GL_UNSIGNED_SHORT_5_5_5_1 GL_UNSIGNED_SHORT_1_5_5_5_REV GL_UNSIGNED_INT_8_8_8_8 GL_UNSIGNED_INT_8_8_8_8_REV GL_UNSIGNED_INT_10_10_10_2 GL_UNSIGNED_INT_2_10_10_10_REV Component Conversion 2 16 -1 (2N -1)c 2 16 -1 (2N -1)c 2 16 -1 (2N -1)c 2 16 -1 (2N -1)c 2 16 -1 (2N -1)c 2 16 -1 (2N -1)c 2 32 -1 (2N -1)c 2 32 -1 (2N -1)c 2 32 -1 (2N -1)c 2 32 -1 (2N -1)c Equations with N as the exponent are performed for each bitfield of the packed data type, with N set to the number of bits in the bitfield. Return values are placed in memory as follows. If the Format parameter is GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, or GL_LUMINANCE, a single value is returned and the data for the ith pixel in the jth row is placed in location (j) Width + i. GL_RGB and GL_BGR return three values, GL_RGBA, GL_BGRA, and GL_ABGR_EXT return four values, and GL_LUMINANCE_ALPHA, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT and GL_422_REV_AVERAGE_EXT return two values for each pixel, with all values corresponding to a single pixel occupying contiguous space in Pixels. Storage parameters set by glPixelStore, such as GL_PACK_SWAP_BYTES and GL_PACK_LSB_FIRST, affect the way that data is written into memory. See the glPixelStore subroutine for a description. Notes Values for pixels that lie outside the window connected to the current GL context are undefined. If an error is generated, no change is made to the contents of Pixels. Format of GL_ABGR_EXT is part of the _extname (EXT_abgr) extension, not part of the core GL command set. Packed pixel types and BGR/BGRA formats are only supported in OpenGL 1.2 and later. Error Codes GL_INVALID_ENUM GL_INVALID_VALUE GL_INVALID_OPERATION GL_INVALID_OPERATION GL_INVALID_OPERATION GL_INVALID_OPERATION Format or Type is not an accepted value. Width or Height is negative. Format is GL_COLOR_INDEX and the color buffers store RGBA color components. Format is GL_STENCIL_INDEX and there is no stencil buffer. Format is GL_DEPTH_COMPONENT and there is no depth buffer. The glReadPixels subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glReadPixels subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_INDEX_MODE. Chapter 1. OpenGL Subroutines 293 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glCopyPixels subroutine, glDrawPixels subroutine, glPixelMap subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glReadBuffer subroutine. glRect Subroutine Purpose Draws a rectangle. Library OpenGL C bindings library: libGL.a C Syntax void glRectd(GLdouble GLdouble Y1, GLdouble X2, GLdouble Y2) void glRectf(GLfloat GLfloat Y1, GLfloat X2, GLfloat Y2) void glRecti(GLint GLint Y1, GLint X2, GLint Y2) void glRects(GLshort GLshort Y1, GLshort X2, GLshort Y2) X1, X1, X1, X1, void glRectdv(const GLdouble * V1, const GLdouble * V2) void glRectfv(const GLfloat * V1, const GLfloat * V2) void glRectiv(const GLint * V1, const GLint * V2) void glRectsv(const GLshort * V1, const GLshort * V2) 294 OpenGL 2.1 Reference Manual Parameters X1, Y1 X2, Y2 V1 V2 Specify one vertex of a rectangle. Specify the opposite vertex of the rectangle. Specifies a pointer to one vertex of a rectangle. Specifies a pointer to the opposite vertex of the rectangle. Description The glRect subroutine supports efficient specification of rectangles as two corner points. Each rectangle command takes four arguments, organized either as two consecutive pairs of (x,y) coordinates, or as two pointers to arrays, each containing an (x,y) pair. The resulting rectangle is defined in the z=0 plane. glRect(X1, Y1, X2, Y2) is equivalent to the following sequence: glBegin(GL_POLYGON); glVertex2(X1, Y1); glVertex2(X2, Y1); glVertex2(X2, Y2); glVertex2(X1, Y2); glEnd(); Note: If the second vertex is above and to the right of the first vertex, the rectangle is constructed with a counterclockwise winding. Errors GL_INVALID_OPERATION The glRect subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glVertex subroutine. glRenderMode Subroutine Purpose Sets rasterization mode. Library OpenGL C bindings library: libGL.a C Syntax GLint glRenderMode(GLenum Mode) Parameters Mode Specifies the rasterization mode. Four values are accepted: GL_RENDER, GL_SELECT, GL_FEEDBACK, and GL_VISIBILITY_IBM. The default value is GL_RENDER. Chapter 1. OpenGL Subroutines 295 Description The glRenderMode subroutine sets the rasterization mode. It takes one argument, the Mode parameter, which can assume one of four predefined values: GL_RENDER GL_SELECT GL_FEEDBACK GL_VISIBILITY_IBM Render mode. Primitives are rasterized, producing pixel fragments, which are written into the frame buffer. This is the normal mode, and also the default mode. Selection mode. No pixel fragments are produced, and no change to the frame buffer contents is made. Instead, a record of the names of primitives that would have been drawn if the render mode was GL_RENDER is returned in a select buffer, which must be created before selection mode is entered. (See the glSelectBuffer subroutine for information about establishing a buffer for selection mode values.) Feedback mode. No pixel fragments are produced, and no change to the frame buffer contents is made. Instead, the coordinates and attributes of vertices that would have been drawn had the render mode been GL_RENDER are returned in a feedback buffer, which must be created before feedback mode is entered. (See the glFeedbackBuffer subroutine for information about controlling the feedback mode.) Visibility RenderMode is identical to render RenderMode, except whenever a fragment passes all tests (in other words, depth, stencil, alpha, scissor and window-ownership) then a visibility hit results. Whenever a name stack manipulation command is executed or RenderMode is called, and there is a hit since the last time the stack was manipulated or RenderMode was called, then a hit record is written into the visibility array. The hit record consists of the number of names in the name stack at the time of the event, followed by the name stack contents (bottom name first). (See the glVisibilityBufferIBM subroutine for information about controlling the visibility mode.) The return value of glRenderMode is determined by the render mode at the time glRenderMode is called, rather than by the Mode parameter. Refer to glSelectBuffer, glFeedbackBuffer and glVisibilityBufferIBM for more details concerning selection, feedback and visibility operation. Notes If an error is generated, glRenderMode returns 0 (zero) regardless of the current render mode. Errors GL_INVALID_ENUM GL_INVALID_OPERATION GL_INVALID_OPERATION GL_INVALID_OPERATION GL_INVALID_OPERATION 296 OpenGL 2.1 Reference Manual Mode is not one of the four accepted values. The glSelectBuffer subroutine is called while the render mode is GL_SELECT, or glRenderMode is called with the GL_SELECT argument before glSelectBuffer is called at least once. The glFeedbackBuffer subroutine is called while the render mode is GL_FEEDBACK, or glRenderMode is called with the GL_FEEDBACK argument before glFeedbackBuffer is called at least once. The glRenderMode subroutine is called between a call to glBegin and the corresponding call to glEnd. The glVisibilityBufferIBM subroutine is called while the render mode is GL_VISIBILITY_IBM, or glRenderMode is called with the GL_VISIBILITY_IBM argument before glVisibilityBufferIBM is called at least once. Associated Gets Associated gets for the glRenderMode subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_RENDER_MODE. Return Values GL_RENDER GL_SELECT GL_FEEDBACK GL_VISIBILITY_IBM 0. The number of hit records transferred to the select buffer. The number of values (not vertices) transferred to the feedback buffer. The number of hit records transferred to the visibility buffer. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFeedbackBuffer subroutine, glVisibilityBufferIBM subroutine, glInitNames subroutine, glLoadName subroutine, glPassThrough subroutine, glPushName subroutine, glSelectBuffer subroutine. glRotate Subroutine Purpose Multiplies the current matrix by a rotation matrix. Library OpenGL C bindings library: libGL.a C Syntax void glRotated(GLdouble Angle, GLdouble X, GLdouble Y, GLdouble Z) void glRotatef(GLfloat Angle, GLfloat X, GLfloat Y, GLfloat Z) Parameters Angle X, Y, Z Specifies the angle of rotation, in degrees. Specify the X, Y, and Z coordinates of a vector, respectively. Description The glRotate subroutine computes a matrix that performs a counterclockwise rotation of Angle degrees about the vector from the origin through the point (X, Y, Z). Chapter 1. OpenGL Subroutines 297 The current matrix is multiplied by this rotation matrix, with the product replacing the current matrix. That is, if M is the current matrix and R is the translation matrix, M is replaced with MR. (See the glMatrixMode subroutine for information on specifying the current matrix.) If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all objects drawn after glRotate is called are rotated. Use the glPushMatrix and glPopMatrix subroutines to save and restore the unrotated coordinate system. Associated Gets Associated gets for the glRotate subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX. Errors GL_INVALID_OPERATION The glRotate subroutine is called between a call to glBegin and the corresponding call to glEnd. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glPushMatrix subroutine, glScale subroutine, glTranslate subroutine. glScale Subroutine Purpose Multiplies the current matrix by a general scaling matrix. Library OpenGL C bindings library: libGL.a C Syntax void glScaled(GLdouble X, GLdouble Y, GLdouble Z) void glScalef(GLfloat X, GLfloat Y, GLfloat Z) 298 OpenGL 2.1 Reference Manual Parameters X, Y, Z Specify scale factors along the X, Y, and Z axes, respectively. Description The glScale subroutine produces a general scaling along the X, Y, and Z axes. The three arguments indicate the desired scale factors along each of the three axes. The resulting matrix is as follows: x 0 0 0 0 y 0 0 0 0 z 0 0 0 0 1 Figure 22. Resulting Matrix. This diagram shows a matrix enclosed in brackets. The matrix consists of four lines containing four characters each. The first line contains the following (from left to right): x, zero, zero, zero. The second line contains the following (from left to right): zero, y, zero, zero. The third line contains the following (from left to right): zero, zero, z, zero. The fourth line contains the following (from left to right): zero, zero, zero, one. The current matrix is multiplied by this scale matrix, with the product replacing the current matrix. That is, if M is the current matrix and S is the scale matrix, M is replaced with MS. (See the glMatrixMode subroutine for information on specifying the current matrix.) If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all objects drawn after glScale is called are scaled. Use the glPushMatrix and glPopMatrix subroutines to save and restore the unscaled coordinate system. Notes If scale factors other than 1.0 are applied to the modelview matrix and lighting is enabled, automatic normalization of normals should probably also be enabled. (Use the glEnable and glDisable subroutines with the GL_NORMALIZE argument.) Errors GL_INVALID_OPERATION The glScale subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glScale subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_MATRIX_MODE glGet with argument GL_MODELVIEW_MATRIX glGet with argument GL_PROJECTION_MATRIX glGet with argument GL_TEXTURE_MATRIX. Chapter 1. OpenGL Subroutines 299 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glPushMatrix subroutine, glRotate subroutine, glTranslate subroutine. glScissor Subroutine Purpose Defines the scissor box. Library OpenGL C bindings library: libGL.a C Syntax void glScissor(GLint X, GLint Y, GLsizei Width, GLsizei Height) When the scissor test is disabled, it is as though the scissor box includes the entire window. Parameters X, Y Width, Height Specify the lower left corner of the scissor box. Initially (0,0). Specify the width and height of the scissor box. When a GL context is first attached to a window, Width and Height are set to the dimensions of that window. Description The glScissor subroutine defines a rectangle, called the scissor box, in window coordinates. The first two arguments, X and Y, specify the lower left corner of the box. The Width and Height parameters specify the width and height of the box. The scissor test is enabled and disabled with the glEnable and glDisable subroutines with the GL_SCISSOR_TEST argument. While the scissor test is enabled, only pixels that lie within the scissor box can be modified by drawing commands. Window coordinates have integer values at the shared corners of frame buffer pixels, so glScissor(0,0,1,1) allows only the lower left pixel in the window to be modified, and glScissor(0,0,0,0) disallows modification to all pixels in the window. Errors GL_INVALID_VALUE GL_INVALID_OPERATION 300 OpenGL 2.1 Reference Manual Width or Height is negative. The glScissor subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glScissor subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_SCISSOR_BOX glIsEnabled with argument GL_SCISSOR_TEST. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable or glDisable subroutine, glViewport subroutine. glSecondaryColorEXT Subroutine Purpose Specifies an RGB color used by the Color Sum stage. Library OpenGL C bindings library: (libGL.a) C Syntax void glSecondaryColorbEXT(GLbyte Red, GLbyte Green, GLbyte Blue) void glSecondaryColorsEXT(GLshort Red, GLshort Green, GLshort Blue) void glSecondaryColoriEXT(GLint Red, GLint Green, GLint Blue) void glSecondaryColorfEXT(GLfloat Red, GLfloat Green, GLfloat Blue) void glSecondaryColordEXT(GLdouble Red, GLdouble Green, GLdouble Blue) void glSecondaryColorubEXT(GLubyte Red, GLubyte Green, GLubyte Blue) void glSecondaryColorusEXT(GLushort Red, GLushort Green, GLushort Blue) void glSecondaryColoruiEXT(GLuint Red, GLuint Green, GLuint Blue) void glSecondaryColorbvEXT(GLbyte *Variable) void glSecondaryColorsvEXT(GLshort *Variable) void glSecondaryColorivEXT(GLint *Variable) Chapter 1. OpenGL Subroutines 301 void void void void void glSecondaryColorfvEXT(GLfloat *Variable) glSecondaryColordvEXT(GLdouble *Variable) glSecondaryColorubvEXT(GLubyte *Variable) glSecondaryColorusvEXT(GLushort *Variable) glSecondaryColoruivEXT(GLuint *Variable) Description This extension allows specifying the RGB components of the secondary color used in the Color Sum stage, instead of using the default (0,0,0,0) color. It applies only in RGBA mode and when LIGHTING is disabled. Secondary alpha is always implicitly set to 0.0. After texturing, a fragment has two RGBA colors: a primary color c_pri (which texturing, if enabled, may have modified) and a secondary color c_sec. If color sum is enabled, the components of these two colors are summed to produce a single post-texturing RGBA color c (the A component of the secondary color is always 0). The components of c are then clamped to the range [0,1]. If color sum is disabled, then c_pri is assigned to the post texturing color. Color sum is enabled or disabled using the generic Enable and Disable commands, respectively, with the symbolic constant GL_COLOR_SUM_EXT. Parameters Red,Green,Blue Variable Specify the red, green and blue values of the Secondary color. Specifies a pointer to an array of three values. These are interpreted, respectively, as the red, green and blue values of the Secondary color. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. glSecondaryColorPointerEXT Subroutine Purpose Specifies an array of secondary colors. Library OpenGL C bindings library: (libGL.a) C Syntax void glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) 302 OpenGL 2.1 Reference Manual Description The glSecondaryColorPointerEXT extension specifies the location and data format of an array of secondary color components to use when rendering. The size parameter specifies the number of components per color, and must be 3 or 4. The type parameter specifies the data type of each color component and stride gives the byte stride from one color to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). When a secondary color array is specified, size, type, stride, and pointer are saved as client side state. To enable and disable the secondary color array, call glEnableClientState and glDisableClientState with the argument GL_SECONDARY_COLOR_ARRAY. If enabled, the secondary color array is used when glDrawArrays, glDrawElements or glArrayElement is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Secondary Color array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters size type stride pointer specifies the number of components per color. It must be 3 or 4. The initial value is 4. specifies the data type of each color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. specifies the byte offset between consecutive colors. If stride is zero (the initial value), the colors are understood to be tightly packed in the array. The initial value is 0. specifies a pointer to the first component of the first color element in the array. The initial value is 0 (NULL pointer). Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElement subroutine, the glColorPointer subroutine, the glDrawArrays subroutine, the glDrawElements subroutine, the glEdgeFlagPointer subroutine, the glEnable subroutine, the glGetPointerv subroutine, the glIndexPointer subroutine, the glInterleavedArrays subroutine, the glNormalPointer subroutine, the glPushClientAttrib or glPopClientAttrib subroutine, the glSecondaryColorPointerListIBM subroutine, the glTexCoordPointer subroutine, the glVertexPointer subroutine. Chapter 1. OpenGL Subroutines 303 glSecondaryColorPointerListIBM Subroutine Purpose Defines a list of arrays of secondary colors. Library OpenGL C bindings library: (libGL.a) C Syntax void glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid **pointer, GLint ptrstride) Description The glSecondaryColorPointerListIBM subroutine specifies the location and data format of a list of arrays of color components to use when rendering. The size parameter specifies the number of components per color, and must be 3 or 4. The type parameter specifies the data type of each color component. The stride parameter gives the byte stride from one color to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). The ptrstride parameter specifies the byte stride from one pointer to the next in the pointer array. When a secondary color array is specified, size, type, stride, pointer and ptrstride are saved as client side state. A stride value of 0 does not specify a ″tightly packed″ array as it does in glSecondaryColorPointer. Instead, it causes the first array element of each array to be used for each vertex. Also, a negative value can be used for stride, which allows the user to move through each array in reverse order. To enable and disable the secondary color arrays, call glEnableClientState and glDisableClientState with the argument GL_COLOR_ARRAY. The secondary color array is initially disabled. When enabled, the secondary color arrays are used when glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glDrawArrays, glDrawElements or glArrayElement is called. The last three calls in this list will only use the first array (the one pointed at by pointer[0]). See the descriptions of these routines for more information on their use. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Secondary Color array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters size 304 specifies the number of components per secondary color. This must be 3 or 4. The initial value is 4. OpenGL 2.1 Reference Manual type specifies the data type of each secondary color component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. specifies the byte offset between consecutive secondary colors. The initial value is 0. specifies a list of secondary color arrays. The initial value is 0 (NULL pointer). specifies the byte stride between successive pointers in the pointer array. The initial value is 0. stride pointer ptrstride Notes The glSecondaryColorPointerListIBM subroutine is available only if the GL_IBM_vertex_array_lists extension is supported. Execution of glSecondaryColorPointerListIBM is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glSecondaryColorPointerListIBM subroutine is typically implemented on the client side. Since the secondary color array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When a glSecondaryColorPointerListIBM call is encountered while compiling a display list, the information it contains does NOT contribute to the display list, but is used to update the immediate context instead. The glSecondaryColorPointer call and the glSecondaryColorPointerListIBM call share the same state variables. A glSecondaryColorPointer call will reset the secondary color list state to indicate that there is only one secondary color list, so that any and all lists specified by a previous glSecondaryColorPointerListIBM call will be lost, not just the first list that it specified. Error Codes GL_INVALID_VALUE GL_INVALID_ENUM is generated if size is not 3 or 4. is generated if type is not an accepted value. Associated gets for the glSecondaryColorPointerListIBM subroutine are as follows. (See the glGet subroutine for more information.) glIsEnabled with argument GL_COLOR_ARRAY.. glGetPointerv with argument GL_COLOR_ARRAY_LIST_IBM. glGet with argument GL_COLOR_ARRAY_LIST_STRIDE_IBM. glGet with argument GL_COLOR_ARRAY_SIZE. glGet with argument GL_COLOR_ARRAY_STRIDE. glGet with argument GL_COLOR_ARRAY_TYPE. Chapter 1. OpenGL Subroutines 305 Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElement subroutine, the glColorPointer subroutine, the glDrawArrays subroutine, the glDrawElements subroutine, the glEdgeFlagPointer subroutine, the glEnable subroutine, the glGetPointerv subroutine, the glIndexPointer subroutine, the glInterleavedArrays subroutine, the glMultiDrawArraysEXT subroutine, the glMultiDrawElementsEXT subroutine, the glMultiModeDrawArraysIBM subroutine, the glMultiModeDrawElementsIBM subroutine, the glNormalPointer subroutine, the glPushClientAttrib or glPopClientAttrib subroutine, the glTexCoordPointer subroutine, the glVertexPointer subroutine. glSelectBuffer Subroutine Purpose Establishes a buffer for selection mode values. Library OpenGL C bindings library: libGL.a C Syntax void glSelectBuffer(GLsizei Size, GLuint *Buffer) Parameters Size Buffer Specifies the size of Buffer. Returns the selection data. Description The glSelectBuffer subroutine has two arguments: the Buffer parameter is a pointer to an array of unsigned integers, and the Size parameter indicates the size of the array. Buffer returns values from the name stack when the rendering mode is GL_SELECT. (See the glInitNames subroutine for information on initializing the name stack; the glLoadName subroutine for information on loading names onto the name stack; the glPushName subroutine for pushing and popping the name stack; and the glRenderMode subroutine for information on setting the rasterization mode.) The glSelectBuffer subroutine must be issued before selection mode is enabled, and it must not be issued while the rendering mode is GL_SELECT. Selection is used by a programmer to determine which primitives are drawn into some region of a window. The region is defined by the current modelview and perspective matrices. In selection mode, no pixel fragments are produced from rasterization. Instead, if a primitive intersects the clipping volume defined by the viewing frustum and the user-defined clipping planes, this primitive causes a selection hit. (With polygons, no hit occurs if the polygon is culled.) When a change is made to the name stack, or when the glRenderMode subroutine is called, a hit record is copied to Buffer if any hits have occurred since the last such event (name stack change or glRenderMode call). The hit record consists of 306 OpenGL 2.1 Reference Manual the number of names in the name stack at the time of the event, followed by the minimum and maximum depth values of all vertices that hit since the previous event, followed by the name stack contents, bottom name first. Returned depth values are mapped such that the largest unsigned integer value corresponds to window coordinate depth 1.0, and 0 (zero) corresponds to window coordinate depth 0.0. An internal index into Buffer is reset to 0 whenever selection mode is entered. Each time a hit record is copied into Buffer, the index is incremented to point to the cell just past the end of the block of names, that is, to the next available cell. If the hit record is larger than the number of remaining locations in Buffer, as much data as can fit is copied, and the overflow flag is set. If the name stack is empty when a hit record is copied, that record consists of 0 followed by the minimum and maximum depth values. Selection mode is exited by calling glRenderMode with an argument other than GL_SELECT. Whenever glRenderMode is called while the render mode is GL_SELECT, it returns the number of hit records copied to Buffer, resets the overflow flag and the selection buffer pointer, and initializes the name stack to be empty. If the overflow bit was set when glRenderMode was called, a negative hit record count is returned. Notes The contents of Buffer are undefined until glRenderMode is called with an argument other than GL_SELECT. The glBegin/glEnd subroutine primitives and calls to glRasterPos can result in hits. Errors GL_INVALID_VALUE GL_INVALID_OPERATION GL_INVALID_OPERATION Size is negative. The glSelectBuffer subroutine is called while the render mode is GL_SELECT, or glRenderMode is called with the GL_SELECT argument before glSelectBuffer is called at least once. The glSelectBuffer subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glSelectBuffer subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_NAME_STACK_DEPTH. glGetPointerv with argument GL_SELECTION_BUFFER_POINTER. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glFeedbackBuffer subroutine, glGetPointerv subroutine, glInitNames subroutine, glLoadName subroutine, glPushName subroutine, glRenderMode subroutine. Chapter 1. OpenGL Subroutines 307 glShadeModel Subroutine Purpose Selects flat or smooth shading. Library OpenGL C bindings library: libGL.a C Syntax void glShadeModel(GLenum Mode) Parameters Mode Specifies a symbolic value representing a shading technique. Accepted values are GL_FLAT and GL_SMOOTH. The default is GL_SMOOTH. Description GL primitives can have either flat or smooth shading. Smooth shading, the default, causes the computed colors of vertices to be interpolated as the primitive is rasterized, typically assigning different colors to each resulting pixel fragment. Flat shading selects the computed color of just one vertex and assigns it to all the pixel fragments generated by rasterizing a single primitive. In either case, the computed color of a vertex is the result of lighting, if lighting is enabled, or it is the current color at the time the vertex was specified, if lighting is disabled. Flat and smooth shading are indistinguishable for points. Counting vertices and primitives from 1 (one) starting when the glBegin subroutine is issued, each flat-shaded line segment i is given the computed color of vertex i + 1, its second vertex. Counting similarly from 1, each flat-shaded polygon is given the computed color of the vertex in the following list. This is the last vertex to specify the polygon in all cases except single polygons, where the first vertex specifies the flat-shaded color. Primitive type of polygon i Single polygon (i == 1) Triangle strip Triangle fan Independent triangle Quad strip Independent quad Vertex 1 i+2 i+2 3i 2i+2 4i Flat and smooth shading are specified by glShadeModel with the Mode parameter set to GL_FLAT and GL_SMOOTH, respectively. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Mode is any value other than GL_FLAT or GL_SMOOTH. The glShadeModel subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glShadeModel subroutine are as follows. (See the glGet subroutine for more information.) 308 OpenGL 2.1 Reference Manual glGet with argument GL_SHADE_MODEL. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColor subroutine, glLight subroutine, glLightModel subroutine. glStencilFunc Subroutine Purpose Sets function and reference values for stencil testing. Library OpenGL C bindings library: libGL.a C Syntax void glStencilFunc(GLenum Function, GLint Reference, GLuint Mask) Parameters Function Specifies the test function. Eight tokens are valid: v GL_NEVER v GL_LESS v GL_LEQUAL v GL_GREATER v GL_GEQUAL v GL_EQUAL v GL_NOTEQUAL Reference Mask v GL_ALWAYS Specifies the reference value for the stencil test. Reference is clamped to the range [0,2n-1], where n is the number of bit planes in the stencil buffer. Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done. Description Stenciling, like z-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, and then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the reference value and the value in the stencil buffer. The test is enabled by the glEnable and glDisable subroutines with the GL_STENCIL argument. Actions taken based on the outcome of the stencil test are specified with the glStencilOp subroutine. Chapter 1. OpenGL Subroutines 309 The Function parameter is a symbolic constant that determines the stencil comparison function. It accepts one of the eight following values. The Reference parameter is an integer reference value that is used in the stencil comparison. It is clamped to the range [0,2n-1], where n is the number of bit planes in the stencil buffer. The Mask parameter is bitwise ANDed with both the reference value and the stored stencil value, with the ANDed values participating in the comparison. If stencil represents the value stored in the corresponding stencil buffer location, the following list shows the effect of each comparison function that can be specified by the Function parameter. Only if the comparison succeeds is the pixel passed through to the next stage in the rasterization process. (See the glStencilOp subroutine for information on setting stencil test actions.) All tests treat stencil values as unsigned integers in the range [0,2n-1], where n is the number of bit planes in the stencil buffer. The following values are accepted by the Function parameter: GL_NEVER GL_LESS GL_LEQUAL GL_GREATER GL_GEQUAL GL_EQUAL GL_NOTEQUAL GL_ALWAYS Always fails. Passes if ( Reference Passes if ( Reference Passes if ( Reference Passes if ( Reference Passes if ( Reference Passes if ( Reference Always passes. & & & & & & Mask Mask Mask Mask Mask Mask ) ) ) ) ) ) is is is is is is less than ( stencil & Mask ). less than or equal to ( stencil & Mask ). greater than ( stencil & Mask ). greater than or equal to ( stencil & Mask ). equal to ( stencil & Mask ). not equal to ( stencil & Mask ). Notes Initially, the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil test always passes. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Function is not one of the eight accepted values. The glStencilFunc subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glStencilFunc subroutine are as follows. (See the glGet subroutine.) glGet with argument GL_STENCIL_FUNC glGet with argument GL_STENCIL_VALUE_MASK glGet with argument GL_STENCIL_REF glGet with argument GL_STENCIL_BITS glIsEnabled with argument GL_STENCIL_TEST. Files /usr/include/GL/gl.h 310 OpenGL 2.1 Reference Manual Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glAlphaFunc subroutine, glBegin or glEnd subroutine, glBlendFunc subroutine, glDepthFunc subroutine, glEnable or glDisable subroutine, glLogicOp subroutine, glStencilOp subroutine. glStencilMask Subroutine Purpose Controls the writing of individual bits in the stencil planes. Library OpenGL C bindings library: libGL.a C Syntax void glStencilMask(GLuint Mask) Parameters Mask Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all 1s. Description The glStencilMask subroutine controls the writing of individual bits in the stencil planes. The least significant n bits of the Mask parameter, where n is the number of bits in the stencil buffer, specify a mask. Wherever a 1 (one) appears in the mask, the corresponding bit in the stencil buffer is made writable. Where a 0 (zero) appears, the bit is write-protected. Initially, all bits are enabled for writing. Errors GL_INVALID_OPERATION The glStencilMask subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glStencilMask subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_STENCIL_WRITEMASK glGet with argument GL_STENCIL_BITS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glColorMask subroutine, glDepthMask subroutine, glIndexMask subroutine, glStencilFunc subroutine, glStencilOp subroutine. Chapter 1. OpenGL Subroutines 311 glStencilOp Subroutine Purpose Sets stencil test actions. Library OpenGL C bindings library: libGL.a C Syntax void glStencilOp(GLenum Fail, GLenum zFail, GLenum zPass) Parameters Fail Specifies the action to take when the stencil test fails. Six symbolic constants are accepted: v GL_KEEP v GL_ZERO v GL_REPLACE v GL_INCR v GL_DECR v GL_INCR_WRAP_EXT v GL_DECR_WRAP_EXT v GL_INVERT Specifies stencil action when the stencil test passes but the depth test fails. zFail accepts the same symbolic constants as Fail. Specifies stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled. zPass accepts the same symbolic constants as Fail. zFail zPass Description Stenciling, like z-buffering, enables and disables drawing on a per-pixel basis. You draw into the stencil planes using GL drawing primitives, and then render geometry and images, using the stencil planes to mask out portions of the screen. Stenciling is typically used in multipass rendering algorithms to achieve special effects, such as decals, outlining, and constructive solid geometry rendering. The stencil test conditionally eliminates a pixel based on the outcome of a comparison between the value in the stencil buffer and a reference value. The test is enabled with the glEnable and glDisable subroutine calls with the GL_STENCIL argument, and controlled with the glStencilFunc subroutine. The glStencilOp subroutine takes three arguments that indicate what happens to the stored stencil value while stenciling is enabled. If the stencil test fails, no change is made to the pixel’s color or depth buffers, and the Fail parameter specifies what happens to the stencil buffer contents. The eight possible actions are as follows: GL_KEEP GL_ZERO GL_REPLACE GL_INCR GL_DECR 312 Keeps the current value. Sets the stencil buffer value to 0 (zero). Sets the stencil buffer value to the Reference parameter, as specified by the glStencilFunc subroutine. Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. Decrements the current stencil buffer value. Clamps to 0. OpenGL 2.1 Reference Manual GL_INCR_WRAP_EXT GL_DECR_WRAP_EXT GL_INVERT Increments the current stencil buffer value. A GL_INCR_WRAP_EXT on the maximum representable unsigned value yields a 0 value. Decrements the current stencil buffer value. A GL_DECR_WRAP_EXT on 0 yields the maximum representable unsigned value. Bitwise inverts the current stencil buffer value. Stencil buffer values are treated as unsigned integers. The maximum representable value is 2n-1, where n is the value returned by querying GL_STENCIL_BITS. The other two arguments to glStencilOp specify stencil buffer actions should subsequent depth buffer tests succeed (the zPass parameter) or fail (the zFail parameter). (See the glDepthFunc for information about specifying the function used for depth buffer comparisons.) They are specified using the same eight symbolic constants as the Fail parameter. Note that the zFail parameter is ignored when there is no depth buffer, or when the depth buffer is not enabled. In these cases, the Fail and zPass parameters specify stencil action when the stencil test fails and passes, respectively. Notes Initially the stencil test is disabled. If there is no stencil buffer, no stencil modification can occur and it is as if the stencil tests always pass, regardless of any call to the glStencilOp subroutine. The GL_INCR_WRAP_EXT and GL_DECR_WRAP_EXT stencil actions are only supported if the GL_EXT_stencil_wrap extension is supported. Errors GL_INVALID_ENUM GL_INVALID_OPERATION Fail, zFail, or zPass is any value other than the eight defined constant values. The glStencilOp subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glStencilOp subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_STENCIL_FAIL glGet with argument GL_STENCIL_PASS_DEPTH_PASS glGet with argument GL_STENCIL_PASS_DEPTH_FAIL glGet with argument GL_STENCIL_BITS glIsEnabled with argument GL_STENCIL_TEST. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glAlphaFunc subroutine, glBegin or glEnd subroutine, glBlendFunc subroutine, glDepthFunc subroutine, glEnable or glDisable subroutine, glLogicOp subroutine, glStencilFunc subroutine. Chapter 1. OpenGL Subroutines 313 glTexCoord Subroutine Purpose Sets the current texture coordinates. Library OpenGL C bindings library: libGL.a C Syntax void glTexCoord1d(GLdouble S) void glTexCoord1f(GLfloat void glTexCoord1i(GLint S) S) void glTexCoord1s(GLshort S) void glTexCoord2d(GLdouble GLdouble T) S, void glTexCoord2f(GLfloat GLfloat T) S, void glTexCoord2i(GLint GLint T) S, void glTexCoord2s(GLshort GLshort T) S, void glTexCoord3d(GLdouble GLdouble T, GLdouble R) S, void glTexCoord3f(GLfloat GLfloat T, GLfloat R) void glTexCoord3i(GLint GLint T, GLint R) S, void glTexCoord3s(GLshort GLshort T, GLshort R) void glTexCoord4d(GLdouble GLdouble T, GLdouble R, GLdouble Q) void glTexCoord4f(GLfloat GLfloat T, GLfloat R, GLfloat Q) 314 S, S, S, S, OpenGL 2.1 Reference Manual void glTexCoord4i(GLint GLint T, GLint R, GLint Q) void glTexCoord4s(GLshort GLshort T, GLshort R, GLshort Q) S, S, void glTexCoord1dv(const GLdouble * V) void glTexCoord1fv(const GLfloat * V) void glTexCoord1iv(const GLint * V) void glTexCoord1sv(const GLshort * V) void glTexCoord2dv(const GLdouble * V) void glTexCoord2fv(const GLfloat * V) void glTexCoord2iv(const GLint * V) void glTexCoord2sv(const GLshort * V) void glTexCoord3dv(const GLdouble * V) void glTexCoord3fv(const GLfloat * V) void glTexCoord3iv(const GLint * V) void glTexCoord3sv(const GLshort * V) void glTexCoord4dv(const GLdouble * V) void glTexCoord4fv(const GLfloat * V) void glTexCoord4iv(const GLint * V) void glTexCoord4sv(const GLshort * V) Parameters S, T, R, Q V Specify S, T, R, and A texture coordinates. Not all parameters are present in all forms of the command. Specifies a pointer to an array of one, two, three, or four elements, which in turn specify the S, T, R, and Q texture coordinates. Description The glTexCoord subroutine specifies texture coordinates in one, two, three, or four dimensions. The glTexCoord1 subroutine sets the current texture coordinates to (S,0,0,1); a call to glTexCoord2 sets them to (S,T,0,1). Similarly, glTexCoord3 specifies the texture coordinates as (S,T,R,1), and glTexCoord4 defines all four components explicitly as (S,T,R,Q). Chapter 1. OpenGL Subroutines 315 The current texture coordinates are part of the data that is associated with each vertex and with the current raster position. Initially, the values for S, T, R, and Q are (0, 0, 0, 1). Notes The current texture coordinates can be updated at any time. In particular, the glTexCoord subroutine can be called between a call to glBegin and the corresponding call to glEnd. If the GL_ARB_multitexture extension is present, then there will be multiple texture units present. This call will only affect the current textrue coordinate on Texture Unit 0. Use glMultiTexCoord*ARB to affect texture coordinates on other Texture Units. Associated Gets Associated gets for the glTexCoord subroutine are as follows. (See the glGet subroutine for more information.) glGet with argument GL_CURRENT_TEXTURE_COORDS. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glTexCoordPointer subroutine, glTexCoordPointerEXT subroutine, glVertex subroutine. glTexCoordColorNormalVertexSUN Subroutine Purpose Specifies a texture coordinate, a color, a normal and a vertex in one call. Library OpenGL C bindings library: (libGL.a) C Syntax void glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) void glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) 316 OpenGL 2.1 Reference Manual void glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w) void glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v) Description This subroutine can be used as a replacement for the following calls: glColor(); glNormal(); glVertex(); glTexCoord(); For example: glTexCoord4fColor4fNormal3fVertex4fvSUN replaces the following calls: glTexCoord4f(); glColor4f(); glNormal3f(); glVertex4fv(); The only reason for using this call is that it reduces the use of bus bandwidth. Parameters s, t, p, q tc r, g, b, a c nx, ny, nz n x, y, z, w Specifies the s, t, p, and q components of the texture coordinate for this vertex. Not all parameters are present in all forms of the command. Specifies a pointer to an array of texture coordinate values. The elements of a two-element array are s and t. The elements of a four-element array are s, t, p, and q. Specifies the r, g, b, and a components of the color for this vertex. Specifies a pointer to an array of the four components r, g, b, and a. Specifies the x, y, and z coordinates of the normal vector for this vertex. Specifies a pointer to an array of the three elements nx, ny and nz. Specifies the x, y, z, and w coordinates of a vertex. Not all parameters are present in all forms of the command. Chapter 1. OpenGL Subroutines 317 v Specifies a pointer to an array of vertex coordinates. The elements of a three-element array are x, y, and z. The elements of a four-element array are x, y, z, and w. Notes Calling glTexCoordColorNormalVertexSUN outside of a glBegin/glEnd subroutine pair results in undefined behavior. This subroutine is only valid if the GL_SUN_vertex extension is defined. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, the glColor subroutine, the glNormal subroutine, the glTexCoord subroutine, the glVertex subroutine. glTexCoordColorVertexSUN Subroutine Purpose Specifies a texture coordinate, a color, and a vertex in one call. Library OpenGL C bindings library: (libGL.a) C Syntax extern void glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z) extern void glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v) extern void glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z) extern void glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v) 318 OpenGL 2.1 Reference Manual Description This subroutine can be used as a replacement for the following calls: glColor(); glVertex(); glTexCoord(); For example, glTexCoord2fColor3fVertex3fvSUN replaces the following calls: glTexCoord2f(); glColor3f(); glVertex3fv(); The only reason for using this call is that it reduces the use of bus bandwidth. Parameters s, t tc r, g, b, a c x, y, z v Specifies the s and t components of the texture coordinate for this vertex. Specifies a pointer to an array of texture coordinate values. The elements of a two-element array are s and t. The elements of a four-element array are s, t, p, and q. Specifies the red, green, blue, and alpha components of a color. Not all parameters are present in all forms of the command. Specifies a pointer to an array of three or four elements. The elements of a three-element array are r, g, and b. The elements of a four-element array are r, g, b, and a. Specifies the x, y, and z coordinates of a vertex. Specifies a pointer to an array of the three elements x, y, and z. Notes Calling glTexCoordColorVertexSUN outside of a glBegin/glEnd subroutine pair results in undefined behavior. This subroutine is only valid if the GL_SUN_vertex extension is defined. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, the glColor subroutine, the glNormal subroutine, the glTexCoord subroutine, the glVertex subroutine. glTexCoordNormalVertexSUN Subroutine Purpose Specifies a texture coordinate, a normal and a vertex in one call. Library OpenGL C bindings library: (libGL.a) Chapter 1. OpenGL Subroutines 319 C Syntax void glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z) void glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v) Description This subroutine can be used as a replacement for the following calls: glTexCoord(); glNormal(); glVertex(); For example, glTexCoord2fNormal3fVertex3fvSUN replaces the following calls: glTexCoord2f(); glNormal3f(); glVertex3fv(); The only reason for using this call is that it reduces the use of bus bandwidth. Parameters s, t tc x, y, z v nx, ny, nz n Specifies Specifies Specifies Specifies Specifies Specifies the texture coordinate s and t values. a pointer to an array of the two texture coordinate values s and t. the x, y, and z coordinates of a vertex. a pointer to an array of the three elements x, y, and z. the x, y, and z coordinates of the normal vector for this vertex. a pointer to an array of the three elements nx, ny and nz. Notes Calling glTexCoordNormalVertexSUN outside of a glBegin/glEnd subroutine pair results in undefined behavior. This subroutine is only valid if the GL_SUN_vertex extension is defined. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, the glColor subroutine, the glNormal subroutine, the glTexCoord subroutine, the glVertex subroutine. 320 OpenGL 2.1 Reference Manual glTexCoordPointer Subroutine Purpose Defines an array of texture coordinates. Library OpenGL C bindings library: libGL.a C Syntax void glTexCoordPointer( GLint GLenum type, GLsizei stride, const GLvoid * pointer) size, Description The glTexCoordPointer subroutine specifies the location and data format of an array of texture coordinates to use when rendering. The size parameter specifies the number of coordinates per element, and must be 1, 2, 3, or 4. The type parameter specifies the data type of each texture coordinate and stride gives the byte stride from one array element to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single array storage may be more efficient on some implementations; see glInterleavedArrays). When a texture coordinate array is specified, size, type, stride, and pointer are saved client side state. To enable and disable the texture coordinate array, call glEnableClientState and glDisableClientState with the argument GL_TEXTURE_COORD_ARRAY. If enabled, the texture coordinate array is used when glDrawArrays, glDrawElements or glArrayElement is called. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Tex Coord array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters size type stride pointer Specifies the number of coordinates per array element. Must be 1, 2, 3 or 4. The initial value is 4. Specifies the data type of each texture coordinate. Symbolic constants GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. Specifies the byte offset between consecutive array elements. If stride is 0, the array elements are understood to be tightly packed. The initial value is 0. Specifies a pointer to the first coordinate of the first element in the array. The initial value is 0 (NULL pointer). Notes The glTexCoordPointer subroutine is available only if the GL version is 1.1 or greater. The texture coordinate array is initially disabled and it won’t be accessed when glArrayElement, glDrawElements or glDrawArrays is called. Chapter 1. OpenGL Subroutines 321 Execution of glTexCoordPointer is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glTexCoordPointer subroutine is typically implemented on the client side with no protocol. Since the texture coordinate array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. The glTexCoordPointer subroutine is not included in display lists. Errors v GL_INVALID_VALUE is generated if size is not 1, 2, 3, or 4. v GL_INVALID_ENUM is generated if type is not an accepted value. v GL_INVALID_VALUE is generated if stride is negative. Associated Gets v glIsEnabled with argument GL_TEXTURE_COORD_ARRAY v glGet with argument GL_TEXTURE_COORD_ARRAY_SIZE v glGet with argument GL_TEXTURE_COORD_ARRAY_TYPE v glGetPointerv with argument GL_TEXTURE_COORD_ARRAY_POINTER Related Information The glArrayElement subroutine, glClientActiveTextureARB subroutine, glColorPointer subroutine, glDrawArrays subroutine, glDrawElements subroutine, glDrawRangeElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoord subroutine, glTexCoordPointerListIBM subroutine, glVertexPointer subroutine. glTexCoordPointerEXT Subroutine Purpose Defines an array of texture coordinates. Library OpenGL C bindings library: libGL.a C Syntax void glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer) Parameters size type stride count 322 Specifies the number of coordinates per array element. It must be 1, 2, 3 or 4. Specifies the data type of each texture coordinate. Symbolic constants GL_SHORT, GL_INT, GL_FLOAT, or GL_DOUBLE_EXT, are accepted. Specifies the byte offset between consecutive array elements. If stride is zero the array elements are understood to be tightly packed. Specifies the number of array elements, counting from the first, that are static. OpenGL 2.1 Reference Manual pointer Specifies a pointer to the first coordinate of the first element in the array. Description glTexCoordPointerEXT specifies the location and data format of an array of texture coordinates to use when rendering. size specifies the number of coordinates per element, and must be 1, 2, 3, or 4. type specifies the data type of each texture coordinate and stride gives the byte stride from one array element to the next allowing vertexes and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations.) count indicates the number of array elements (counting from the first) that are static. Static elements may be modified by the application, but once they are modified, the application must explicitly respecify the array before using it for any rendering. When a texture coordinate array is specified, size, type, stride, count, and pointer are saved as client-side state, and static array elements may be cached by the implementation. The texture coordinate array is enabled and disabled using glEnable and glDisable with the argument GL_TEXTURE_COORD_ARRAY_EXT. If enabled, the texture coordinate array is used when glDrawArraysEXT or glArrayElementEXT is called. Notes Non-static array elements are not accessed until glArrayElementEXT or glDrawArraysEXT is executed. By default the texture coordinate array is disabled and it won’t be accessed when glArrayElementEXT or glDrawArraysEXT is called. Although, it is not an error to call glTexCoordPointerEXT between the execution of glBegin and the corresponding execution of glEnd, the results are undefined. glTexCoordPointerEXT will typically be implemented on the client side with no protocol. Since the texture coordinate array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. glTexCoordPointerEXT commands are not entered into display lists. glTexCoordPointerEXT is part of the _extname(EXT_vertex_array) extension, not part of the core GL command set. If _extstring(EXT_vertex_array) is included in the string returned by glGetString, when called with argument GL_EXTENSIONS, extension _extname(EXT_vertex_array) is supported. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Tex Coord array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Errors GL_INVALID_VALUE is generated if size is not 1, 2, 3, or 4. GL_INVALID_ENUM is generated if type is not an accepted value. GL_INVALID_VALUE is generated if stride or count is negative Chapter 1. OpenGL Subroutines 323 Associated Gets glIsEnabled with argument GL_TEXTURE_COORD_ARRAY_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_SIZE_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_TYPE_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_STRIDE_EXT glGet with argument GL_TEXTURE_COORD_ARRAY_COUNT_EXT glGetPointervEXT with argument GL_TEXTURE_COORD_ARRAY_POINTER_EXT File /usr/include/GL/glext.h Contains extensions to C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glArrayElementEXT subroutine, glColorPointerEXT subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glGetPointervEXT subroutine, glIndexPointerEXT subroutine, glNormalPointerEXT subroutine, glVertexPointerEXT subroutine. glTexCoordPointerListIBM Subroutine Purpose Defines a list of texture coordinate arrays. Library OpenGL C bindings library: libGL.a C Syntax void glTexCoordPointerListIBM(GLint GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride) size, Description The glTexCoordPointerListIBM subroutine specifies the location and data format of a list of arrays of texture coordinate components to use when rendering. The size parameter specifies the number of components per texture coordinate, and must be 1, 2, 3 or 4. The type parameter specifies the data type of each texture coordinate component. The stride parameter gives the byte stride from one texture coordinate to the next allowing vertices and attributes to be packed into a single array or stored in separate arrays. (Single-array storage may be more efficient on some implementations; see glInterleavedArrays). The ptrstride parameter specifies the byte stride from one pointer to the next in the pointer array. When a texture coordinate array is specified, size, type, stride, pointer and ptrstride are saved as client side state. 324 OpenGL 2.1 Reference Manual A stride value of 0 does not specify a “tightly packed” array as it does in glTexCoordPointer. Instead, it causes the first array element of each array to be used for each vertex. Also, a negative value can be used for stride, which allows the user to move through each array in reverse order. To enable and disable the texture coordinate arrays, call glEnableClientState and glDisableClientState with the argument GL_TEXTURE_COORD_ARRAY. The texture coordinate array is initially disabled. When enabled, the texture coordinate arrays are used when glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, glDrawArrays, glDrawElements or glArrayElement is called. The last three calls in this list will only use the first array (the one pointed at by pointer[0]). See the descriptions of these routines for more information on their use. Use glDrawArrays, glMultiDrawArraysEXT, or glMultiModeDrawArraysIBM to construct a sequence of primitives from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes. Use glDrawElements, glMultiDrawElementsEXT, glMultiModeDrawElementsIBM, or glDrawRangeElements to construct a sequence of primitives by indexing vertices and vertex attributes. If enabled, the Tex Coord array is used when glDrawArrays, glDrawElements, glArrayElements, glMultiDrawArraysEXT, glMultiDrawElementsEXT, glMultiModeDrawArraysIBM, glMultiModeDrawElementsIBM, or glDrawRangeElements is called. Parameters size type stride pointer ptrstride Specifies the number of components per texture coordinate. It must be 1, 2, 3 or 4. The initial value is 4. Specifies the data type of each texture coordinate component in the array. Symbolic constants GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_INT, GL_UNSIGNED_INT, GL_FLOAT, or GL_DOUBLE are accepted. The initial value is GL_FLOAT. Specifies the byte offset between consecutive texture coordinates. The initial value is 0. Specifies a list of texture coordinate arrays. The initial value is 0 (NULL pointer). Specifies the byte stride between successive pointers in the pointer array. The initial value is 0. Notes The glTexCoordPointerListIBM subroutine is available only if the GL_IBM_vertex_array_lists extension is supported. Execution of glTexCoordPointerListIBM is not allowed between glBegin and the corresponding glEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. The glTexCoordPointerListIBM subroutine is typically implemented on the client side. Since the texture coordinate array parameters are client side state, they are not saved or restored by glPushAttrib and glPopAttrib. Use glPushClientAttrib and glPopClientAttrib instead. When a glTexCoordPointerListIBM call is encountered while compiling a display list, the information it contains does NOT contribute to the display list, but is used to update the immediate context instead. The glTexCoordPointer call and the glTexCoordPointerListIBM call share the same state variables. A glTexCoordPointer call will reset the texture coordinate list state to indicate that there is only one texture coordinate list, so that any and all lists specified by a previous glTexCoordPointerListIBM call will be lost, not just the first list that it specified. Chapter 1. OpenGL Subroutines 325 Error Codes v GL_INVALID_VALUE is generated if size is not 1, 2, 3 or 4. v GL_INVALID_ENUM is generated if type is not an accepted value. Associated Gets v v v v glIsEnabled with argument GL_TEXTURE_COORD_ARRAY glGetPointerv with argument GL_TEXTURE_COORD_ARRAY_LIST_IBM glGet with argument GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM glGet with argument GL_TEXTURE_COORD_ARRAY_SIZE v glGet with argument GL_TEXTURE_COORD_ARRAY_STRIDE v glGet with argument GL_TEXTURE_COORD_ARRAY_TYPE Related Information The glArrayElement subroutine, glClientActiveTextureARB subroutine, glDrawArrays subroutine, glDrawElements subroutine, glDrawRangeElements subroutine, glEdgeFlagPointer subroutine, glEnable subroutine, glGetPointerv subroutine, glIndexPointer subroutine, glInterleavedArrays subroutine, glMultiDrawArraysEXT subroutine, glMultiDrawElementsEXT subroutine, glMultiModeDrawArraysIBM subroutine, glMultiModeDrawElementsIBM subroutine, glNormalPointer subroutine, glPopClientAttrib subroutine, glPushClientAttrib subroutine, glTexCoordPointer subroutine, glVertexPointer subroutine. glTexCoordVertexSUN Subroutine Purpose Specifies a texture coordinate and a vertex in one call. Library OpenGL C bindings library: (libGL.a) C Syntax void glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z) void glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v) void glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w) void glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v) Description This subroutine can be used as a replacement for the following calls: 326 OpenGL 2.1 Reference Manual glVertex(); glTexCoord(); For example, glTexCoord4fVertex4fvSUN replaces the following calls: glTexCoord4f(); glVertex4fv(); The only reason for using this call is that it reduces the use of bus bandwidth. Parameters s, t, p, q tc x, y, z, w v Specifies the s, t, p, and q components of the texture coordinate for this vertex. Not all parameters are present in all forms of the command. Specifies a pointer to an array of texture coordinate values. The elements of a two-element array are s and t. The elements of a four-element array are s, t, p, and q. Specifies the x, y, z, and w coordinates of a vertex. Not all parameters are present in all forms of the command. Specifies a pointer to an array of vertex coordinates. The elements of a three-element array are x, y, and z. The elements of a four-element array are x, y, z, and w. Notes Calling glTexCoordVertexSUN outside of a glBegin/glEnd subroutine pair results in undefined behavior. This subroutine is only valid if the GL_SUN_vertex extension is defined. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, the glColor subroutine, the glNormal subroutine, the glTexCoord subroutine, the glVertex subroutine. glTexEnv Subroutine Purpose Sets texture environment parameters. Library OpenGL C bindings library: libGL.a C Syntax void glTexEnvf(GLenum Target, GLenum pName, GLfloat Parameter) Chapter 1. OpenGL Subroutines 327 void glTexEnvi(GLenum GLenum pName, GLint Parameter) Target, void glTexEnvfv(GLenum Target, GLenum pName, const GLfloat * Parameters) void glTexEnviv(GLenum Target, GLenum pName, const GLint * Parameters) Parameters glTexEnvf or glTexEnvi Target Specifies a texture environment. Must be GL_TEXTURE_ENV. Specifies the symbolic name of a single-valued texture environment parameter. Accepted values are: pName v GL_TEXTURE_ENV_MODE v GL_COMBINE_RGB_EXT v GL_COMBINE_ALPHA_EXT v GL_SOURCE0_RGB_EXT v GL_SOURCE1_RGB_EXT v GL_SOURCE2_RGB_EXT v GL_SOURCE0_ALPHA_EXT v GL_SOURCE1_ALPHA_EXT v GL_SOURCE2_ALPHA_EXT v GL_OPERAND0_RGB_EXT v GL_OPERAND1_RGB_EXT v GL_OPERAND2_RGB_EXT v GL_OPERAND0_ALPHA_EXT v GL_OPERAND1_ALPHA_EXT v GL_OPERAND2_ALPHA_EXT v GL_RGB_SCALE_EXT, or v GL_ALPHA_SCALE Specifies a single symbolic constant, one of GL_MODULATE, GL_DECAL, GL_BLEND, GL_COMBINE_EXT, GL_ADD, GL_REPLACE, GL_ADD_SIGNED_EXT or GL_INTERPOLATE_EXT. Parameter glTexEnvfv or glTexEnviv Target 328 Specifies a texture environment. Must be GL_TEXTURE_ENV. OpenGL 2.1 Reference Manual pName Specifies the symbolic name of a texture environment parameter. Accepted values are: v GL_TEXTURE_ENV_MODE v GL_TEXTURE_ENV_COLOR v GL_COMBINE_RGB_EXT v GL_COMBINE_ALPHA_EXT v GL_SOURCE0_RGB_EXT v GL_SOURCE1_RGB_EXT v GL_SOURCE2_RGB_EXT v GL_SOURCE0_ALPHA_EXT v GL_SOURCE1_ALPHA_EXT v GL_SOURCE2_ALPHA_EXT v GL_OPERAND0_RGB_EXT v GL_OPERAND1_RGB_EXT v GL_OPERAND2_RGB_EXT v GL_OPERAND0_ALPHA_EXT v GL_OPERAND1_ALPHA_EXT v GL_OPERAND2_ALPHA_EXT v GL_RGB_SCALE_EXT Parameters v GL_ALPHA_SCALE Specifies a pointer to an array of parameters: either a single symbolic constant or an RGBA color. Description A texture environment specifies how texture values are interpreted when a fragment is textured. If the pName parameter is GL_TEXTURE_ENV_MODE, the Parameter(s) parameter is (or points to) the symbolic name of a texture function. Six texture functions are defined: GL_MODULATE, GL_DECAL, GL_BLEND, GL_REPLACE, GL_ADD or GL_COMBINE. GL_TEXTURE_ENV_MODE defaults to GL_MODULATE If the pName parameter is GL_TEXTURE_ENV_COLOR, the Parameters parameter is a pointer to an array that holds an RGBA color consisting of four values. Integer color components are interpreted linearly such that the most positive integer maps to 1.0, and the most negative integer maps to -1.0. The values are clamped to the range [0,1] when they are specified. Cc (see tables below) takes these four values. GL_TEXTURE_ENV_COLOR defaults to (0,0,0,0). If the pName parameter is GL_COMBINE_RGB_EXT or GL_COMBINE_ALPHA_EXT, the Parameter(s) parameter is (or points to) the symbolic name of a texture function. Five texture functions are defined: GL_MODULATE, GL_REPLACE, GL_ADD, GL_ADD_SIGNED_EXT or GL_INTERPOLATE_EXT. The default value for these pNames is GL_MODULATE. If the pName parameter is GL_SOURCE0_RGB_EXT, GL_SOURCE1_RGB_EXT, GL_SOURCE2_RGB_EXT, GL_SOURCE0_ALPHA_EXT, GL_SOURCE1_ALPHA_EXT, or GL_SOURCE2_ALPHA_EXT, the Parameter(s) parameter is (or points to) the symbolic name of a texture operator. Four texture operators are defined: GL_TEXTURE, GL_CONSTANT_EXT, GL_PRIMARY_COLOR_EXT, or GL_PREVIOUS_EXT. The default value for these pNames are shown in the following table: Parameter Default value GL_SOURCE0_RGB_EXT GL_TEXTURE GL_SOURCE1_RGB_EXT GL_PREVIOUS_EXT Chapter 1. OpenGL Subroutines 329 GL_SOURCE2_RGB_EXT GL_CONSTANT_EXT GL_SOURCE0_ALPHA_EXT GL_TEXTURE GL_SOURCE1_ALPHA_EXT GL_PREVIOUS_EXT GL_SOURCE2_ALPHA_EXT GL_CONSTANT_EXT If the pName parameter is GL_OPERAND0_RGB_EXT, or GL_OPERAND1_RGB_EXT, the Parameter(s) parameter is (or points to) the symbolic name of a texture operand. Four texture operands are defined: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, or GL_ONE_MINUS_SRC_ALPHA. The default value for these pNames is GL_SRC_COLOR. If the pName parameter is GL_OPERAND0_ALPHA_EXT, or GL_OPERAND1_ALPHA_EXT, the Parameter(s) parameter is (or points to) the symbolic name of a texture operand. Two texture operands are defined: GL_SRC_ALPHA, or GL_ONE_MINUS_SRC_ALPHA. The default value for these pNames is GL_SRC_ALPHA. If the pName parameter is GL_OPERAND2_RGB_EXT, or GL_OPERAND2_ALPHA_EXT, the Parameter(s) parameter is (or points to) the symbolic name of a texture operand. One texture operand is defined: GL_SRC_ALPHA. If the pName parameter is GL_RGB_SCALE_EXT, or GL_ALPHA_SCALE, the Parameter(s) parameter is (or points to) a floating-point scale factor. Only three such scale factors are valid: 1.0, 2.0, and 4.0. The default value is 1.0. A texture function acts on the fragment to be textured using the texture image value that applies to the fragment and produces a red, green, blue, alpha (RGBA) color for that fragment. (See the glTexParameter subroutine for details on setting texture parameters.) A texture image can have up to four components per texture element. (See the glTexImage1D subroutine, the glTexImage2D subroutine, and the glTexImage3DEXT subroutine.) In a one-component image, Lt indicates that single component. A two-component image uses Lt and At. A three-component image has only a color value, Ct. A four-component image has both a color value, Ct, and an alpha value, At. The following table shows how the RGBA color is produced when the GL_TEXTURE_ENV_MODE is NOT GL_COMBINE_EXT. C is a triple of color values (RGB) and A is the associated alpha value. RGBA values extracted from a texture image are in the range [0,1]. The subscript f refers to the incoming fragment, the subscript t to the texture image, the subscript c to the texture environment color, and subscript v indicates a value produced by the texture function. Note: In the following table, ″It″ equals the texture intensity. Texture Functions Internal Formats GL_ DECAL GL_ BLEND GL_ REPLACE GL_ ADD GL_ LUMINANCE Cv=LtCf Av=Af or 1 undefined Cv=(1<I>Lt) Cf+LtCc Av=Af Cv=Lt Av=Af Cv=Cf+Lt Av=Af GL_ LUMINANCE_ ALPHA or 2 Cv=LtCf Av=AtAf undefined Cv=(1Lt) Cf+LtCc Av=AtAf Cv=Lt Av=At Cv=Cf+Lt Av=AfAt GL_ RGB or 3 Cv=CtCf Av=Af Cv=Ct Av=Af Cv=(1Ct) Cf+CtCc Av=Af Cv=Ct Av=Af Cv=Cf+Ct Av=Af 330 GL_ MODULATE OpenGL 2.1 Reference Manual GL_ RGBA or 4 Cv=CtCf Av=AtAf Cv=(1At) Cf+AtCt Av=Af Cv=(1Ct) Cf+CtCc Av=AtAf Cv=Ct Av=At Cv=Cf+Ct Av=AfAt GL_ INTENSITY Cv=ItCf Av=ItAf undefined Cv=(1-It) Cf+ItCc Av=(1-It) Af+ItAc Cv=It Av=It Cv=Cf+It Av=Af+It GL_ ALPHA Cv=Cf Av=AtAf undefined Cv=Cf Av=AtAf Cv=Cf Av=At Cv=Cf Av=AfAt If the value of GL_TEXTURE_ENV_MODE is GL_COMBINE_EXT, the form of the texture function depends on the values of GL_COMBINE_RGB_EXT and GL_COMBINE_ALPHA_EXT, according to the following table: Combine Function Texture Function GL_REPLACE Arg0 GL_MODULATE Arg0 * Arg1 GL_ADD Arg0 + Arg1 GL_ADD_SIGNED_EXT Arg0 + Arg1 - 0.5 GL_INTERPOLATE_EXT Arg0 * (Arg2) + Arg1 * (1-Arg2) The RGB and ALPHA results of the texture function are then multiplied by the values of GL_RGB_SCALE_EXT and GL_ALPHA_SCALE, respectively. The results are clamped to [0,1]. The arguments Arg0, Arg1 and Arg2 are determined by the values of GL_SOURCE(n)_RGB_EXT, GL_SOURCE(n)_ALPHA_EXT, GL_OPERAND(n)_RGB_EXT and GL_OPERAND(n)_ALPHA_EXT. In the following two tables, Ct and At are the filtered texture RGB and alpha values; Cc and Ac are the texture environment RGB and alpha values; Cf and Af are the RGB and alpha of the primary color of the incoming fragment; and Cp and Ap are the RGB and alpha values resulting from the previous texture environment. On texture unit 0, Cp and Ap are identical to Cf and Af, respectively. The relationship is described in the following two tables: GL_ SOURCE(n)_ RGB_ EXT GL_ SRC_ COLOR GL_ ONE_ MINUS_ SRC_ COLOR GL_ SRC_ ALPHA GL_ ONE_ MINUS_ SRC_ ALPHA GL_ TEXTURE Ct (1-Ct) At (1-At) GL_ CONSTANT_ EXT Cc (1-Cc) Ac (1-Ac) GL_ PRIMARY_ COLOR_ EXT Cf (1-Cf) Af (1-Af) GL_ PREVIOUS_ EXT Cp (1-Cp) Ap (1-Ap) GL_SOURCE(n)_ALPHA_EXT GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_TEXTURE At (1-At) GL_CONSTANT_EXT Ac (1-Ac) GL_PRIMARY_COLOR_EXT Af (1-Af) GL_PREVIOUS_EXT Ap (1-Ap) The mapping of texture components to source components is summarized in the following table, where At, Lt, It, Rt, Gt and Bt are the filtered texel values. Chapter 1. OpenGL Subroutines 331 Base Internal Format> RGB Values Alpha Value GL_ALPHA 0, 0, 0 At GL_LUMINANCE Lt, Lt, Lt 1 GL_LUMINANCE_ALPHA Lt, Lt, Lt At GL_INTENSITY It, It, It It GL_RGB Rt, Gt, Bt 1 GL_RGBA Rt, Gt, Bt At Notes GL_ADD is only valid if the GL_EXT_texture_env_add extension is present. GL_COMBINE_EXT, GL_ADD_SIGNED_EXT, GL_INTERPOLATE_EXT, GL_COMBINE_RGB_EXT, GL_COMBINE_ALPHA_EXT,GL_SOURCEn_RGB_EXT, GL_SOURCEn_ALPHA_EXT, GL_OPERANDn_RGB_EXT, GL_OPERANDn_ALPHA_EXT, GL_RGB_SCALE_EXT, and GL_ALPHA_SCALE are only valid if the GL_EXT_texture_env_combine extension is present. Error Codes GL_INVALID_ENUM INVALID_ENUM INVALID_ENUM INVALID_ENUM INVALID_ENUM INVALID_ENUM INVALID_VALUE GL_INVALID_OPERATION Target or pName is not one of the accepted defined values, or Parameters should have a defined constant value (based on the value of pName) and does not. The Parameter(s) value for GL_COMBINE_RGB_EXT or GL_COMBINE_ALPHA_EXT is not one of GL_REPLACE, GL_MODULATE, GL_ADD, GL_ADD_SIGNED_EXT, or GL_INTERPOLATE_EXT. The Parameter(s) value for GL_SOURCE0_RGB_EXT, GL_SOURCE1_RGB_EXT, GL_SOURCE2_RGB_EXT, GL_SOURCE0_ALPHA_EXT, GL_SOURCE1_ALPHA_EXT or GL_SOURCE2_ALPHA_EXT is not one of GL_TEXTURE, GL_CONSTANT_EXT, GL_PRIMARY_COLOR_EXT or GL_PREVIOUS_EXT. The Parameter(s) value for GL_OPERAND0_RGB_EXT or GL_OPERAND1_RGB_EXT is not one of GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA or GL_ONE_MINUS_SRC_ALPHA. The Parameter(s) value for GL_OPERAND0_ALPHA_EXT or GL_OPERAND1_ALPHA_EXT is not one of GL_SRC_ALPHA or GL_ONE_MINUS_SRC_ALPHA. The Parameter(s) value for GL_OPERAND2_RGB_EXT or GL_OPERAND2_ALPHA_EXT is not GL_SRC_ALPHA. The Parameter(s) value for RGB_SCALE_EXT or ALPHA_SCALE is not one of 1.0, 2.0, or 4.0. The glTexEnv subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glTexEnv subroutine are as follows. (See the glGet subroutine for more information.) glGetTexEnv. 332 OpenGL 2.1 Reference Manual Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glGetTexEnv subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexParameter subroutine. glTexGen Subroutine Purpose Controls the generation of texture coordinates. Library OpenGL C bindings library: libGL.a C Syntax void glTexGend(GLenum Coordinate, GLenum pName, GLdouble Parameter) void glTexGenf(GLenum Coordinate, GLenum pName, GLfloat Parameter) void glTexGeni(GLenum Coordinate, GLenum pName, GLint Parameter) void glTexGendv(GLenum Coordinate, GLenum pName, const GLdouble * Parameters) void glTexGenfv(GLenum Coordinate, GLenum pName, const GLfloat * Parameters) void glTexGeniv(GLenum Coordinate, GLenum pName, const GLint * Parameters) Parameters glTexGend, glTexGenf or glTexGeni Coordinate Specifies a texture coordinate. Must be one of the following: v GL_S v GL_T v GL_R v GL_Q Chapter 1. OpenGL Subroutines 333 pName Parameter Specifies the symbolic name of the texture-coordinate generation function. Must be GL_TEXTURE_GEN_MODE. Specifies a single-valued texture generation parameter, one of GL_OBJECT_LINEAR, GL_EYE_LINEAR, or GL_SPHERE_MAP. glTexGendv, glTexGenfv or glTexGeniv Coordinate Specifies a texture coordinate. Must be one of the following: v GL_S v GL_T v GL_R pName Parameters v GL_Q Specifies the symbolic name of the texture-coordinate generation function or function parameters. Must be GL_TEXTURE_GEN_MODE, GL_OBJECT_PLANE, or GL_EYE_PLANE. Specifies a pointer to an array of texture generation parameters. If pName is GL_TEXTURE_GEN_MODE, the array must contain a single symbolic constant, one of GL_OBJECT_LINEAR, GL_EYE_LINEAR, or GL_SPHERE_MAP. Otherwise, Parameters holds the coefficients for the texture-coordinate generation function specified by pName. Description The glTexGen subroutine selects a texture-coordinate generation function or supplies coefficients for one of the functions. The Coordinate parameter names one of the (s, t, r, q) texture coordinates, and it must be one of these symbols: GL_S, GL_T, GL_R, or GL_Q. The pName parameter must be one of three symbolic constants: GL_TEXTURE_GEN_MODE, GL_OBJECT_PLANE, or GL_EYE_PLANE. If pName is GL_TEXTURE_GEN_MODE, the Parameters parameter chooses a mode, one of GL_OBJECT_LINEAR, GL_EYE_LINEAR, or GL_SPHERE_MAP. If pName is either GL_OBJECT_PLANE or GL_EYE_PLANE, the Parameters parameter contains coefficients for the corresponding texture generation function. If the texture generation function is GL_OBJECT_LINEAR, the following function is used: g=p1 x0 +p2 y0 +p3 z0 +p4 w0 Figure 23. GL_OBJECT_LINEAR Function. This figure shows that g is equal to p subscript one x subscript zero + p subscript two y subscript zero + p subscript three z subscript zero + p subscript four w subscript zero. where g is the value computed for the coordinate named in the Coordinate parameter, p1, p2, p3, and p4 are the four values supplied in the Parameters parameter, and x0, y0, z0, w0 are the object coordinates of the vertex. This function can be used to texture-map terrain using sea level as a reference plane (defined by p1, p2, p3, and p4). The altitude of a terrain vertex is computed by the GL_OBJECT_LINEAR coordinate generation function as its distance from sea level; that altitude is used to index the texture image to map white snow onto peaks and green grass onto foothills, for example. If the texture generation function is GL_EYE_LINEAR, the following function is used: 334 OpenGL 2.1 Reference Manual g=p1′xe +p2′ye +p3′ze +p4′we Figure 24. GL_EYE_LINEAR Function. This figure shows that g is equal to p subscript one′ x subscript e + p subscript two′ y subscript e + p subscript three′ z subscript e + p subscript four′ w subscript e. where: (p1′ p2′ p3′ p4′)=(p1 p2 p3 p4 )M –1 Figure 25. GL_EYE_LINEAR Function Definition. This figure shows that (p subscript one′ p subscript two′ p subscript three′ p subscript four′) equals (p subscript one p subscript two p subscript three p subscript four)M to the power of -1. and xe, ye, ze, and we are the eye coordinates of the vertex, p1, p2, p3, p4 are the values supplied in Parameters, and M is the modelview matrix when glTexGen is invoked. If M is poorly conditioned or singular, texture coordinates generated by the resulting function may be inaccurate or undefined. Note that the values in the Parameters parameter define a reference plane in eye coordinates. The modelview matrix that is applied to them may not be the same one in effect when the polygon vertices are transformed. This function establishes a field of texture coordinates that can produce dynamic contour lines on moving objects. If the pName parameter is GL_SPHERE_MAP and the Coordinate parameter is either GL_R or GL_Q, s and t texture coordinates are generated as follows. Let u be the unit vector pointing from the origin to the polygon vertex (in eye coordinates). Let n’ be the current normal, after transformation to eye coordinates. Let f=(fx fy fz)T be the reflection vector such that f=u-2n'n'Tu Finally, let m=2(square root (fx2+fy2+(fz+1)2)). Then the values assigned to the s and t texture coordinates are the following: s= fx +1/2 m t= fy +1/2 m Figure 26. s and t Values. This figure shows two equations, one for each texture coordinate. The first equation shows that texture coordinate s is equal to f subscript x / m + 1/2. The second equation shows that texture coordinate t is equal to f subscript y / m + 1/2. A texture-coordinate generation function is enabled or disabled using the glEnable or glDisable subroutines with one of the symbolic texture-coordinate names (GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, or GL_TEXTURE_GEN_Q) as the argument. When enabled, the specified texture coordinate is computed according to the generating function associated with that coordinate. When disabled, subsequent vertices take the specified texture coordinate from the current Chapter 1. OpenGL Subroutines 335 set of texture coordinates. Initially, all texture generation functions are set to GL_EYE_LINEAR and are disabled. Both s plane equations are (1,0,0,0), both t plane equations are (0,1,0,0), and all r and q plane equations are (0,0,0,0). Error Codes GL_INVALID_ENUM GL_INVALID_ENUM GL_INVALID_OPERATION Coordinate or pName is not an accepted defined value, or pName is GL_TEXTURE_GEN_MODE and Parameters is not an accepted defined value. pName is GL_TEXTURE_GEN_MODE, Parameters is GL_SPHERE_MAP, and Coordinate is either GL_R or GL_Q. The glTexGen subroutine is called between a call to glBegin and the corresponding call to glEnd. Associated Gets Associated gets for the glTexGen subroutine are as follows. (See the glGet subroutine for more information.) glGetTexGen glIsEnabled with argument GL_TEXTURE_GEN_S glIsEnabled with argument GL_TEXTURE_GEN_T glIsEnabled with argument GL_TEXTURE_GEN_R glIsEnabled with argument GL_TEXTURE_GEN_Q. Files /usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. Related Information The glBegin or glEnd subroutine, glEnable or glDisable subroutine, glGetTexGen subroutine, glTexEnv subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine, glTexParameter subroutine. glTexImage1D Subroutine Purpose Specifies a one-dimensional (1D) texture image. Library OpenGL C bindings library: libGL.a C Syntax void glTexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, 336 OpenGL 2.1 Reference Manual GLint border, GLenum format, GLenum type, const GLvoid * pixels) Parameters target level internalformat width border format type pixels Specifies the target texture. Must be GL_TEXTURE_1D of GL_PROXY_TEXTURE_1D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the number of color components in the texture. Must be 1, 2, 3, or 4, or one of the following symbolic constants: GL_ABGR_EXT, GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_RGB, GL_R3_G3_B2, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1,GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16. Specifies the width of the texture image. Must be 2n + 2 x border for some integer n. All implementations support texture images that are at least 64 texels wide. The height of the 1D texture image is 1. Specifies the width of the border. Must be either 0 or 1. Specifies the format of the pixel data. Symbolic constants GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, GL_ABGR_EXT, GL_LUMINANCE, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, GL_422_REV_AVERAGE_EXT, and GL_LUMINANCE_ALPHA are accepted. Specifies the data type for Pixels. Symbolic constants GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV are accepted. Specifies a pointer to the image data in memory. Description Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable one-dimensional texturing, call glEnable and glDisable with argument GL_TEXTURE_1D. Texture images are defined with glTexImage1D. The arguments describe the parameters of the texture image, such as width, width of the border, level-of-detail number (See glTexParameter), and the internal resolution and format used to store the image. The last three arguments describe how the image is represented in memory; they are identical to the pixel formats used for glDrawPixels. If target is GL_PROXY_TEXTURE_1D no data is read from pixels, but all of the texture image state is recalculated, checked for consistency, and checked against the implementation’s capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (See glGetError). To query for an entire mipmap array, use an image array level greater than or equal to 1. Chapter 1. OpenGL Subroutines 337 If target is GL_TEXTURE_1D, data is read from pixels as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on type. These values are grouped into sets of one, two, three, or four values, depending on format, to form elements. If type is GL_BITMAP, the data is considered as a string of unsigned bytes (and format must be GL_COLOR_INDEX). Each data byte is treated as eight 1-bit elements, with bit ordering determined by GL_UNPACK_LSB_FIRST (See glPixelStore). The first element corresponds to the left end of the texture array. Subsequent elements progress left-to-right through the remaining texels in the texture array. The final element corresponds to the right end of the texture array. The format parameter determines the composition of each element in pixels. It can assume one of 16 symbolic values: GL_COLOR_INDEX GL_RED GL_GREEN GL_BLUE GL_ALPHA GL_RGB GL_RGBA GL_BGR 338 OpenGL 2.1 Reference Manual Each element is a single value, a color index. The GL converts it to fixed point (with an unspecified number of zero bits to the right of the binary point), shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET (See glPixelTransfer). The resulting index is converted to a set of color components using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables, and clamped to the range [0,1]. Each element is a single red component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). Each element is a single green component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). Each element is a single blue component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and green, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). Each element is a single alpha component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). Each element is an RGB triple. The GL converts it to floating point and assembles it into an RGBA element by attaching 1.0 for alpha. Eachcomponent is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). Each element contains all four components. Each *component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). Each pixel is a three-component group, blue first, followed by green, followed by red. Each component is converted to the internal floating-point format in the same way as the blue, green, and red components of an BGRA pixel are. The color triple is converted to an BGRA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an BGRA pixel. GL_BGRA Each pixel is a four-component group, blue first, followed by green, followed by red, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data are mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is BLUE, GREEN, RED, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is B, G, R, or A, respectively. GL_ABGR_EXT The resulting BGRA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a four-component group: for GL_RGBA, the red component is first, followed by green, followed by blue, followed by alpha; for GL_BGRA, the blue component is first, followed by green, followed by red, followed by alpha; for GL_ABGR_EXT the order is alpha, blue, green, and then red. Floating-point values are converted directly to an internal floatingpoint format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and zero maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is true, each color component is scaled by the size of lookup table GL_PIXEL_MAP_c_TO _c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively. The resulting RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod width yn = yr + | GL_LUMINANCE n bwidthc where (xr,yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each element is a single luminance value. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). Chapter 1. OpenGL Subroutines 339 GL_LUMINANCE_ALPHA GL_422_EXT GL_422_REV_EXT GL_422_AVERAGE_EXT 340 OpenGL 2.1 Reference Manual Each element is a luminance/alpha pair. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (See glPixelTransfer). This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it ha d been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. GL_422_REV_AVERAGE_EXT This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_REV_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversi on, the pixel is treated just as if it had been sent in as an RGB pixel. For applications that store the texture at a certain resolution or in a certain format, request the resolution and format with internalformat. The GL will choose an internal representation that closely approximates that requested by internalformat, but it may not match exactly. (The representations specified by GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, and GL_RGBA must match exactly. The numeric values 1, 2, 3, and 4 may also be used to specify the above representations.) Use the GL_PROXY_TEXTURE_1D target to try out a resolution and format. The implementation will update and recompute its best match for the requested storage resolution and format. To query this state, call glGetTexLevelParameter. If the texture cannot be accomodated, texture state is set to 0. A one-component texture image uses only the red component of the RGBA color extracted from pixels. A two-component image uses the R and A values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. Texturing has no effect in color index mode. The texture image can be represented by the same data formats as the pixels in a glDrawPixels command, except that GL_STENCIL_INDEX and GL_DEPTH_COMPONENT cannot be used. The glPixelStore and glPixelTransfer modes affect texture images in exactly the way they affect glDrawPixels. GL_PROXY_TEXTURE_1D can only be used if the GL version is 1.1 or greater. Internal formats other than 1, 2, 3, or 4 can only be used if the GL version is 1.1 or greater. In GL version 1.1 or greater, pixels may be a null pointer. In this case texture memory is allocated to accomodate a texture of width width. You can then download subtextures to initialize the texture memory. The image is undefined if the user tries to apply an uninitialized portion of the texture image to a primitive. Format of GL_ABGR_EXT is part of the _extname (EXT_abgr) extension, not part of the core GL command set. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_1D or GL_PROXY_TEXTURE_1D. Chapter 1. OpenGL Subroutines 341 GL_INVALID_ENUM is generated if format is not an accepted format constant. Format constants other than GL_STENCIL_INDEX and GL_DEPTH_COMPONENT are accepted. GL_INVALID_ENUM is generated if type is not a type constant. GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not GL_COLOR_INDEX. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2max, where max is the returned value of GL_MAX_TEXTURE_SIZE. GL_INVALID_VALUE is generated if internalformat is not 1, 2, 3, 4, or one of the accepted resolution and format symbolic constants. GL_INVALID_VALUE is generated if width is less than zero or greater than 2 + GL_MAX_TEXTURE_SIZE, or if it cannot be represented as 2n + 2 x border for some integer value of n. GL_INVALID_VALUE is generated if border is not 0 or 1. GL_INVALID_OPERATION is generated if glTexImage1D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_1D. Related Information The glCopyTexImage1D subroutine, glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage2D subroutine, glTexParameter subroutine, glTexSubImage1D subroutine. glTexImage2D Subroutine Purpose Specifies a two-dimensional (2D) texture image. Library OpenGL C bindings library: libGL.a C Syntax void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels) 342 OpenGL 2.1 Reference Manual Parameters target level internalformat width height border format type pixels Specifies the target texture. Must be GL_TEXTURE_2D or GL_PROXY_TEXTURE_2D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the number of color components in the texture. Must be 1, 2, 3, or 4, or one of the following symbolic constants: GL_ABGR_EXT, GL_ALPHA,GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16,GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8,GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA,GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2,GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4,GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16,GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8,GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB,GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10,GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2,GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2,GL_RGBA12, or GL_RGBA16. Specifies the width of the texture image. Must be 2n + 2 x border for some integer n. All implementations support texture images that are at least 64 texels wide. Specifies the height of the texture image. Must be 2m + 2 x border for some integer m. All implementations support texture images that are at least 64 texels high. Specifies the width of the border. Must be either 0 or 1. Specifies the format of the pixel data. Symbolic constants GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, GL_ABGR_EXT, GL_LUMINANCE, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, GL_422_REV_AVERAGE_EXT, and GL_LUMINANCE_ALPHA are accepted. Specifies the data type for Pixels. Symbolic constants GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV, are accepted. Specifies a pointer to the image data in memory. Description Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable two-dimensional texturing, call glEnable and glDisable with argument GL_TEXTURE_2D. To define texture images, call glTexImage2D. The arguments describe the parameters of the texture image, such as height, width, width of the border, level-of-detail number (see glTexParameter), and number of color components provided. The last three arguments describe how the image is represented in memory. They are identical to the pixel formats used for glDrawPixels. If target is GL_PROXY_TEXTURE_2D no data is read from pixels, but all of the texture image state is recalculated, checked for consistency, and checked against the implementation’s capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (see glGetError). To query for an entire mipmap array, use an image array level greater than or equal to 1. If target is GL_TEXTURE_2D, data is read from pixels as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on type. These values are grouped into sets of one, two, three, or four values, depending on format, to form elements. If type is GL_BITMAP, the data Chapter 1. OpenGL Subroutines 343 is considered as a string of unsigned bytes (and format must be GL_COLOR_INDEX). Each data byte is treated as eight 1-bit elements, with bit ordering determined by GL_UNPACK_LSB_FIRST (see glPixelStore). The first element corresponds to the lower-left corner of the texture image. Subsequent elements progress left-to-right through the remaining texels in the lowest row of the texture image, and then in successively higher rows of the texture image. The final element corresponds to the upper-right corner of the texture image. The format parameter determines the composition of each element in pixels. It can assume one of 16 symbolic values: GL_COLOR_INDEX GL_RED GL_GREEN GL_BLUE GL_ALPHA GL_RGB GL_RGBA GL_BGR 344 OpenGL 2.1 Reference Manual Each element is a single value, a color index. The GL converts it to fixed point (with an unspecified number of zero bits to the right of the binary point), shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET (see glPixelTransfer). The resulting index is converted to a set of color components using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables, and clamped to the range [0,1]. Each element is a single red component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single green component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single blue component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and green, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single alpha component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is an RGB triple. The GL converts it to floating point and assembles it into an RGBA element by attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element contains all four components. Each *component is multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each pixel is a three-component group, blue first, followed by green, followed by red. Each component is converted to the internal floating-point format in the same way as the blue, green, and red components of an BGRA pixel are. The color triple is converted to an BGRA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an BGRA pixel. GL_BGRA Each pixel is a four-component group, blue first, followed by green, followed by red, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data are mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is BLUE, GREEN, RED, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is B, G, R, or A, respectively. GL_ABGR_EXT The resulting BGRA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each pixel is a four-component group: for GL_RGBA, the red component is first, followed by green, followed by blue, followed by alpha; for GL_BGRA, the blue component is first, followed by green, followed by red, followed by alpha; for GL_ABGR_EXT the order is alpha, blue, green, and then red. Floating-point values are converted directly to an internal floatingpoint format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and zero maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is true, each color component is scaled by the size of lookup table GL_PIXEL_MAP_c_TO _c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively. The resulting RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod width yn = yr + | GL_LUMINANCE n bwidthc where (xr,yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each element is a single luminance value. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Chapter 1. OpenGL Subroutines 345 GL_LUMINANCE_ALPHA GL_422_EXT GL_422_AVERAGE_EXT GL_422_REV_AVERAGE_EXT Each element is a luminance/alpha pair. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_REV_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this convers ion, the pixel is treated just as if it had been sent in as an RGB pixel. Refer to the glDrawPixels subroutine for a description of the acceptable values for the type parameter. For applications that store the texture at a certain resolution or in a certain format, request the resolution and format with internalformat. The GL will choose an internal representation that closely approximates that requested by internalformat, but it may not match exactly. (The representations specified by GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, and GL_RGBA must match exactly. The numeric values 1, 2, 3, and 4 may also be used to specify the above representations.) 346 OpenGL 2.1 Reference Manual Use the GL_PROXY_TEXTURE_2D target to try out a resolution and format. The implementation will update and recompute its best match for the requested storage resolution and format. To then query this state, call glGetTexLevelParameter. If the texture cannot be accomodated, texture state is set to 0. A one-component texture image uses only the red component of the RGBA color extracted from pixels. A two-component image uses the R and A values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. Texturing has no effect in color index mode. The texture image can be represented by the same data formats as the pixels in a glDrawPixels command, except that GL_STENCIL_INDEX and GL_DEPTH_COMPONENT cannot be used. The glPixelStore and glPixelTransfer modes affect texture images in exactly the way they affect glDrawPixels. The GL_PROXY_TEXTURE_2D target are only available if the GL version is 1.1 or greater. Internal formats other than 1, 2, 3, or 4 may only be used if the GL version is 1.1 or greater. In GL version 1.1 or greater, pixels may be a null pointer. In this case texture memory is allocated to accomodate a texture of width width and height height. You can then download subtextures to initialize this texture memory. The image is undefined if the user tries to apply an uninitialized portion of the texture image to a primitive. Format of GL_ABGR_EXT is part of the _extname (EXT_abgr) extension, not part of the core GL command set. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_2D or GL_PROXY_TEXTURE_2D. GL_INVALID_ENUM is generated if format is not an accepted format constant. Format constants other than GL_STENCIL_INDEX and GL_DEPTH_COMPONENT are accepted. GL_INVALID_ENUM is generated if type is not a type constant. GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not GL_COLOR_INDEX. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2(max), where max is the returned value of GL_MAX_TEXTURE_SIZE. GL_INVALID_VALUE is generated if internalformat is not 1, 2, 3, 4, or one of the accepted resolution and format symbolic constants. GL_INVALID_VALUE is generated if width or height is less than zero or greater than 2 + GL_MAX_TEXTURE_SIZE, or if either cannot be represented as 2k + 2 x border for some integer value of k. GL_INVALID_VALUE is generated if border is not 0 or 1. Chapter 1. OpenGL Subroutines 347 GL_INVALID_OPERATION is generated if glTexImage2D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_2D. Related Information The glCopyTexImage2D subroutine, glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexParameter subroutine, glTexSubImage2D subroutine. glTexImage3D Subroutine Purpose Specifies a three-dimensional (3D) texture subimage. Library OpenGL C bindings library: libGL.a C Syntax void glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) Parameters target level internalformat width height depth border 348 Specifies the target texture. Must be GL_TEXTURE_3D or GL_PROXY_TEXTURE_3D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the number of color components in the texture. Must be 1, 2, 3, or 4, or one of the following symbolic constants: GL_ABGR_EXT, GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16. Specifies the width of the texture image. Must be 2n + 2 x border for some integer n. Specifies the height of the texture image. Must be 2m + 2 x border for some integer m. Specifies the depth of the texture image. Must be 2l + 2 x border for some integer l. Specifies the width of the border. Must be either 0 or 1. OpenGL 2.1 Reference Manual format type pixels Specifies the format of the pixel data. Symbolic constants GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, GL_ABGR_EXT, GL_LUMINANCE, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, GL_422_REV_AVERAGE_EXT, and accepted. Specifies the data type for Pixels. Symbolic constants GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV are accepted. Specifies a pointer to the image data in memory. Description Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable three-dimensional texturing, call glEnable and glDisable with argument GL_TEXTURE_3D. To define 3D texture images, call glTexImage3D. The arguments describe the parameters of the texture image, such as height, width, depth, width of the border, level-of-detail number (see glTexParameter), and number of color components provided. The last three arguments describe how the image is represented in memory; they are identical to the pixel formats used for glDrawPixels. If target is GL_PROXY_TEXTURE_3D no data is read from pixels, but all of the texture image state is recalculated, checked for consistency, and checked against the implementation’s capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (see glGetError). To query for an entire mipmap array, use an image array level greater than or equal to 1. If target is GL_TEXTURE_3D, data is read from pixels as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on type. These values are grouped into sets of one, two, three, or four values, depending on format, to form elements. If type is GL_BITMAP, the data is considered as a string of unsigned bytes (and format must be GL_COLOR_INDEX). Each data byte is treated as eight 1-bit elements, with bit ordering determined by GL_UNPACK_LSB_FIRST (see glPixelStore). The first element corresponds to the lower-left corner of the texture image. Subsequent elements progress left-to-right through the remaining texels in the lowest row of the texture image, and then in successively higher rows of the texture image. The final element corresponds to the upper-right corner of the texture image. The format parameter determines the composition of each element in pixels. It can assume one of 16 symbolic values: GL_COLOR_INDEX Each element is a single value, a color index. The GL converts it to fixed point (with an unspecified number of zero bits to the right of the binary point), shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET (see glPixelTransfer). The resulting index is converted to a set of color components using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables, and clamped to the range [0,1]. Chapter 1. OpenGL Subroutines 349 GL_RED GL_GREEN GL_BLUE GL_ALPHA GL_RGB GL_RGBA GL_BGR GL_BGRA Each element is a single red component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single green component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single blue component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and green, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single alpha component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is an RGB triple. The GL converts it to floating point and assembles it into an RGBA element by attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element contains all four components. Each *component is multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each pixel is a three-component group, blue first, followed by green, followed by red. Each component is converted to the internal floating-point format in the same way as the blue, green, and red components of an BGRA pixel are. The color triple is converted to an BGRA pixel with alpha set to 1.0. After this conversion, the pixel is treated just as if it had been read as an BGRA pixel. Each pixel is a four-component group, blue first, followed by green, followed by red, followed by alpha. Floating-point values are converted directly to an internal floating-point format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data are mapped similarly: the largest integer value maps to 1.0, and 0 maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is BLUE, GREEN, RED, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is True, each color component is scaled by the size of the lookup table GL_PIXEL_MAP_c_TO_c, then replaced by the value that it references in that table. c is B, G, R, or A, respectively. The resulting BGRA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod Width and yn = yr + [n/Width], where (xr, yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. 350 OpenGL 2.1 Reference Manual GL_ABGR_EXT Each pixel is a four-component group: for GL_RGBA, the red component is first, followed by green, followed by blue, followed by alpha; for GL_BGRA, the blue component is first, followed by green, followed by red, followed by alpha; for GL_ABGR_EXT the order is alpha, blue, green, and then red. Floating-point values are converted directly to an internal floatingpoint format with unspecified precision. Signed integer values are mapped linearly to the internal floating-point format such that the most positive representable integer value maps to 1.0, and the most negative representable value maps to -1.0. Unsigned integer data is mapped similarly: the largest integer value maps to 1.0, and zero maps to 0.0. The resulting floating-point color values are then multiplied by GL_c_SCALE and added to GL_c_BIAS, where c is RED, GREEN, BLUE, and ALPHA for the respective color components. The results are clamped to the range [0,1]. If GL_MAP_COLOR is true, each color component is scaled by the size of lookup table GL_PIXEL_MAP_c_TO _c, then replaced by the value that it references in that table. c is R, G, B, or A, respectively. The resulting RGBA colors are then converted to fragments by attaching the current raster position z coordinate and texture coordinates to each pixel, then assigning x and y window coordinates to the nth fragment such that xn = xr + n mod width yn = yr + | GL_LUMINANCE GL_LUMINANCE_ALPHA GL_422_EXT n bwidthc where (xr,yr) is the current raster position. These pixel fragments are then treated just like the fragments generated by rasterizing points, lines, or polygons. Texture mapping, fog, and all the fragment operations are applied before the fragments are written to the frame buffer. Each element is a single luminance value. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a luminance/alpha pair. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. Chapter 1. OpenGL Subroutines 351 GL_422_REV_EXT GL_422_AVERAGE_EXT GL_422_REV_AVERAGE_EXT This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_REV_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. Refer to the glDrawPixels reference page for a description of the acceptable values for the type parameter. If an application must store the texture at a certain resolution or in a certain format, use internalformat to request the resolution and format. The GL will choose an internal representation that closely approximates that requested by internalformat, but it may not match exactly. (The representations specified by GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, and GL_RGBA must match exactly. The numeric values 1, 2, 3, and 4 may also be used to specify the above representations.) Use the GL_PROXY_TEXTURE_3D target to try out a resolution and format. The implementation will update and recompute its best match for the requested storage resolution and format. To then query this state, call glGetTexLevelParameter. If the texture cannot be accommodated, texture state is set to 0. A one-component texture image uses only the red component of the RGBA color extracted from pixels. A two-component image uses the R and A values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. 352 OpenGL 2.1 Reference Manual Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. Texturing has no effect in color index mode. The texture image can be represented by the same data formats as the pixels in a glDrawPixels command, except that GL_STENCIL_INDEX and GL_DEPTH_COMPONENT cannot be used. The glPixelStore and glPixelTransfer modes affect texture images in exactly the way they affect glDrawPixels. Internal formats other than 1, 2, 3, or 4 may only be used if the GL version is 1.2 or greater. In GL version 1.2 or greater, pixels may be a null pointer. In this case texture memory is allocated to accomodate a texture of width width and height height. You can then download subtextures to initialize this texture memory. The image is undefined if the user tries to apply an uninitialized portion of the texture image to a primitive. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_3D or GL_PROXY_TEXTURE_3D. GL_INVALID_ENUM is generated if format is not an accepted format constant. Format constants other than GL_STENCIL_INDEX and GL_DEPTH_COMPONENT are accepted. GL_INVALID_ENUM is generated if type is not a type constant. GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not GL_COLOR_INDEX. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2(max), where max is the returned value of GL_MAX_3D_TEXTURE_SIZE. GL_INVALID_VALUE is generated if internalformat is not 1, 2, 3, 4, or one of the accepted resolution and format symbolic constants. GL_INVALID_VALUE is generated if width, height, or depth is less than zero or greater than 2 + GL_MAX_3D_TEXTURE_SIZE, or if either cannot be represented as 2k + 2 x border for some integer value of k. GL_INVALID_VALUE is generated if border is not 0 or 1. GL_INVALID_OPERATION is generated if glTexImage3D is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_3D Related Information The glCopyTexSubImage3D subroutine, glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexParameter subroutine, glTexImage2D subroutine. Chapter 1. OpenGL Subroutines 353 glTexImage3DEXT Subroutine Purpose Specifies a three-dimensional (3D) texture subimage. Library OpenGL C bindings library: libGL.a C Syntax void glTexImage3DEXT(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels) Parameters target level internalformat width height depth border format type pixels 354 Specifies the target texture. Must be GL_TEXTURE_3D_EXT or GL_PROXY_TEXTURE_3D_EXT. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies the number of color components in the texture. Must be 1, 2, 3, or 4, or one of the following symbolic constants: GL_ABGR_EXT, GL_ALPHA, GL_ALPHA4, GL_ALPHA8, GL_ALPHA12, GL_ALPHA16, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, GL_LUMINANCE12, GL_LUMINANCE16, GL_LUMINANCE_ALPHA, GL_LUMINANCE4_ALPHA4, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, GL_INTENSITY, GL_INTENSITY4, GL_INTENSITY8, GL_INTENSITY12, GL_INTENSITY16, GL_R3_G3_B2, GL_RGB, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, or GL_RGBA16. Specifies the width of the texture image. Must be 2n + 2 x border for some integer n. Specifies the height of the texture image. Must be 2m + 2 x border for some integer m. Specifies the depth of the texture image. Must be 2l + 2 x border for some integer l. Specifies the width of the border. Must be either 0 or 1. Specifies the format of the pixel data. The following symbolic values are accepted: GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, GL_422_REV_AVERAGE_EXT, and GL_LUMINANCE_ALPHA. Specifies the data type of the pixel data. The following symbolic values are accepted: GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, and GL_FLOAT. Specifies a pointer to the image data in memory. OpenGL 2.1 Reference Manual Description Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable three-dimensional texturing, call glEnable and glDisable with argument GL_TEXTURE_3D_EXT. To define 3D texture images, call glTexImage3DEXT. The arguments describe the parameters of the texture image, such as height, width, depth, width of the border, level-of-detail number (see glTexParameter), and number of color components provided. The last three arguments describe how the image is represented in memory; they are identical to the pixel formats used for glDrawPixels. If target is GL_PROXY_TEXTURE_3D_EXT no data is read from pixels, but all of the texture image state is recalculated, checked for consistency, and checked against the implementation’s capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (see glGetError). To query for an entire mipmap array, use an image array level greater than or equal to 1. If target is GL_TEXTURE_3D_EXT, data is read from pixels as a sequence of signed or unsigned bytes, shorts, or longs, or single-precision floating-point values, depending on type. These values are grouped into sets of one, two, three, or four values, depending on format, to form elements. If type is GL_BITMAP, the data is considered as a string of unsigned bytes (and format must be GL_COLOR_INDEX). Each data byte is treated as eight 1-bit elements, with bit ordering determined by GL_UNPACK_LSB_FIRST (see glPixelStore). The first element corresponds to the lower-left corner of the texture image. Subsequent elements progress left-to-right through the remaining texels in the lowest row of the texture image, and then in successively higher rows of the texture image. The final element corresponds to the upper-right corner of the texture image. The format parameter determines the composition of each element in pixels. It can assume one of 16 symbolic values: GL_COLOR_INDEX GL_RED GL_GREEN GL_BLUE Each element is a single value, a color index. The GL converts it to fixed point (with an unspecified number of zero bits to the right of the binary point), shifted left or right depending on the value and sign of GL_INDEX_SHIFT, and added to GL_INDEX_OFFSET (see glPixelTransfer). The resulting index is converted to a set of color components using the GL_PIXEL_MAP_I_TO_R, GL_PIXEL_MAP_I_TO_G, GL_PIXEL_MAP_I_TO_B, and GL_PIXEL_MAP_I_TO_A tables, and clamped to the range [0,1]. Each element is a single red component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for green and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single green component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and blue, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single blue component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red and green, and 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Chapter 1. OpenGL Subroutines 355 GL_ALPHA GL_RGB GL_RGBA GL_LUMINANCE GL_LUMINANCE_ALPHA GL_422_EXT GL_422_REV_EXT 356 OpenGL 2.1 Reference Manual Each element is a single alpha component. The GL converts it to floating point and assembles it into an RGBA element by attaching 0.0 for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is an RGB triple. The GL converts it to floating point and assembles it into an RGBA element by attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element contains all four components. Each *component is multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a single luminance value. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue and attaching 1.0 for alpha. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). Each element is a luminance/alpha pair. The GL converts it to floating point, then assembles it into an RGBA element by replicating the luminance value three times for red, green, and blue. Each component is then multiplied by the signed scale factor GL_c_SCALE, added to the signed bias GL_c_BIAS, and clamped to the range [0,1] (see glPixelTransfer). This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. The Cb for each even pixel is used as the Cb value for that pixel and its neighbor to the right. The Cr in each odd pixel is used as the Cr value for that pixel and its neighbor to the left. (If the width of the image is odd, then the colors will be undefined in the rightmost column.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. GL_422_AVERAGE_EXT GL_422_REV_AVERAGE_EXT This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Y. The second component is Cb in the even pixels and Cr in the odd pixels. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this conversion, the pixel is treated just as if it had been sent in as an RGB pixel. This extension is for use with the ″YCbCr″ color space, and should only be used in systems that have the IBM_YCbCr extension. The GL_YCBCR_TO_RGB_MATRIX_IBM matrix should be loaded using glLoadNamedMatrixIBM before glDrawPixels is called with this parameter. Each pixel is a two-component group. The first component is Cb in the even pixels and Cr in the odd pixels. The second component is Y. Each even pixel gets its Cb from itself, and its Cr from its neighbor to the right. Each odd pixel gets its Cb from the average of its left and right neighbor, and its Cr from the average of itself and its neighbor two to the right. (If the width of the image is odd, then the colors will be undefined in the rightmost column. If the neighbors to the right are not present for a given fragment, we use GL_422_REV_EXT to compute that fragment.) Through the use of the color matrix, Y then assumes the role of red, Cb becomes green and Cr becomes blue. After this convers ion, the pixel is treated just as if it had been sent in as an RGB pixel. Refer to the glDrawPixels reference page for a description of the acceptable values for the type parameter. If an application must store the texture at a certain resolution or in a certain format, use internalformat to request the resolution and format. The GL will choose an internal representation that closely approximates that requested by internalformat, but it may not match exactly. (The representations specified by GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, and GL_RGBA must match exactly. The numeric values 1, 2, 3, and 4 may also be used to specify the above representations.) Use the GL_PROXY_TEXTURE_3D_EXT target to try out a resolution and format. The implementation will update and recompute its best match for the requested storage resolution and format. To then query this state, call glGetTexLevelParameter. If the texture cannot be accomodated, texture state is set to 0. A one-component texture image uses only the red component of the RGBA color extracted from pixels. A two-component image uses the R and A values. A three-component image uses the R, G, and B values. A four-component image uses all of the RGBA components. Notes GL_ABGR_EXT is only valid if the GL_EXT_abgr extension is defined. Texturing has no effect in color index mode. The texture image can be represented by the same data formats as the pixels in a glDrawPixels command, except that GL_STENCIL_INDEX and GL_DEPTH_COMPONENT cannot be used. The glPixelStore and glPixelTransfer modes affect texture images in exactly the way they affect glDrawPixels. Chapter 1. OpenGL Subroutines 357 The glTexImage3DEXT subroutine and GL_PROXY_TEXTURE_3D_EXT are available only if the EXT_texture3D extension is supported. Internal formats other than 1, 2, 3, or 4 may only be used if the GL version is 1.1 or greater. In GL version 1.1 or greater, pixels may be a null pointer. In this case texture memory is allocated to accomodate a texture of width width and height height. You can then download subtextures to initialize this texture memory. The image is undefined if the user tries to apply an uninitialized portion of the texture image to a primitive. Format of GL_ABGR_EXT is part of the _extname (EXT_abgr) extension, not part of the core GL command set. Errors GL_INVALID_ENUM is generated if target is not GL_TEXTURE_3D_EXT or GL_PROXY_TEXTURE_3D_EXT. GL_INVALID_ENUM is generated if format is not an accepted format constant. Format constants other than GL_STENCIL_INDEX and GL_DEPTH_COMPONENT are accepted. GL_INVALID_ENUM is generated if type is not a type constant. GL_INVALID_ENUM is generated if type is GL_BITMAP and format is not GL_COLOR_INDEX. GL_INVALID_VALUE is generated if level is less than zero. GL_INVALID_VALUE may be generated if level is greater than log2(max), where max is the returned value of GL_MAX_3D_TEXTURE_SIZE_EXT. GL_INVALID_VALUE is generated if internalformat is not 1, 2, 3, 4, or one of the accepted resolution and format symbolic constants. GL_INVALID_VALUE is generated if width, height, or depth is less than zero or greater than 2 + GL_MAX_3D_TEXTURE_SIZE_EXT, or if either cannot be represented as 2k + 2 x border for some integer value of k. GL_INVALID_VALUE is generated if border is not 0 or 1. GL_INVALID_OPERATION is generated if glTexImage3DEXT is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexImage glIsEnabled with argument GL_TEXTURE_3D_EXT Related Information The glCopyTexSubImage3DEXT subroutine, glDrawPixels subroutine, glFog subroutine, glPixelStore subroutine, glPixelTransfer subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexParameter subroutine, glTexImage2D subroutine. 358 OpenGL 2.1 Reference Manual glTexParameter Subroutine Purpose Sets texture parameters. Library OpenGL C bindings library: libGL.a C Syntax void glTexParameterf(GLenum target, GLenum pname, GLfloat param) void glTexParameteri(GLenum target, GLenum pname, GLint param) void glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params) void glTexParameteriv(GLenum target, GLenum pname, const GLint * params) Parameters glTexParameterf or glTexParameteri target pname param Specifies the target texture, which must be either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_3D_EXT. Specifies the symbolic name of a single-valued texture parameter. The pname parameter can be one of the following: GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE_WRAP_R, GL_TEXTURE_PRIORITY, GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_MAX_ANISOTROPY_EXT. Specifies the value of pname. glTexParameterfv or glTexParameteriv target pname params Specifies the target texture, which must be either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_3D_EXT. Specifies the symbolic name of a texture parameter. The pname parameter can be one of the following: GL_TEXTURE_MIN_FILTER, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TEXTURE_WRAP_R, GL_TEXTURE_BORDER_COLOR, GL_TEXTURE_PRIORITY, GL_TEXTURE_MIN_LOD, GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, GL_TEXTURE_MAX_LEVEL, GL_TEXTURE_MAX_ANISOTROPY_EXT . Specifies a pointer to an array where the value or values of pname are stored. Chapter 1. OpenGL Subroutines 359 Description Texture mapping is a technique that applies an image onto an object’s surface as if the image were a decal or cellophane shrink-wrap. The image is created in texture space, with an (s, t) coordinate system. A texture is a one-dimensional (1D) or two-dimensional (2D) image and a set of parameters that determine how samples are derived from the image. The glTexParameter subroutine assigns the value or values in params to the texture parameter specified as pname. The target parameter defines the target texture, either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, or GL_TEXTURE_3D_EXT. The following symbols are accepted in pname: GL_TEXTURE_BORDER_COLOR Sets a border color. The params parameter contains four values that comprise the red, green, blue, alpha (RGBA) color of the texture border. Integer color components are interpreted linearly such that the most positive integer maps to 1.0, and the most negative integer maps to -1.0. The values are clamped to the range [0,1] when they are specified. Initially, the border color is (0, 0, 0, 0). GL_TEXTURE_MIN_FILTER The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element. There are six defined minifying functions. Two of them use the nearest one or nearest four texture elements to compute the texture value. The other four use mipmaps. A mipmap is an ordered set of arrays representing the same image at progressively lower resolutions. If the texture has dimensions 2n x 2m there are max(n,m)+1 mipmaps. The first mipmap is the original texture, with dimensions 2n x 2m. Each subsequent mipmap has dimensions 2k-1 x 2l-1 where 2k x 2l are the dimensions of the previous mipmap, until either k=0 or l=0. At that point, subsequent mipmaps have the dimension 1 x 2l-1 or 2k-1 x 1 until the final mipmap, which has the dimension 1 x 1. Mipmaps are defined using the glTexImage1D, glTexImage2D, or glTexImage3DEXT subroutines with the level-of-detail argument indicating the order of the mipmaps. Level 0 is the original texture; level max(n,m) is the final 1 x 1 mipmap. The paramrs parameter supplies a function for minifying the texture as one of the following: GL_NEAREST returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured. GL_LINEAR returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T, and on the exact mapping. GL_NEAREST_MIPMAP_NEAREST chooses the mipmap that most closely matches the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value. GL_LINEAR_MIPMAP_NEAREST chooses the mipmap that most closely matches the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value. GL_NEAREST_MIPMAP_LINEAR chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values. GL_LINEAR_MIPMAP_LINEAR chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values. As more texture elements are sampled in the minification process, fewer aliasing artifacts will be apparent. While the GL_NEAREST and GL_LINEAR minification functions can be faster than the other four, they sample only one or four texture elements to determine the texture value of the 360 OpenGL 2.1 Reference Manual pixel being rendered and can produce moire patterns or ragged transitions. The default value of GL_TEXTURE_MIN_FILTER is GL_NEAREST_MIPMAP_LINEAR. GL_TEXTURE_MAG_FILTER The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element. It sets the texture magnification function to either GL_NEAREST or GL_LINEAR. GL_NEAREST is generally faster than GL_LINEAR, but it can produce textured images with sharper edges because the transition between texture elements is not as smooth. The initial value of GL_TEXTURE_MAG_FILTER is GL_LINEAR. GL_NEAREST returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured. GL_LINEAR returns the weighted average of the four texture elements that are closest to the center of the pixel being textured. These can include border texture elements, depending on the values of GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T, and on the exact mapping. GL_NEAREST is generally faster than GL_LINEAR, but can produce textured images with sharper edges because the transition between texture elements is not as smooth. The default value of GL_TEXTURE_MAG_FILTER is GL_LINEAR. GL_TEXTURE_PRIORITY Specifies the texture residence priority of the currently bound texture. Permissible values are in the range [0.0, 1.0]. See glPrioritizeTextures and glBindTexture for more information. GL_TEXTURE_MAX_LOD Specifies for the texture the maximum level of detail of the image array. Any floating-point value is permissable. Supported in OpenGL 1.2 and later. GL_TEXTURE_MIN_LOD Specifies for the texture the minimum level of detail of the image array. Any floating-point value is permissable. Supported in OpenGL 1.2 and later. GL_TEXTURE_BASE_LEVEL Specifies for the texture the base array level. Any non-negative integer value is permissable. Supported in OpenGL 1.2 and later. GL_TEXTURE_MAX_LEVEL Specifies for the texture the maximum array level. Any non-negative integer value is permissable. Supported in OpenGL 1.2 and later. GL_TEXTURE_WRAP_R Sets the wrap parameter for texture coordinate r to either GL_CLAMP, GL_CLAMP_NODRAW_IBM, GL_CLAMP_TO_EDGE, or GL_REPEAT. See the discussion under GL_TEXTURE_WRAP_S. Initially, GL_TEXTURE_WRAP_R is set to GL_REPEAT. GL_TEXTURE_WRAP_S Sets the wrap parameter for texture coordinate s to either GL_CLAMP, GL_CLAMP_NODRAW_IBM, GL_CLAMP_TO_EDGE, or GL_REPEAT. GL_CLAMP causes s, t, or r coordinates to be clamped to the range [0,1] and is useful for preventing wrapping artifacts when mapping a single image onto an object. GL_CLAMP_NODRAW_IBM clamps texture coordinates at all mipmap levels such that any pixels whose corresponding texture coordinate falls outside the specified texture map are not drawn at all. GL_CLAMP_TO_EDGE clamps texture coordinates at all mipmap levels such that the texture filter never samples a border texel. The color returned when clamping is derived only from texels at the edge of the texture image. GL_REPEAT causes the integer part of the s, t, or r coordinates to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern. Border texture elements are accessed only if wrapping is set to GL_CLAMP. Initially, GL_TEXTURE_WRAP_S is set to GL_REPEAT. GL_TEXTURE_WRAP_T Sets the wrap parameter for texture coordinate t to either GL_CLAMP, Chapter 1. OpenGL Subroutines 361 GL_CLAMP_NODRAW_IBM, GL_CLAMP_TO_EDGE, or GL_REPEAT. See the discussion under GL_TEXTURE_WRAP_S. Initially, GL_TEXTURE_WRAP_T is set to GL_REPEAT. GL_TEXTURE_MAX_ANISOTROPIC_EXT Sets the maximum degree of anisotropy for this texture map. Initially, GL_TEXTURE_MAX_ANISOTROPIC_EXT is set to 1.0. Notes Suppose that a program has enabled texturing (by calling glEnable with argument GL_TEXTURE_1D, GL_TEXTURE_2D, or GL_TEXTURE_3D) and has set GL_TEXTURE_MIN_FILTER to one of the functions that requires a mipmap. If either the dimensions of the texture images currently defined (with previous calls to glTexImage1D, glTexImage2D, or glTexImage3D) do not follow the proper sequence for mipmaps (described above) or there are fewer texture images defined than are needed or the set of texture images have differing numbers of texture components, then it is as if texture mapping were disabled. Linear filtering accesses the four nearest texture elements only in 2D textures. In 1D textures, linear filtering accesses the two nearest texture elements. GL_TEXTURE_3D is supported in OpenGL 1.2 and later. GL_TEXTURE_3D_EXT requires the 3D texture extension. GL_TEXTURE_MAX_ANISOTROPY_EXT requires the EXT_texture_filter_anisotropic extension. Errors GL_INVALID_ENUM is generated if target or pname is not one of the accepted defined values. GL_INVALID_ENUM is generated if params should have a defined constant value (based on the value of pname) and does not. GL_INVALID_OPERATION is generated if glTexParameter is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets glGetTexParameter glGetTexLevelParameter Related Information The glBindTexture subroutine, glPrioritizeTextures subroutine, glTexEnv subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3D subroutine, glTexImage3DEXT subroutine. glTexSubImage1D Subroutine Purpose Specifies a one-dimensional (1D) texture subimage. Library OpenGL C bindings library: libGL.a 362 OpenGL 2.1 Reference Manual C Syntax void glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels) Parameters target level xoffset width format type pixels Specifies the target texture. Must be GL_TEXTURE_1D. Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. Specifies a texel offset in the x direction within the texture array. Specifies the width of the texture subimage. Specifies the format of the pixel data. Symbolic constants GL_COLOR_INDEX, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_BGR, GL_BGRA, GL_ABGR_EXT, GL_LUMINANCE, GL_422_EXT, GL_422_REV_EXT, GL_422_AVERAGE_EXT, GL_422_REV_AVERAGE_EXT, and GL_LUMINANCE_ALPHA are accepted. Specifies the data type for Pixels. Symbolic constants GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, GL_FLOAT, GL_UNSIGNED_BYTE_3_3_2, GL_UNSIGNED_BYTE_2_3_3_REV, GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_5_6_5_REV, GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_SHORT_4_4_4_4_REV, GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_SHORT_1_5_5_5_REV, GL_UNSIGNED_INT_8_8_8_8, GL_UNSIGNED_INT_8_8_8_8_REV, GL_UNSIGNED_INT_10_10_10_2, and GL_UNSIGNED_INT_2_10_10_10_REV are accepted. Specifies a pointer to the image data in memory. Description Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable or disable one-dimensional texturing, call glEnable and glDisable with argument GL_TEXTURE_1D. The glTexSubImage1D subroutine redefines a contiguous subregion of an existing one-dimensional texture image. The texels referenced by pixels replace the portion of the existing texture array with x indices xoffset and xoffset + width - 1, inclusive. This region may not include any texels outside the range of the texture array as it was originally specified. It is not an error to specify a subtexture with zero width, but such a specification has no
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project