Camera. More...
#include <gelCamera.h>
Public Member Functions | |
GelCamera () | |
Default constructor. | |
GelCamera (GelViewport *vp) | |
Convenience constructor. | |
GelCamera (Gel2dVec cam_pos, float cam_rot, Gel2dVec cam_scl) | |
Convenience constructor. | |
void | setViewport (GelViewport *vp) |
Sets the camera's viewport position and dimensions. | |
Gel3x3Matrix | getViewMatrix () const |
void | render (int width, int height) |
Renders the camera with the specified width and height. | |
void | render () |
Renders the camera. |
Camera.
A camera provides a way of 'looking' at a scene. It will render into a viewport specified by the user. If a viewport isn't given, it will use a default viewport which will fill the entire window, which is usually the desired effect.
Multiple cameras can also use the same viewport, allowing you to render multiple layers (i.e. GUI, HUD, cursor, etc.), without having to reset the viewport, which could be expensive if used excessively.
gel::GelCamera::GelCamera | ( | ) |
Default constructor.
Constructs a default viewport for the camera to render into.
gel::GelCamera::GelCamera | ( | GelViewport * | vp | ) |
Convenience constructor.
Sets the viewport that this camera will render into.
vp | : Pointer to a viewport. |
Convenience constructor.
cam_pos | : The camera's x and y coordinates. |
cam_rot | : The rotation of the camera in degrees. |
cam_scl | : The camera's scale. |
void gel::GelCamera::setViewport | ( | GelViewport * | vp | ) |
Sets the camera's viewport position and dimensions.
Sets the viewport that this camera will render into.
vp | : Pointer to a viewport. |
Gel3x3Matrix gel::GelCamera::getViewMatrix | ( | ) | const |
void gel::GelCamera::render | ( | int | width, |
int | height | ||
) |
Renders the camera with the specified width and height.
void gel::GelCamera::render | ( | ) | [virtual] |
Renders the camera.
This function sets up the viewport attached to this camera, sets the 2d orthogonal projection, and orients the viewpoint by which the scene will be rendered.
Reimplemented from gel::GelObject.
API Documentation by Mark D. Procarione | Generated by |