glViewport

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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值