-
Notifications
You must be signed in to change notification settings - Fork 0
/
CDrawable.h
39 lines (29 loc) · 853 Bytes
/
CDrawable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef _CDRAWABLE_H_
#define _CDRAWABLE_H_
#ifdef _WIN32
# include <SDL\SDL.h>
#else
# include <SDL/SDL.h>
#endif
//! CDrawable, the most basic drawable object
/*!
Anything that is drawn should subclass this.
*/
class CDrawable
{
private:
CDrawable();
SDL_Rect* mRect;
SDL_Surface* mSurf;
public:
~CDrawable();
CDrawable( SDL_Surface* Surf, SDL_Rect* rect );
CDrawable( SDL_Surface* Surf, int x, int y, int w, int h );
SDL_Rect* getRect() { return mRect; }
void setRect( SDL_Rect* newRect ) { mRect = newRect; }
void setRect( int x, int y, int w, int h );
SDL_Surface* getSurface() { return mSurf; }
void setSurface( SDL_Surface* newSurf );
void OnDraw( SDL_Surface* Dest, SDL_Rect* DestRect = NULL );
};
#endif // _CDRAWABLE_H_