Symphony Of Empires
rivers.hpp
Go to the documentation of this file.
1 // Eng3D - General purpouse game engine
2 // Copyright (C) 2021, Eng3D contributors
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <https://www.gnu.org/licenses/>.
16 //
17 // ----------------------------------------------------------------------------
18 // Name:
19 // rivers.hpp
20 //
21 // Abstract:
22 // Does some important stuff.
23 // ----------------------------------------------------------------------------
24 
25 #pragma once
26 
27 #include <memory>
28 #include <vector>
29 #include "eng3d/curve.hpp"
30 
31 namespace Eng3D {
32  class Texture;
33  class Camera;
34  namespace OpenGL {
35  class Program;
36  }
37  class State;
38 
39  class Rivers {
40  Eng3D::State& s;
41  public:
42  Rivers(Eng3D::State& s, bool lazy_init = true);
43  ~Rivers() = default;
44 
45  void draw(const Eng3D::Camera& camera);
46  private:
47  void get_river(std::vector<glm::vec3>& river, int current_index, int prev_index, uint32_t* pixels, int width, int height);
48  void build_rivers();
49  std::vector<std::unique_ptr<Eng3D::Curve>> curves;
50  std::unique_ptr<Eng3D::OpenGL::Program> line_shader;
51  std::shared_ptr<Eng3D::Texture> water_tex;
52  };
53 }
Rivers(Eng3D::State &s, bool lazy_init=true)
Construct a new Eng3D::Rivers object.
Definition: rivers.cpp:37
void draw(const Eng3D::Camera &camera)
Definition: rivers.cpp:165
~Rivers()=default