Add shader registry (#924)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/programs/program_parameters.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
#include <string_view>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
@@ -15,11 +16,28 @@ ProgramParameters::ProgramParameters(const float pixelRatio,
|
||||
result += "#define OVERDRAW_INSPECTOR\n";
|
||||
}
|
||||
return result;
|
||||
}()) {
|
||||
}())
|
||||
{}
|
||||
|
||||
ProgramParameters ProgramParameters::withShaderSource(std::string_view vertexSource,
|
||||
std::string_view fragmentSource) const noexcept
|
||||
{
|
||||
ProgramParameters params = *this;
|
||||
params.vertexSource_ = vertexSource;
|
||||
params.fragmentSource_ = fragmentSource;
|
||||
return params;
|
||||
}
|
||||
|
||||
const std::string& ProgramParameters::getDefines() const {
|
||||
return defines;
|
||||
}
|
||||
|
||||
const std::string& ProgramParameters::vertexSource() const noexcept {
|
||||
return vertexSource_;
|
||||
}
|
||||
|
||||
const std::string& ProgramParameters::fragmentSource() const noexcept {
|
||||
return fragmentSource_;
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
Reference in New Issue
Block a user