Opengl Intro - glViewport
来源:互联网 发布:西门大妈知乎 编辑:程序博客网 时间:2024/05/18 08:40
glViewport function
The glViewport function sets the viewport.
Syntax
void WINAPI glViewport( GLint x, GLint y, GLsizei width, GLsizei height);
Parameters
- x
The lower-left corner of the viewport rectangle, in pixels. The default is (0,0).
- y
The lower-left corner of the viewport rectangle, in pixels. The default is (0,0).
- width
The width of the viewport. When an OpenGL context is first attached to a window,width and height are set to the dimensions of that window.
- height
The height of the viewport. When an OpenGL context is first attached to a window,width and height are set to the dimensions of that window.
Return value
This function does not return a value.
Error codes
The following error codes can be retrieved by the glGetError function.
- GL_INVALID_VALUE
Either width or height was negative.
- GL_INVALID_OPERATION
The function was called between a call to glBegin and the corresponding call to glEnd.
Error codes
The following error codes can be retrieved by the glGetError function.
- GL_INVALID_VALUE
Either width or height was negative.
- GL_INVALID_OPERATION
The function was called between a call to glBegin and the corresponding call to glEnd.
Remarks
The glViewport function specifies the affine transformation ofx and y from normalized device coordinates to window coordinates. Let (xnd , ynd ) be normalized device coordinates. The window coordinates (xw , yw ) are then computed as follows:
(Xw - x) / width = (Xnd - (-1)) / 2 =>
(Yw - y) / height / (Ynd - (-1)) / 2 =>
Viewport width and height are silently clamped to a range that depends on the implementation. This range is queried by callingglGet with argument GL_MAX_VIEWPORT_DIMS.
The following functions retrieve information related to glViewport:
glGet with argument GL_VIEWPORT
glGet with argument GL_MAX_VIEWPORT_DIMS
Requirements
Minimum supported client
Minimum supported server
Header
- Gl.h
Library
- Opengl32.lib
DLL
- Opengl32.dll
- Opengl Intro - glViewport
- [OpenGL]glViewport
- 3.android opengl glViewport()
- OPENGL中的glViewport
- OpenGL函数思考-glViewport
- OpenGL函数思考-glViewport
- OpenGL -- glutReshapeFunc glViewport
- 笔记:OpenGL SuperBible - Intro
- opengl之—gluOtho2d及glViewport
- OpenGL视口变换函数:glViewport
- OpenGL视口变换函数:glViewport
- OpenGL QT glViewport 函数的作用
- OpenGL多视口变换函数:glViewport使用
- (7)OpenGL多视口变换函数:glViewport使用
- opengl中的glViewport,glOrtho,glFrustum 理解
- OpenGL视口变换函数:glViewport
- glViewport
- glViewport
- Android中ViewHolder模式开发的详细解释
- B树,B-树,B+树,B*树
- Esper之事件——篇2(esper Reference)
- Android 仿酷狗滑动控件实现 流畅运行
- 使用全局变量的四种方式:extern、AppDelegate、定义单例对象、NSUserDefaults 和单例工厂的使用方法
- Opengl Intro - glViewport
- c 实现的shell
- 反渗透设备:反渗透设备工艺先进
- IRQ与FIQ的区别
- Eclipse中注释部分的签名
- BZOJ 1483 [HNOI2009]梦幻布丁 链式前向星+启发式合并
- Java 字符的验证
- TelephonyManager类的方法详解
- java使用poi处理excel防止数字变成科学计数法的形式