| GLint | factor, |
GLushort | pattern ; |
指定線的網點格局。
Description
Line stippling masks out certain fragments produced by rasterization; those fragments will not be drawn. The masking is achieved by using three parameters: the 16-bit line stipple pattern
pattern
, the repeat count
factor
, and an integer stipple counter s .
Counter s is reset to 0 whenever glBegin is called and before each line segment of a glBegin(
GL_LINES
)/glEnd sequence is generated. It is incremented after each fragment of a unit width aliased line segment is generated or after each i fragments of an i width line segment are generated. The i fragments associated with count s are masked out if
pattern
bit s factor % 16
is 0, otherwise these fragments are sent to the frame buffer. Bit zero of
pattern
is the least significant bit.
Antialiased lines are treated as a sequence of 1 × width rectangles for purposes of stippling. Whether rectangle s is rasterized or not depends on the fragment rule described for aliased lines, counting rectangles rather than groups of fragments.
To enable and disable line stippling, call glEnable and glDisable with argument
GL_LINE_STIPPLE
. When enabled, the line stipple pattern is applied as described above. When disabled, it is as if the pattern were all 1's. Initially, line stippling is disabled.
Errors
GL_INVALID_OPERATION
is generated if
glLineStipple
is executed between the execution of glBegin and the corresponding execution of glEnd.
void glutPostRedisplay(void);
導緻顯示圖像的函數重新調用!
DescriptionMark the normal plane of current window as needing to be redisplayed. The next iteration through glutMainLoop, the window's display callback will be called to redisplay the window's normal plane. Multiple calls to glutPostRedisplay before the next display callback opportunity generates only a single redisplay callback. glutPostRedisplay may be called within a window's display or overlay display callback to re-mark that window for redisplay.
Logically, normal plane damage notification for a window is treated as a glutPostRedisplay on the damaged window. Unlike damage reported by the window system, glutPostRedisplay will not set to true the normal plane's damaged status (returned by glutLayerGet(GLUT_NORMAL_DAMAGED).
Also, see glutPostOverlayRedisplay.
| void ; |
指定用機關矩陣取代目前矩陣。
Description
glLoadIdentity
replaces the current matrix with the identity matrix. It is semantically equivalent to calling glLoadMatrix with the identity matrix
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1
but in some cases it is more efficient.
Errors
GL_INVALID_OPERATION
is generated if
glLoadIdentity
is executed between the execution of glBegin and the corresponding execution of glEnd.
Associated Gets
glGet with argument
GL_MATRIX_MODE
glGet with argument
GL_COLOR_MATRIX
glGet with argument
GL_MODELVIEW_MATRIX
glGet with argument
GL_PROJECTION_MATRIX
glGet with argument
GL_TEXTURE_MATRIX
| GLenum | mode ; |
指定目前矩陣。
mode
GL_MODELVIEW
, GL_PROJECTION
, and GL_TEXTURE
. The initial value is GL_MODELVIEW
. Additionally, if the ARB_imaging
extension is supported, GL_COLOR
is also accepted. Description
glMatrixMode
sets the current matrix mode. mode
can assume one of four values: - Applies subsequent matrix operations to the modelview matrix stack.
- Applies subsequent matrix operations to the projection matrix stack.
- Applies subsequent matrix operations to the texture matrix stack.
- Applies subsequent matrix operations to the color matrix stack.
GL_MODELVIEW
GL_PROJECTION
GL_TEXTURE
GL_COLOR
GL_MATRIX_MODE
. The initial value is GL_MODELVIEW
. Errors
GL_INVALID_ENUM
is generated if mode
is not an accepted value. GL_INVALID_OPERATION
is generated if glMatrixMode
is executed between the execution of glBegin and the corresponding execution of glEnd. Associated Gets
glGet with argumentGL_MATRIX_MODE
int glutCreateWindow(char *name);
建立一個頂層視窗!
void glutInitWindowSize(int width, int height);
void glutInitWindowPosition(int x, int y);
- width
- Width in pixels. height
- Height in pixels. x
- Window X location in pixels. y
- Window Y location in pixels.
Windows created by glutCreateWindow will be requested to be created with the current initial window position and size.
The initial value of the initial window position GLUT state is -1 and -1. If either the X or Y component to the initial window position is negative, the actual window position is left to the window system to determine. The initial value of the initial window size GLUT state is 300 by 300. The initial window size components must be greater than zero.
The intent of the initial window position and size values is to provide a suggestion to the window system for a window's initial size and position. The window system is not obligated to use this information. Therefore, GLUT programs should not assume the window was created at the specified size or position. A GLUT program should use the window's reshape callback to determine the true size of the window.
void glutInitDisplayMode(unsigned int mode);
設定初始顯示模式;
- mode
- Display mode, normally the bitwise OR-ing of GLUT display mode bit masks. See values below:
- GLUT_RGBA
- Bit mask to select an RGBA mode window. This is the default if neither GLUT_RGBA nor GLUT_INDEX are specified. GLUT_RGB
- An alias for GLUT_RGBA. GLUT_INDEX
- Bit mask to select a color index mode window. This overrides GLUT_RGBA if it is also specified. GLUT_SINGLE
- Bit mask to select a single buffered window. This is the default if neither GLUT_DOUBLE or GLUT_SINGLE are specified. GLUT_DOUBLE
- Bit mask to select a double buffered window. This overrides GLUT_SINGLE if it is also specified. GLUT_ACCUM
- Bit mask to select a window with an accumulation buffer. GLUT_ALPHA
- Bit mask to select a window with an alpha component to the color buffer(s). GLUT_DEPTH
- Bit mask to select a window with a depth buffer. GLUT_STENCIL
- Bit mask to select a window with a stencil buffer. GLUT_MULTISAMPLE
- Bit mask to select a window with multisampling support. If multisampling is not available, a non-multisampling window will automatically be chosen. Note: both the OpenGL client-side and server-side implementations must support the GLX_SAMPLE_SGIS extension for multisampling to be available. GLUT_STEREO
- Bit mask to select a stereo window. GLUT_LUMINANCE
- Bit mask to select a window with a ``luminance'' color model. This model provides the functionality of OpenGL's RGBA color model, but the green and blue components are not maintained in the frame buffer. Instead each pixel's red component is converted to an index between zero and glutGet(GLUT_WINDOW_COLORMAP_SIZE)-1 and looked up in a per-window color map to determine the color of pixels within the window. The initial colormap of GLUT_LUMINANCE windows is initialized to be a linear gray ramp, but can be modified with GLUT's colormap routines.
void glutInit(int *argcp, char **argv);
用于初始話GLUT庫
argcp
argv