]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Camera.h
added camera class
[l2e.git] / src / graphics / Camera.h
diff --git a/src/graphics/Camera.h b/src/graphics/Camera.h
new file mode 100644 (file)
index 0000000..16c0caf
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Camera.h
+ *
+ *  Created on: Sep 29, 2012
+ *      Author: holy
+ */
+
+#ifndef GRAPHICS_CAMERA_H_
+#define GRAPHICS_CAMERA_H_
+
+#include "../geometry/Vector.h"
+
+namespace graphics {
+
+class Camera {
+
+public:
+       Camera(int width, int height, const geometry::Vector<int> *target);
+       ~Camera() { }
+
+public:
+       void Resize(int w, int h) { halfWidth = w / 2; halfHeight = h / 2; }
+       void SetTarget(const geometry::Vector<int> *t);
+
+       geometry::Vector<int> CalculateOffset() const;
+
+private:
+       const geometry::Vector<int> *target;
+       int halfWidth;
+       int halfHeight;
+
+};
+
+}
+
+#endif /* GRAPHICS_CAMERA_H_ */