| 55 | } |
| 56 | |
| 57 | void DrapeApiRenderer::Render(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng, |
| 58 | ScreenBase const & screen, FrameValues const & frameValues) |
| 59 | { |
| 60 | if (m_properties.empty()) |
| 61 | return; |
| 62 | |
| 63 | auto const & glyphParams = df::VisualParams::Instance().GetGlyphVisualParams(); |
| 64 | for (auto const & property : m_properties) |
| 65 | { |
| 66 | math::Matrix<float, 4, 4> const mv = screen.GetModelView(property->m_center, kShapeCoordScalar); |
| 67 | for (auto const & bucket : property->m_buckets) |
| 68 | { |
| 69 | auto program = mng->GetProgram(bucket.first.GetProgram<gpu::Program>()); |
| 70 | program->Bind(); |
| 71 | dp::ApplyState(context, program, bucket.first); |
| 72 | |
| 73 | auto const p = bucket.first.GetProgram<gpu::Program>(); |
| 74 | if (p == gpu::Program::TextOutlinedGui || p == gpu::Program::TextStaticOutlinedGui) |
| 75 | { |
| 76 | gpu::GuiProgramParams params; |
| 77 | frameValues.SetTo(params); |
| 78 | params.m_modelView = glsl::make_mat4(mv.m_data); |
| 79 | params.m_contrastGamma = glsl::vec2(glyphParams.m_guiContrast, glyphParams.m_guiGamma); |
| 80 | params.m_isOutlinePass = 0.0f; |
| 81 | mng->GetParamsSetter()->Apply(context, program, params); |
| 82 | } |
| 83 | else |
| 84 | { |
| 85 | gpu::MapProgramParams params; |
| 86 | frameValues.SetTo(params); |
| 87 | params.m_modelView = glsl::make_mat4(mv.m_data); |
| 88 | mng->GetParamsSetter()->Apply(context, program, params); |
| 89 | } |
| 90 | |
| 91 | bucket.second->Render(context, bucket.first.GetDrawAsLine()); |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | } // namespace df |
nothing calls this directly
no test coverage detected