EngineLib
 All Classes Functions
SimpleSprite.h
1 /*
2  * SimpleSprite.h
3  *
4  * Created on: 13.10.2017
5  * Author: robert
6  */
7 
8 #ifndef SIMPLESPRITE_H_
9 #define SIMPLESPRITE_H_
10 #include <SDL2/SDL.h>
11 #include "BaseSprite.h"
12 
29 class SimpleSprite: public virtual BaseSprite {
30 public:
31  SimpleSprite();
32  SimpleSprite(const SimpleSprite &p2) {
33  texturewidth=p2.texturewidth;
34  textureheight=p2.textureheight;
35  }
36  virtual ~SimpleSprite();
40  void draw();
48  void init(SDL_Renderer *renderer);
53  int loadSprite(const char* filename);
58  int getWidth();
63  int getHeight();
64 private:
65  SDL_Renderer *renderer;
66  SDL_Texture *texture;
67  SDL_Rect dst;
68  int texturewidth,textureheight;
69 
70 };
71 
72 #endif /* SIMPLESPRITE_H_ */
Definition: SimpleSprite.h:29
void draw()
Definition: SimpleSprite.cpp:17
int loadSprite(const char *filename)
Definition: SimpleSprite.cpp:36
int getWidth()
Definition: SimpleSprite.cpp:54
void init(SDL_Renderer *renderer)
Definition: SimpleSprite.cpp:32
int getHeight()
Definition: SimpleSprite.cpp:58
Definition: BaseSprite.h:19