To main page
is 1 by 4 matrix, used in OpenGL
[x, y, width, height]
x,y specify coordinates of lower-left point
on user's screen, usually x=0, y=0.
specify inner width and height of OpenGL window.
Is it a matrix ?
Well, it isn't a matrix per se, more like 4 integers, because most of the code I've seen actually uses usual math, rather than matrix math
, when dealing with the viewport data.
It is usually set by
It can be get back by
ar is reference to array of 4 elements (x,y,width,height).
the call would be
Note that this matrix is set and read in integers
Center of viewport