Support layer and interaction transparancy. Refs #1
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "utils.hpp"
|
||||
|
||||
namespace fmri
|
||||
{
|
||||
class Animation
|
||||
@@ -10,5 +12,21 @@ namespace fmri
|
||||
|
||||
virtual void draw(float step) = 0;
|
||||
|
||||
private:
|
||||
static float getAlpha();
|
||||
|
||||
protected:
|
||||
template<typename It>
|
||||
void patchTransparancy(It begin, It end)
|
||||
{
|
||||
if constexpr (std::tuple_size<Color>::value >= 4) {
|
||||
const auto alpha = getAlpha();
|
||||
for (; begin != end; ++begin) {
|
||||
Color &color = *begin;
|
||||
color[3] = alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user