glHint
The glHint function specifies implementation-specific hints.
void glHint(
GLenum target,
GLenum mode
);
Parameters
-
target
-
A symbolic constant indicating the behavior to be controlled. The following symbolic constants, along with suggested semantics, are accepted:
-
GL_FOG_HINT
-
Indicates the accuracy of fog calculation. If per-pixel fog calculation is not efficiently supported by the OpenGL implementation, hinting GL_DONT_CARE or GL_FASTEST can result in per-vertex calculation of fog effects.
-
GL_LINE_SMOOTH_HINT
-
Indicates the sampling quality of antialiased lines. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.
-
GL_PERSPECTIVE_CORRECTION_HINT
-
Indicates the quality of color and texture coordinate interpolation. If perspective-corrected parameter interpolation is not efficiently supported by the OpenGL implementation, hinting GL_DONT_CARE or GL_FASTEST can result in simple linear interpolation of colors and/or texture coordinates.
-
GL_POINT_SMOOTH_HINT
-
Indicates the sampling quality of antialiased points. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.
-
GL_POLYGON_SMOOTH_HINT
-
Indicates the sampling quality of antialiased polygons. Hinting GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.
-
mode
-
A symbolic constant indicating the desired behavior. The following symbolic constants are accepted:
-
GL_FASTEST
-
The most efficient option should be chosen.
-
GL_NICEST
-
The most correct, or highest quality, option should be chosen.
-
GL_DONT_CARE
-
The client doesn't have a preference.
Remarks
When there is room for interpretation, you can control certain aspects of OpenGL behavior with hints. You specify a hint with two arguments. The target parameter is a symbolic constant indicating the behavior to be controlled, and mode is another symbolic constant indicating the desired behavior.
Though the implementation aspects that can be hinted are well defined, the interpretation of the hints depends on the implementation.
The glHint function can be ignored.
Error Codes
The following are the error codes generated and their conditions.
Error Code |
Condition |
GL_INVALID_ENUM |
target or mode was not an accepted value. |
GL_INVALID_OPERATION |
glHint was called between a call to glBegin and the corresponding call to glEnd. |
QuickInfo
Windows NT: Use version 3.5 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in gl.h.
Import Library: Link with opengl32.lib.
See Also
glBegin, glEnd