我想得到当前的视口矩阵,用
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT,viewport);后发现viewport[0]和viewport[1]是两个很大很大的数,而viewport[2]和viewport[3]的值也不正确,我已经在reshape函数中写了glViewport(0,0,w,h),不知道为什么。。
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT,viewport);后发现viewport[0]和viewport[1]是两个很大很大的数,而viewport[2]和viewport[3]的值也不正确,我已经在reshape函数中写了glViewport(0,0,w,h),不知道为什么。。
你看这个,别人是怎么说的!
http://chiefman.blog.hexun.com/5400795_d.html
MSDN:
The params parameter returns four values: the x and y window coordinates of the viewport, followed by its width and height. See glViewport.