glViewport
NAME
函数名
glViewport -- set the viewport
设置视口
C SPECIFICATION
C 风格
void glViewport(GLint x,
GLint y,
GLsizei width,
GLsizei height)
(GLsizei 32位整数 对应C中的long 可接后缀l)
PARAMETERS
参数
x, y
Specify the lower left corner of the viewport rectangle, in pixels. The default is (0, 0).
以像素的形式指定矩形视口的左下角。默认为(0,0)。
width, height
Specify the width and height, respectively, of the viewport. When a GL context is first attached to a window, width and height are set to the dimensions of that window.
依次指定视口的宽和高。当一个GL环境第一次加载到一个窗口时,需要给那个窗口设定宽和高。
DESCRIPTION
描述
glViewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (xnd, ynd) be normalized device coordinates. Then the window coordinates (xw, yw) are computed as follows:
glViewport 定义把放射坐标的x和y从规范的设备坐标转换成窗口坐标。使xy成为规范的设备坐标。然后按如下规则转换成窗口坐标:
Viewport width and height are silently clamped to a range that depends on the implementation. This range is queried by calling glGet with argument GL_MAX_VIEWPORT_DIMS.
视口的宽度和高度被静默的转换在一个基于设备的范围内。这个范围由glGet的参数GL_MAX_VIEWPORT_DIMS来询问(设置?)。
ERRORS
(错误不翻译了,这么简单,没复杂语法,没复杂时态,没复杂句子结构)
GL_INVALID_VALUE is generated if either width or height is negative.
GL_INVALID_OPERATION is generated if glViewport is executed between the execution of glBegin and the corresponding execution of glEnd.
NAME
函数名
glViewport -- set the viewport
设置视口
C SPECIFICATION
C 风格
void glViewport(GLint x,
GLint y,
GLsizei width,
GLsizei height)
(GLsizei 32位整数 对应C中的long 可接后缀l)
PARAMETERS
参数
x, y
Specify the lower left corner of the viewport rectangle, in pixels. The default is (0, 0).
以像素的形式指定矩形视口的左下角。默认为(0,0)。
width, height
Specify the width and height, respectively, of the viewport. When a GL context is first attached to a window, width and height are set to the dimensions of that window.
依次指定视口的宽和高。当一个GL环境第一次加载到一个窗口时,需要给那个窗口设定宽和高。
DESCRIPTION
描述
glViewport specifies the affine transformation of x and y from normalized device coordinates to window coordinates. Let (xnd, ynd) be normalized device coordinates. Then the window coordinates (xw, yw) are computed as follows:
glViewport 定义把放射坐标的x和y从规范的设备坐标转换成窗口坐标。使xy成为规范的设备坐标。然后按如下规则转换成窗口坐标:
Viewport width and height are silently clamped to a range that depends on the implementation. This range is queried by calling glGet with argument GL_MAX_VIEWPORT_DIMS.
视口的宽度和高度被静默的转换在一个基于设备的范围内。这个范围由glGet的参数GL_MAX_VIEWPORT_DIMS来询问(设置?)。
ERRORS
(错误不翻译了,这么简单,没复杂语法,没复杂时态,没复杂句子结构)
GL_INVALID_VALUE is generated if either width or height is negative.
GL_INVALID_OPERATION is generated if glViewport is executed between the execution of glBegin and the corresponding execution of glEnd.