Opengl FAQ and Troubleshooting Guide
Total Page:16
File Type:pdf, Size:1020Kb
OpenGL FAQ and Troubleshooting Guide Table of Contents OpenGL FAQ and Troubleshooting Guide v1.2001.11.01..............................................................................1 1 About the FAQ...............................................................................................................................................13 2 Getting Started ............................................................................................................................................18 3 GLUT..............................................................................................................................................................33 4 GLU.................................................................................................................................................................37 5 Microsoft Windows Specifics........................................................................................................................40 6 Windows, Buffers, and Rendering Contexts...............................................................................................48 7 Interacting with the Window System, Operating System, and Input Devices........................................49 8 Using Viewing and Camera Transforms, and gluLookAt().......................................................................51 9 Transformations.............................................................................................................................................55 10 Clipping, Culling, and Visibility Testing...................................................................................................64 11 Color..............................................................................................................................................................68 12 The Depth Buffer.........................................................................................................................................70 13 Drawing Lines over Polygons and Using Polygon Offset.........................................................................74 14 Rasterization and Operations on the Framebuffer...................................................................................77 15 Transparency, Translucency, and Blending..............................................................................................82 16 Display Lists and Vertex Arrays................................................................................................................85 17 Using Fonts...................................................................................................................................................88 18 Lights and Shadows.....................................................................................................................................90 19 Curves, Surfaces, and Using Evaluators....................................................................................................95 20 Picking and Using Selection........................................................................................................................96 21 Texture Mapping.........................................................................................................................................99 22 Performance...............................................................................................................................................104 23 Extensions and Versions............................................................................................................................108 i OpenGL FAQ and Troubleshooting Guide Table of Contents 24 Miscellaneous..............................................................................................................................................112 Appendix A Microsoft OpenGL Information..............................................................................................118 Windows Driver Development Kits....................................................................................................118 Preliminary Windows 2000 DDK..........................................................................................118 Windows Driver and Hardware Development....................................................................................118 Fluff articles.........................................................................................................................................118 MSDN Library.....................................................................................................................................119 Platform SDK........................................................................................................................119 OpenGL technical articles......................................................................................................121 Useful other articles................................................................................................................122 Knowledge Base..................................................................................................................................123 Current....................................................................................................................................123 Archive....................................................................................................................................125 Appendix B Source Code Index.....................................................................................................................128 Appendix C History........................................................................................................................................130 ii OpenGL FAQ and Troubleshooting Guide v1.2001.11.01 1 About the FAQ 15 Transparency, Translucency, and Blending 2 Getting Started 16 Display Lists and Vertex Arrays 3 GLUT 17 Using Fonts 4 GLU 18 Lights and Shadows 5 Microsoft Windows Specifics 19 Curves, Surfaces, and Using Evaluators 6 Windows, Buffers, and Rendering Contexts 20 Picking and Using Selection 7 Interacting with the Window System, Operating 21 Texture Mapping System, and Input Devices 8 Using Viewing and Camera Transforms, and 22 Performance gluLookAt() 9 Transformations 23 Extensions and Versions 10 Clipping, Culling, and Visibility Testing 24 Miscellaneous 11 Color Appendix A Microsoft OpenGL Information 12 The Depth Buffer Appendix B Source code index 13 Drawing Lines over Polygons and Using Polygon Appendix C History of OpenGL Offset German Translation: OpenGL häufig gestellte 14 Rasterization and Operations on the Framebuffer fragen Japanese Translation: 1 About the FAQ 1.010 Introduction 1.020 How to contribute, and the contributors 1.030 Download the entire FAQ as a Zip file 1.031 Printing the PDF FAQ 1.040 Change Log 2 Getting Started 2.005 Where can I find 3D graphics info? 2.010 Where can I find examples, tutorials, documentation, and other OpenGL information? 2.020 What OpenGL books are available? 2.030 What OpenGL chat rooms and newsgroups are available? 2.040 What OpenGL implementations come with source code? OpenGL FAQ and Troubleshooting Guide v1.2001.11.01 1 OpenGL FAQ and Troubleshooting Guide 2.050 What compiler can I use? 2.060 What do I need to compile and run OpenGL programs? 2.070 Why am I getting compile, link, and runtime errors? 2.080 How do I initialize my windows, create contexts, etc.? 2.090 How do I create a full−screen window? 2.100 What is the general form of an OpenGL program? 2.110 My window is blank. What should I do? 2.120 My first frame renders correctly, but subsequent frames are incorrect or further away or I just get a blank screen. What's going on? 2.130 What is the AUX library? 2.140 What support for OpenGL does {Open,Net,Free}BSD or Linux provide? 2.150 Where is OpenGL 1.2? 2.160 What are the OpenGL Conformance Tests? 3 GLUT 3.010 What is GLUT? How is it different from OpenGL? 3.015: Where can I get GLUT? 3.020 Should I use GLUT? 3.025 The GLUT source code license is very restrictive. Is there an alternative? 3.027 Why does glutTimerFunc() only execute my callback once? 3.030 I need to set up different tasks for left and right mouse button motion. However, I can only set one glutMotionFunc() callback, which doesn't pass the button as a parameter. 3.040 How does GLUT do…? 3.050 How can I perform animations with GLUT? 3.060 Is it possible to change a window's size *after* it's opened (i.e., after I call glutInitWindowSize(); and glutCreateWindow();)? 3.070 I have a GLUT program that allocates memory at startup. How do I deallocate this memory when the program exits? 3.080 How can I make my GLUT program detect that the user has closed the window? OpenGL FAQ and Troubleshooting Guide v1.2001.11.01 2 OpenGL FAQ and Troubleshooting Guide 3.090 How can I make glutMainLoop() return to my calling program? 3.100 How do I get rid of the console window in a Windows GLUT application? 3.110 My GLUT question isn't answered here. Where can I get more info? 4 GLU 4.010 What is GLU? How is it different from OpenGL? 4.020 How does GLU render sphere, cylinder, and disk primitives? 4.030 How does gluPickMatrix work? 4.040 How do I use GLU tessellation routines? 4.050 Why aren't my tessellation callback routines called? 4.060 How do I use GLU NURBS routines? 4.070 How do I use gluProject and gluUnProject? 5 Microsoft Windows Specifics 5.010 What's a good source for Win32 OpenGL programming information?