X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FCamera.h;fp=src%2Fgraphics%2FCamera.h;h=16c0caf762b409124715280db364457f44831c5e;hb=e9bdecf5f58fb9e5b2c067c20d0ce70f54f9ecb7;hp=0000000000000000000000000000000000000000;hpb=4d4b40f06357392931cb309d0284875c40c2f2f0;p=l2e.git diff --git a/src/graphics/Camera.h b/src/graphics/Camera.h new file mode 100644 index 0000000..16c0caf --- /dev/null +++ b/src/graphics/Camera.h @@ -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 *target); + ~Camera() { } + +public: + void Resize(int w, int h) { halfWidth = w / 2; halfHeight = h / 2; } + void SetTarget(const geometry::Vector *t); + + geometry::Vector CalculateOffset() const; + +private: + const geometry::Vector *target; + int halfWidth; + int halfHeight; + +}; + +} + +#endif /* GRAPHICS_CAMERA_H_ */