summaryrefslogtreecommitdiffhomepage
path: root/src/camera-offset.hpp
blob: 88a1a08a41872e03a2d9eaf617b4366533f8895b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once
#include "global-coords.hpp"
#include <Magnum/Magnum.h>
#include <Magnum/Math/Vector2.h>

namespace floormat {

struct tile_shader;

struct with_shifted_camera_offset final
{
    explicit with_shifted_camera_offset(tile_shader& shader, chunk_coords_ c);
    explicit with_shifted_camera_offset(tile_shader& shader, chunk_coords_ c, chunk_coords first, chunk_coords last);
    ~with_shifted_camera_offset();

    static Vector2d get_offset(chunk_coords_ c);
private:
    tile_shader& _shader; // NOLINT
    Vector2d _camera;
};

} // namespace floormat