X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fprojection.h;fp=source%2Fprojection.h;h=d38aa336cef69458c5bccdbc11cc43e1e72497c6;hb=bdf2568e247af858c4a1ca8004d97f13fe9b8cb0;hp=0000000000000000000000000000000000000000;hpb=7ef0e6407e21acdcd9865651a12b40d6a3cb3c0e;p=libs%2Fgl.git diff --git a/source/projection.h b/source/projection.h new file mode 100644 index 00000000..d38aa336 --- /dev/null +++ b/source/projection.h @@ -0,0 +1,54 @@ +/* $Id$ + +This file is part of libmspgl +Copyright © 2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + +#ifndef MSP_GL_PROJECTION_H_ +#define MSP_GL_PROJECTION_H_ + +namespace Msp { +namespace GL { + +/** +Sets up an orthogonal projection. +*/ +void ortho(double, double, double, double, double, double); + +/** +Sets up an orthogonal projection, with origin at the center of the screen. +*/ +void ortho_centered(double, double); + +/** +Sets up an orthogonal projection, with origin at the bottom left corner of the +screen. +*/ +void ortho_bottomleft(double, double); + +/** +Sets up an orthogonal projection, with origin at the top left corner of the +screen. The Y coordinate is reversed and grows downwards. +*/ +void ortho_topleft(double, double); + +/** +Sets up a perspective projection. +*/ +void frustum(double, double, double, double, double, double); + +/** +Sets up a perspective projection, with origin at the center of the screen. +*/ +void frustum_centered(double width, double height, double near, double far); + +/** +Sets up a centered perspective projection in a simple way. +*/ +void perspective(double fov_y, double aspect, double near, double far); + +} // namespace GL +} // namespace Msp + +#endif