]> git.tdb.fi Git - libs/gl.git/blob - source/projection.h
Add projection functions
[libs/gl.git] / source / projection.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_PROJECTION_H_
9 #define MSP_GL_PROJECTION_H_
10
11 namespace Msp {
12 namespace GL {
13
14 /**
15 Sets up an orthogonal projection.
16 */
17 void ortho(double, double, double, double, double, double);
18
19 /**
20 Sets up an orthogonal projection, with origin at the center of the screen.
21 */
22 void ortho_centered(double, double);
23
24 /**
25 Sets up an orthogonal projection, with origin at the bottom left corner of the
26 screen.
27 */
28 void ortho_bottomleft(double, double);
29
30 /**
31 Sets up an orthogonal projection, with origin at the top left corner of the
32 screen.  The Y coordinate is reversed and grows downwards.
33 */
34 void ortho_topleft(double, double);
35
36 /**
37 Sets up a perspective projection.
38 */
39 void frustum(double, double, double, double, double, double);
40
41 /**
42 Sets up a perspective projection, with origin at the center of the screen.
43 */
44 void frustum_centered(double width, double height, double near, double far);
45
46 /**
47 Sets up a centered perspective projection in a simple way.
48 */
49 void perspective(double fov_y, double aspect, double near, double far);
50
51 } // namespace GL
52 } // namespace Msp
53
54 #endif