remove direct use of rtt and dirty area from the layer
This commit is contained in:
@@ -3,9 +3,16 @@
|
||||
#include "log.h"
|
||||
#include "texture.h"
|
||||
|
||||
class LayerFrame
|
||||
struct LayerFrame
|
||||
{
|
||||
|
||||
std::array<RTT, 6> m_rtt;
|
||||
std::array<glm::vec4, 6> m_dirty_box = SIXPLETTE(glm::vec4(0));
|
||||
std::array<bool, 6> m_dirty_face = SIXPLETTE(false);
|
||||
int m_duration = 1;
|
||||
int w = 0, h = 0;
|
||||
LayerFrame() = default;
|
||||
bool create(int width, int height, int duration = 1);
|
||||
bool resize(int width, int height);
|
||||
};
|
||||
|
||||
class Layer
|
||||
@@ -14,11 +21,9 @@ class Layer
|
||||
public:
|
||||
Layer() { id = s_count++; }
|
||||
Layer(const Layer&) = delete;
|
||||
~Layer() { LOG("LAYER AUTO DESTROY"); destroy(); }
|
||||
uint32_t id;
|
||||
RTT m_rtt[6];
|
||||
std::array<glm::vec4, 6> m_dirty_box = SIXPLETTE(glm::vec4(0));
|
||||
std::array<bool, 6> m_dirty_face = SIXPLETTE(false);
|
||||
std::vector<LayerFrame> m_frames;
|
||||
int m_frame_index = 0;
|
||||
bool m_visible = true;
|
||||
bool m_alpha_locked = false;
|
||||
float m_opacity = 1.f;
|
||||
@@ -39,8 +44,13 @@ public:
|
||||
void optimize();
|
||||
int memsize() const;
|
||||
};
|
||||
RTT& rtt(int i);
|
||||
glm::vec4& box(int i);
|
||||
bool& face(int i);
|
||||
LayerFrame& frame();
|
||||
void resize(int width, int height);
|
||||
bool create(int width, int height, std::string name);
|
||||
bool add_frame();
|
||||
void clear(const glm::vec4& c);
|
||||
Snapshot snapshot(std::array<glm::vec4, 6>* dirty_box = nullptr, std::array<bool, 6>* dirty_face = nullptr);
|
||||
TextureCube gen_cube();
|
||||
|
||||
Reference in New Issue
Block a user