Area.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/Color.hpp>
9 #include <ewol/debug.hpp>
11 #include <gale/resource/Program.hpp>
13 #include <egami/Image.hpp>
14 #include <ememory/memory.hpp>
15 
16 namespace ewol {
17  namespace compositing {
18  class Area : public ewol::Compositing {
19  private:
20  vec3 m_position;
21  etk::Color<> m_color;
22  private:
24  int32_t m_GLPosition;
25  int32_t m_GLMatrix;
26  int32_t m_GLColor;
27  int32_t m_GLtexture;
28  int32_t m_GLtexID;
29  private:
31  std::vector<vec3 > m_coord;
32  std::vector<vec2 > m_coordTex;
33  std::vector<etk::Color<float> > m_coordColor;
34  private:
38  void loadProgram();
39  public:
44  Area(const ivec2& _size);
48  virtual ~Area();
49  public:
53  void draw(bool _disableDepthTest=true);
57  void clear();
62  const vec3& getPos() {
63  return m_position;
64  };
69  void setPos(const vec3& _pos) {
70  m_position = _pos;
71  };
72  inline void setPos(const vec2& _pos) {
73  setPos(vec3(_pos.x(),_pos.y(),0));
74  };
79  void setRelPos(const vec3& _pos) {
80  m_position += _pos;
81  };
82  inline void setRelPos(const vec2& _pos) {
83  setRelPos(vec3(_pos.x(),_pos.y(),0));
84  };
89  void print(const ivec2& _size);
90 
91  egami::Image& get() {
92  return m_resource->get();
93  };
94  void flush() {
95  m_resource->flush();
96  };
97  };
98  };
99 };
const T & x() const
const vec3 & getPos()
get the current display position (sometime needed in the gui control)
Definition: Area.hpp:62
Area(const ivec2 &_size)
generic constructor
virtual ~Area()
generic destructor
void setRelPos(const vec3 &_pos)
set relative position for the next text writen
Definition: Area.hpp:79
Definition: Area.hpp:18
void setPos(const vec3 &_pos)
set position for the next text writen
Definition: Area.hpp:69
Definition: Area.hpp:16
const T & y() const
void clear()
clear alll the registered element in the current element
Definition: Compositing.hpp:13
void draw(bool _disableDepthTest=true)
draw All the refistered text in the current element on openGL
void print(const ivec2 &_size)
add a compleate of the image to display with the requested size