| 10 | using namespace gte; |
| 11 | |
| 12 | LightEffect::LightEffect(std::shared_ptr<ProgramFactory> const& factory, |
| 13 | BufferUpdater const& updater, |
| 14 | ProgramSources const& vsSource, |
| 15 | ProgramSources const& psSource, |
| 16 | std::shared_ptr<Material> const& material, |
| 17 | std::shared_ptr<Lighting> const& lighting, |
| 18 | std::shared_ptr<LightCameraGeometry> const& geometry) |
| 19 | : |
| 20 | mMaterial(material), |
| 21 | mLighting(lighting), |
| 22 | mGeometry(geometry) |
| 23 | { |
| 24 | int32_t api = factory->GetAPI(); |
| 25 | mProgram = factory->CreateFromSources(*vsSource[api], *psSource[api], ""); |
| 26 | if (mProgram) |
| 27 | { |
| 28 | mBufferUpdater = updater; |
| 29 | mProgram->GetVertexShader()->Set("PVWMatrix", mPVWMatrixConstant); |
| 30 | } |
| 31 | else |
| 32 | { |
| 33 | LogError("Failed to compile shader programs."); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | void LightEffect::SetPVWMatrixConstant(std::shared_ptr<ConstantBuffer> const& buffer) |
| 38 | { |
nothing calls this directly
no test coverage detected