filename | src/pvr2/glutil.c |
changeset | 1236:d93175c36387 |
prev | 1223:61684ca88599 |
next | 1245:01e0020adf88 |
author | nkeynes |
date | Fri Feb 24 21:17:47 2012 +1000 (12 years ago) |
permissions | -rw-r--r-- |
last change | Factor video_width/video_height out into video_gl.c Convert immediate-mode bits in video_gl.c into a structure for glDrawArray Move setOrtho into defineOrthoMatrix in glutil.c Rearrange various GL settings to keep a consistent state |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/glutil.c Wed Feb 15 18:09:02 2012 +10001.2 +++ b/src/pvr2/glutil.c Fri Feb 24 21:17:47 2012 +10001.3 @@ -125,6 +125,33 @@1.6 /**1.7 + * Define an orthographic projection matrix1.8 + * Note: row-major order1.9 + */1.10 +void defineOrthoMatrix( GLfloat *matrix, GLfloat width, GLfloat height, GLfloat znear, GLfloat zfar )1.11 +{1.12 + matrix[0] = 2/width;1.13 + matrix[1] = 0;1.14 + matrix[2] = 0;1.15 + matrix[3] = 0;1.16 +1.17 + matrix[4] = 0;1.18 + matrix[5] = -2/height;1.19 + matrix[6] = 0;1.20 + matrix[7] = 0;1.21 +1.22 + matrix[8] = 0;1.23 + matrix[9] = 0;1.24 + matrix[10]= -2/(zfar-znear);1.25 + matrix[11]= 0;1.26 +1.27 + matrix[12]= -1;1.28 + matrix[13]= 1;1.29 + matrix[14]= -(zfar+znear)/(zfar-znear);1.30 + matrix[15]= 1;1.31 +}1.32 +1.33 +/**1.34 * Format a GL extension list (or other space-separated string) nicely, and1.35 * print to the given output stream.1.36 */
.