Gel2D - The free/open source game creation suite

Public Member Functions
gel::GelCamera Class Reference

Camera. More...

#include <gelCamera.h>

Inheritance diagram for gel::GelCamera:
gel::GelObject gel::GelEventReceiver

List of all members.

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.

Detailed Description

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.

See also:
GelViewport

Constructor & Destructor Documentation

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.

Parameters:
vp: Pointer to a viewport.
gel::GelCamera::GelCamera ( Gel2dVec  cam_pos,
float  cam_rot,
Gel2dVec  cam_scl 
)

Convenience constructor.

Parameters:
cam_pos: The camera's x and y coordinates.
cam_rot: The rotation of the camera in degrees.
cam_scl: The camera's scale.

Member Function Documentation

void gel::GelCamera::setViewport ( GelViewport vp)

Sets the camera's viewport position and dimensions.

Sets the viewport that this camera will render into.

Parameters:
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.


The documentation for this class was generated from the following file: