next up previous contents
Next: 19.1.1 Handle Runtime Feature Up: 19. Portability Considerations Previous: 19. Portability Considerations

19.1 General Concerns

Your OpenGL application should be at least a little flexible about the features it has available. A common goal is an application which can run well on almost all OpenGL platforms, and can also use the exceptional features on some platforms for high-speed and/or high-quality rendering.

It is unrealistic to expect an application developer to provide code that determines the best possible combination of modes and techniques for a given piece of hardware given both available features and those features' performance. However, a reasonable amount of time spent checking implementation characteristics at runtime can allow an application to better leverage an implementation with acceleration.

For example, one extreme is to develop an application that does not use the stencil buffer because the developer does not know if it will be available. The other extreme is to provide a fully general algorithm that uses 0, 1, or however many bits are available in the stencil buffer. A middle ground that maximizes portability, development time, and utilization of accelerated hardware might be to provide an algorithm that uses no stencil and an algorithm that uses 1 stencil bit and chooses between them at runtime based on querying the implementation.



 
next up previous contents
Next: 19.1.1 Handle Runtime Feature Up: 19. Portability Considerations Previous: 19. Portability Considerations
David Blythe
1999-08-06