diff window/surface.h @ 0:223b71206888

Initial import
author thib
date Fri, 01 Aug 2008 16:32:45 +0000
parents
children 5ae5533b3a9a
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/window/surface.h
@@ -0,0 +1,16 @@
+#ifndef __SURFACE_H__
+#define __SURFACE_H__
+
+#include<SDL.h>
+#include"rect.h"
+
+struct Surface : public SDL_Surface {
+	char* mem(const Rect& r) {
+		return (char*)(pixels) + r.ty * pitch + r.lx * format->BytesPerPixel;
+	}
+	char* mem_end(const Rect& r) {
+		return (char*)(pixels) + (r.by-1) * pitch + r.rx * format->BytesPerPixel;
+	}
+};
+
+#endif /* __SURFACE_H__ */