]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Sprite.h
added simple sprite class
[l2e.git] / src / graphics / Sprite.h
diff --git a/src/graphics/Sprite.h b/src/graphics/Sprite.h
new file mode 100644 (file)
index 0000000..5710ee5
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Sprite.h
+ *
+ *  Created on: Aug 5, 2012
+ *      Author: holy
+ */
+
+#ifndef GRAPHICS_SPRITE_H_
+#define GRAPHICS_SPRITE_H_
+
+#include <SDL.h>
+
+namespace graphics {
+
+class Sprite {
+
+public:
+       Sprite(SDL_Surface *s, int width, int height)
+       : surface(s), width(width), height(height) { }
+
+public:
+       int Width() const { return width; }
+       int Height() const { return height; }
+       void Draw(SDL_Surface *dest, int x, int y, int col = 0, int row = 0) const;
+
+private:
+       SDL_Surface *surface;
+       int width;
+       int height;
+
+};
+
+}
+
+#endif /* GRAPHICS_SPRITE_H_ */