SAMPLE: Glen.exe Shows How to Enumerate Pixel Formats in OpenGL

Last reviewed: February 4, 1998
Article ID: Q176752
The information in this article applies to:
  • Microsoft Win32 Software Development Kit on the following platforms: - Microsoft Windows NT versions 3.51, 4.0 - Microsoft Windows 95

SUMMARY

The GLEnum sample provides a demonstration of how to enumerate pixel formats and method for checking the available pixel formats provided on your machine. The GLEnum sample is included in Glen.exe.

The following file is available for download from the Microsoft Software Library:

 ~ Glen.exe (size: 39943 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

MORE INFORMATION

GLEnum allows you check the capabilities of the available pixel formats available on your system quickly and easily. There are 24 generic pixel formats that are always available, but there may be additional ones if your video adapter provides 3D acceleration. You should use these accelerated formats whenever they are available.

When you simply specify a pixel format descriptor and send it to the ChoosePixelFormat and SetPixelFormat functions, you allow a generic mapper to determine what pixel format to use. You can gain total control over this selection process by doing your own enumeration, as demonstrated in GLEnum. One method to do this is to associate a relative weight to each attribute you are interested in, enumerate all the available formats, and then choose the pixel-format descriptor with the highest weight.

GLEnum demonstrates how to enumerate pixel formats and shows you the contents of each pixel format. When you enumerate pixel formats for your OpenGL applications, you choose one of the enumerated pixel formats for your application to use. The choice you make is totally dependent on what attributes your OpenGL program needs.


Additional query words: opengl pfd descriptor acceleration
Keywords : GdiOpenGL
Version : WINDOWS:95; WINNT:3.51,4.0
Platform : WINDOWS winnt
Issue type : kbfile
Solution Type : kbsample


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 4, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.