home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible / OpenGL_Superbible_Waite_Group_Press_1996.iso / opengl11 / summary.txt
Text File  |  1996-07-08  |  4KB  |  48 lines

  1. OpenGL Version 1.1
  2. ------------------
  3.  
  4. To best view this file, load it into notepad, and turn word wrap on.
  5.  
  6. This file summarizes and describes the important additions and changes to OpenGL from version 1.0 to version 1.1. OpenGL Version 1.0 was supported by Windows NT versions 3.5 and 3.51. Windows NT version 4.0 contains the first commercially available implementation of OpenGL version 1.1. The necessary DLL's to add this functionality to Windows95 are available as well in the \Windows95 subdirectory.
  7.  
  8. OpenGL Printing
  9. ---------------
  10. For version 1.1, several new functions and capabilities were added to OpenGL. A few example programs are included in the \OpenGL11\Samples directory that demonstrate some of these new features and capabilities. One important addition to Windows NT 4.0 is the ability to use OpenGL to render into an enhanced metafile. The NT print spooler will also now allow you to render directly to a printer device context, even for black and white printers. The example program GLPrint in the \Samples directory demonstrates this. This represents a change to the Window GDI, not OpenGL and this capability is not present in the current version of Windows 95, even if you have the OpenGL 1.1 DLL's.
  11.  
  12. Vertex Arrays
  13. -------------
  14. One of the most important enhancements to OpenGL 1.1 with respect to speed is vertex arrays. This feature had previously been available through an extension library, but is now part of the OpenGL specification. The concept of vertex arrays is simple. Rather than making repeated calls to glVertex, glNormal, glColor, and glTexCoord to specify your geometry, you can load arrays that contain all of the vertex, normal, color, and texture data in one single block of memory. The vertex array functions allow you to make one single function call that transfers all this data to the OpenGL rendering engine. This provides a considerable performance boost when used outside of display lists, and even more of a boost when encapulated in a display list.
  15.  
  16. To use the vertex arrays, you must establish a block of memory that will contain the geometry data. The following functions accomplish this:
  17.  
  18. void glEdgeFlagPointer(sizei stride, void *pointer);
  19. void glTexCoordPointer(int size, enum type, sizei stride, void *pointer);
  20. void glColorPointer(int size, enum type, sizei stride, void *pointer);
  21. void glIndexPointer(enum type, sizei stride, void *pointer);
  22. void glNormalPointer(enum type, sizei stride, void *pointer);
  23. void glVertexPointer(int size, enum type, sizei stride, void *pPointer);
  24.  
  25. Note that each type of geometry data is contained in its own buffer. You fill the buffers with data and then call one or more of the above functions to set it up. If you change the contents of the buffer after calling one of these functions, the results are undefined. Each particular buffer is enabled or disabled with one of the following functions.
  26.  
  27. void glEnableClientState(enum array);
  28. void glDisableClientState(enum array);
  29.  
  30. Valid arguments for these functions are: GL_EDGE_FLAG_ARRAY, GL_TEXTURE_COORD_ARRAY, GL_COLOR_ARRAY, 
  31. GL_INDEX_ARRAY, GL_NORMAL_ARRAY, GL_VERTEX_ARRAY.
  32.  
  33. Finally, one of the following functions renders the array data.
  34.  
  35. void glDrawArrays(enum mode, int first, sizei count);
  36. void glDrawElements(enum mode, sizei count, enum type, void *indices);
  37. void glInterleavedArrays(enum format, sizei stride, void *pointer);
  38.  
  39. In the \Samples directory you will find three screen savers numbered Step0 - Step2. This example starts with a simple OpenGL screen saver. Step1 uses the SwapHint extension to speed up the animation somewhat. Step2 uses the vertex arrays as well to further speed up the animation. There is also one other supplimentary example SBolt which is the spinning bolt example from Chapter 10. This time the program has been further modified to use the vertex array functions, further speeding up the animation.
  40.  
  41. You can quickly save and restore the vertex array buffer settings with the last two related functions:
  42.  
  43. void glPushClientAttrib(bitfield mask);
  44. void glPopClientAttrib(void);
  45.  
  46. Valid arguments for glPushClientAttrib are: GL_CLIENT_VERTEX_ARRAY_BIT, GL_CLIENT_PIXEL_STORE_BIT, 
  47. GL_CLIENT_ALL_ATTRIB_BITS.
  48.