MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / ConstantColorEffect

Method ConstantColorEffect

GTE/Graphics/ConstantColorEffect.cpp:12–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace gte;
11
12ConstantColorEffect::ConstantColorEffect(std::shared_ptr<ProgramFactory> const& factory,
13 Vector4<float> const& color)
14{
15 int32_t api = factory->GetAPI();
16 mProgram = factory->CreateFromSources(*msVSSource[api], *msPSSource[api], "");
17 if (mProgram)
18 {
19 mColorConstant = std::make_shared<ConstantBuffer>(sizeof(Vector4<float>), true);
20 *mColorConstant->Get<Vector4<float>>() = color;
21
22 mProgram->GetVertexShader()->Set("PVWMatrix", mPVWMatrixConstant);
23 mProgram->GetVertexShader()->Set("ConstantColor", mColorConstant);
24 }
25}
26
27void ConstantColorEffect::SetPVWMatrixConstant(std::shared_ptr<ConstantBuffer> const& buffer)
28{

Callers

nothing calls this directly

Calls 3

CreateFromSourcesMethod · 0.80
GetAPIMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected