![]() |
Dauphine
0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
|
The camera class. More...
#include <Camera.h>
Public Member Functions | |
| Camera (Entity *const entity_) | |
| The constructor. More... | |
| ~Camera () | |
| The destructor. | |
| void | update () |
| Updates the camera. More... | |
| void | centralizeOn (Entity *const entity_) |
| Changes the entity to centralize upon. More... | |
| SDL_Rect & | getClip () |
| void | setLevelWH (const unsigned int width_, const unsigned int height_) |
Private Member Functions | |
| void | updatePosition () |
| Updates the cameras position. More... | |
Private Attributes | |
| Entity * | entity |
| Reference to the entity. More... | |
| unsigned int | levelW |
| The width of the level. More... | |
| unsigned int | levelH |
| The height of the level. More... | |
| SDL_Rect | clip |
Clip which will be used to clip the rendering only to the extent of the camera. More... | |
The camera class.
Contains all the relevant implementation relative to the camera.
| Camera::Camera | ( | Entity *const | entity_) |
The constructor.
Initializes all the attributes.
| entity_ | : The entity to centralize the camera on. |
| void Camera::centralizeOn | ( | Entity *const | entity_) |
Changes the entity to centralize upon.
| entity_ | : The entity to centralize the camera on. |
| SDL_Rect & Camera::getClip | ( | ) |
| void Camera::setLevelWH | ( | const unsigned int | width_, |
| const unsigned int | height_ | ||
| ) |
| width_,height_ | : Tells the camera what the width and height of the level is. |
| void Camera::update | ( | ) |
Updates the camera.
|
private |
Updates the cameras position.
Based on the players position, change cameras position.
|
private |
Clip which will be used to clip the rendering only to the extent of
the camera.
|
private |
Reference to the entity.
|
private |
The height of the level.
|
private |
The width of the level.
1.8.4