Camera.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef INCLUDE_CAMERA_H
  2. #define INCLUDE_CAMERA_H
  3. namespace WalrusRPG
  4. {
  5. class Camera
  6. {
  7. protected:
  8. // So, how will track camera's position? Top left or center?
  9. unsigned x; // You'll probably want to switch over signed coordonates.
  10. unsigned y;
  11. unsigned render_area_width; // What if you only want to display the map on a part of the screen?
  12. unsigned render_area_height;
  13. // Do you want to use classes for coordinates and allow them to have vector-based mathematics? With operator overriding that could be doable to have
  14. // Vector2 a(3, 2); Vector2 b(1, 2); Vector3 c = a+b;
  15. // Vector2 destination;
  16. // Vector2 velocity;
  17. // Vector2 acceleration;
  18. public:
  19. Camera(unsigned x, unsigned y);
  20. ~Camera();
  21. // This doesn't need any render as it's the utility which helps rendering. Unless you want to show debnug things.
  22. // void render(float dt) const;
  23. void update(unsigned dt);
  24. void set_x(unsigned x);
  25. unsigned get_x() const;
  26. void set_y(unsigned y);
  27. unsigned get_y() const;
  28. };
  29. }
  30. #endif