Horizon
grid.hpp
1 #pragma once
2 #include "common/common.hpp"
3 #include <epoxy/gl.h>
4 
5 namespace horizon {
6 class Grid {
7  friend class CanvasGL;
8 
9 public:
10  Grid(class CanvasGL *c);
11  void realize();
12  void render();
13  void render_cursor(Coord<int64_t> &coord);
14  enum class Style { CROSS, DOT, GRID };
15 
16 private:
17  CanvasGL *ca;
18  int64_t spacing;
19  float mark_size;
20  Color color;
21  float alpha;
22  unsigned int mul = 0;
23 
24  GLuint program;
25  GLuint vao;
26  GLuint vbo;
27 
28  GLuint screenmat_loc;
29  GLuint scale_loc;
30  GLuint offset_loc;
31  GLuint grid_size_loc;
32  GLuint grid_0_loc;
33  GLuint grid_mod_loc;
34  GLuint mark_size_loc;
35  GLuint color_loc;
36 };
37 } // namespace horizon
Definition: grid.hpp:6
Definition: canvas_gl.hpp:10
Definition: block.cpp:7
Definition: common.hpp:205