Jamie Slowgrove - PGG Assignment 1 - SDL
 All Classes Functions
entity.h
1 #pragma once
2 #ifndef ENTITY_H
3 #define ENTITY_H
4 
5 #include <SDL.h>
6 #include "texture.h"
7 
13 class Entity
14 {
15 protected:
16  /*the Texture variable*/
17  Texture* texture;
18  /*variables for the source and destination dimensions*/
19  int srcWidth;
20  int srcHeight;
21  int srcX;
22  int srcY;
23  int width;
24  int height;
25  /*position*/
26  float x;
27  float y;
28 public:
38  Entity(Texture *, float, float, int, int);
39 
44  ~Entity();
45 
51  void display(SDL_Renderer *);
52 
58  void setX(float);
59 
65  void setY(float);
66 
71  float getX();
72 
77  float getY();
78 
84  void setSrcX(float);
85 
91  void setSrcY(float);
92 
97  int getSrcX();
98 
103  int getSrcY();
104 };
105 #endif
float getX()
Definition: entity.cpp:54
void setY(float)
Definition: entity.cpp:45
void setX(float)
Definition: entity.cpp:36
int getSrcX()
Definition: entity.cpp:90
int getSrcY()
Definition: entity.cpp:99
void setSrcX(float)
Definition: entity.cpp:72
void setSrcY(float)
Definition: entity.cpp:81
Creates an Entity object Creates an Entity object with a Texture (including variables for the source ...
Definition: entity.h:13
Creates a Texture for use with a renderer Creates a Texture from an image file, this can then be used...
Definition: texture.h:13
~Entity()
Definition: entity.cpp:20
Entity(Texture *, float, float, int, int)
Definition: entity.cpp:6
void display(SDL_Renderer *)
Definition: entity.cpp:27
float getY()
Definition: entity.cpp:63