SIGGRAPH '97

Course 24: OpenGL and Window System Integration

OpenGL Portability Notes



Contents

1. Introduction

Though OpenGL is an extremely portable 3-D graphics API there are some things to be careful of. OpenGL has some built-in limits and there are a number of too-common implementation errors that OpenGL developers should be aware of to ensure portability.



2. OpenGL Limits

The OpenGL specification calls for certain minimum requirements in any OpenGL implementation. These limits may be extended in some implementations but to be safe, developers should be aware of the minimum requirements.

Limits may be queried with the glGetInteger and related functions.

Texture Size
Implementations must support textures of at least 64 by 64 texels. Larger textures are usually supported but consider the possibility that you may be limited to 64 by 64. 512 by 512 is a common limit.

The maximum texture size can also depend on whether you're using texture borders or mipmapping. OpenGL 1.1 and the GL_EXT_texture extension offer proxy textures which better indicate the maximum texture size than glGet.

Pixel Maps
Pixel maps (glPixelMap) must support at least 32 entries. Larger maps of 256 or 4096 entries are common.
Selection stack
The selection stack may be as small as 64 names.
Evaluators
Evaluators may be limited to 8 control points. A larger number of control points is frequently supported.
Stacks Depths
The MODELVIEW matrix stack size is at least 32 matrices.

The PROJECTION matrix stack size is at least 2 matrices.

The TEXTURE matrix stack size is at least 2 matrices.

The attribute stack size is at least 16. Similarly, the client attribute stack (OpenGL 1.1) size is at least 16.

Point and line sizes
Maximum point size may be 1 pixel. Maximum line width may be 1 pixel. Antialiased points and lines are often limited to one size.
Viewports
The maximum viewport size may be limited to your screen size. Frequently, the maximum viewport size is 2048 by 2048.
Lights
At least eight light sources must be available. Seldom are more supported.
Clipping Planes
At least six user-definable clipping planes must be available. Seldom are more supported.


3. OpenGL Bugs

Unfortunately, OpenGL implementations often have some minor (and occasionally, major) bugs. Typically, these bugs are found in the more obscure corners of OpenGL so they don't effect most applications.

In some cases the hardware is at fault and the likelihood of a fix is slim, short of hardware redesign. In other cases a subsequent OpenGL software release may fix the problem.

Here are some tips on dealing with OpenGL bugs:

Here is a small collection of known OpenGL problems discovered from personal experience. Please note that the following information may become obsolete at any time upon the release of updated software.

Texture borders
Texture borders are not supported on some systems such as the SGI Infinite Reality system. Luckily, the functionality provided by texture borders can be achieved with the GL_SGIS_texture_border_clamp and GL_SGIS_texture_edge_clamp extensions.

It's probably best to avoid using OpenGL texture borders in general.

Texture formats
Several SGI systems (Impact and possibly Reality Engine) don't support GL_ALPHA (internal format) textures.
glTexImage error checking
glTexImage[12]D doesn't generate an error if the texture sizes are not powers of two on some SGI systems.
Line Stippling
The line stipple counter isn't reset upon glBegin() on SGI Impact and IR systems.
Texture objects
Texture objects which are shared by several rendering contexts don't work correctly on SGI Impact systems.




Last edited on April 14, 1997 by Brian Paul.