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

Method Texture3Effect

GTE/Graphics/Texture3Effect.cpp:12–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace gte;
11
12Texture3Effect::Texture3Effect(std::shared_ptr<ProgramFactory> const& factory,
13 std::shared_ptr<Texture3> const& texture, SamplerState::Filter filter,
14 SamplerState::Mode mode0, SamplerState::Mode mode1, SamplerState::Mode mode2)
15 :
16 mTexture(texture)
17{
18 int32_t api = factory->GetAPI();
19 mProgram = factory->CreateFromSources(*msVSSource[api], *msPSSource[api], "");
20 if (mProgram)
21 {
22 mSampler = std::make_shared<SamplerState>();
23 mSampler->filter = filter;
24 mSampler->mode[0] = mode0;
25 mSampler->mode[1] = mode1;
26 mSampler->mode[2] = mode2;
27
28 mProgram->GetVertexShader()->Set("PVWMatrix", mPVWMatrixConstant);
29 mProgram->GetPixelShader()->Set("baseTexture", mTexture, "baseSampler", mSampler);
30 }
31}
32
33void Texture3Effect::SetPVWMatrixConstant(std::shared_ptr<ConstantBuffer> const& buffer)
34{

Callers

nothing calls this directly

Calls 3

CreateFromSourcesMethod · 0.80
GetAPIMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected