41 SCORE_ASSERT(vec.size() == 2);
48 SCORE_ASSERT(vec.size() == 2);
49 fragment = std::move(vec[0]);
50 vertex = std::move(vec[1]);
63 const std::string_view language{};
66 static const inline std::array<MemberSpec, 2> specification{
67 MemberSpec{QObject::tr(
"Fragment"), &ShaderSource::fragment,
"GLSL"},
68 MemberSpec{QObject::tr(
"Vertex"), &ShaderSource::vertex,
"GLSL"},
71 friend QDebug& operator<<(QDebug& d,
const ShaderSource& sp)
73 return (d << sp.vertex << sp.fragment);
75 friend bool operator==(
const ShaderSource& lhs,
const ShaderSource& rhs)
noexcept
77 return lhs.vertex == rhs.vertex && lhs.fragment == rhs.fragment;
79 friend bool operator!=(
const ShaderSource& lhs,
const ShaderSource& rhs)
noexcept
85 operator==(
const std::vector<QString>& lhs,
const ShaderSource& rhs)
noexcept
87 SCORE_ASSERT(lhs.size() == 2);
88 return lhs[0] == rhs.*(ShaderSource::specification[0].pointer)
89 && lhs[1] == rhs.*(ShaderSource::specification[1].pointer);
92 operator!=(
const std::vector<QString>& lhs,
const ShaderSource& rhs)
noexcept
98ShaderSource programFromFragmentShaderPath(
const QString& fsFilename, QByteArray fsData);