~ubuntu-branches/ubuntu/trusty/psychtoolbox-3/trusty-proposed

« back to all changes in this revision

Viewing changes to Psychtoolbox/PsychOpenGL/MOGL/wrap/glOrthof.m

  • Committer: Package Import Robot
  • Author(s): Yaroslav Halchenko
  • Date: 2013-11-19 23:34:50 UTC
  • mfrom: (3.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20131119233450-f7nf92vb8qavjmk8
Tags: 3.0.11.20131017.dfsg1-3
Upload to unsable since fresh glew has arrived to sid!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function glOrthof( left, right, bottom, top, zNear, zFar )
 
2
 
 
3
% glOrthof  Interface to OpenGL-ES function glOrthof
 
4
%
 
5
% usage:  glOrthof( left, right, bottom, top, zNear, zFar )
 
6
%
 
7
% C function:  void glOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
 
8
 
 
9
% 25-Mar-2011 -- created (generated automatically from header files)
 
10
%  4-Apr-2013 Made compatible with OpenGL-ES.
 
11
 
 
12
% ---protected---
 
13
 
 
14
if nargin~=6,
 
15
    error('invalid number of arguments');
 
16
end
 
17
 
 
18
if ~IsGLES
 
19
    moglcore( 'glOrtho', left, right, bottom, top, zNear, zFar );
 
20
    return;
 
21
end
 
22
 
 
23
m = zeros(4,4);
 
24
m(1,1) = 2 / (right - left);
 
25
m(2,2) = 2 / (top - bottom);
 
26
m(3,3) = -2 / (zFar - zNear);
 
27
m(4,4) = 1;
 
28
m(1,4) = -(right + left) / (right - left);
 
29
m(2,4) = -(top + bottom) / (top - bottom);
 
30
m(3,4) = -(zFar + zNear) / (zFar - zNear);
 
31
 
 
32
% TODO FIXME: Need m transposed m' ?
 
33
glMultMatrixf(m);
 
34
 
 
35
return