Dauphine  0.1
A platforming/stealth game in a medieval fantasy setting, developed with SDL2.
Public Member Functions | Public Attributes | List of all members
Crosshair Class Reference

#include <Crosshair.h>

Public Member Functions

 Crosshair (const double x_, const double y_, Sprite *const sprite_)
 
virtual void update (const double dt_)
 Updates the entity. More...
 
virtual void render (const double cameraX_, const double cameraY_)
 Renders the entity. More...
 
unsigned int getWidth ()
 
unsigned int getHeight ()
 
- Public Member Functions inherited from Entity
virtual ~Entity ()
 The destructor.
 
unsigned int getWidth ()
 
unsigned int getHeight ()
 
SDL_Rect & getAnimationClip ()
 

Public Attributes

bool activated
 
- Public Attributes inherited from Entity
double x
 The position in the x axis. More...
 
double y
 The position in the y axis. More...
 
bool isRight
 The direction in the x axis. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Entity
 Entity (const double x_, const double y_, Sprite *const sprite_)
 The constructor. More...
 
- Protected Attributes inherited from Entity
Spritesprite
 The Sprite attributed to the entity. More...
 
unsigned int width
 The entitys width, from its sprite. More...
 
unsigned int height
 The entitys height, from its sprite. More...
 
SDL_Rect animationClip
 The current clip on the spritesheet, to determine animation. More...
 
SDL_Rect boundingBox
 

Detailed Description

Todo:
Refactor.

Member Function Documentation

void Crosshair::render ( const double  cameraX_,
const double  cameraY_ 
)
virtual

Renders the entity.

Pure virtual function. Purpose is to copy the entity's texture onto the renderer.

Note
Usually just calls the render method from the Sprite class.
Parameters
cameraX_: The x position of the camera.
cameraY_: The y position of the camera.

Implements Entity.

void Crosshair::update ( const double  dt_)
virtual

Updates the entity.

Pure virtual function. Purpose is to update whatever is necessary, relative to the entity.

Parameters
dt_: Delta time. Time elapsed between one frame and the other.

Implements Entity.


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