本文整理汇总了C++中MapWindowProjection::SetScreenSize方法的典型用法代码示例。如果您正苦于以下问题:C++ MapWindowProjection::SetScreenSize方法的具体用法?C++ MapWindowProjection::SetScreenSize怎么用?C++ MapWindowProjection::SetScreenSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapWindowProjection
的用法示例。
在下文中一共展示了MapWindowProjection::SetScreenSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sun_azimuth
void
TerrainPreviewWindow::OnPaint(Canvas &canvas)
{
const GlueMapWindow *map = UIGlobals::GetMap();
if (map == nullptr)
return;
MapWindowProjection projection = map->VisibleProjection();
if (!projection.IsValid()) {
/* TODO: initialise projection to middle of map instead of bailing
out */
canvas.ClearWhite();
return;
}
projection.SetScreenSize(canvas.GetSize());
projection.SetScreenOrigin(canvas.GetWidth() / 2, canvas.GetHeight() / 2);
Angle sun_azimuth(Angle::Degrees(-45));
if (renderer.GetSettings().slope_shading == SlopeShading::SUN &&
CommonInterface::Calculated().sun_data_available)
sun_azimuth = CommonInterface::Calculated().sun_azimuth;
renderer.Generate(projection, sun_azimuth);
#ifdef ENABLE_OPENGL
/* enable clipping because the OpenGL terrain renderer uses a large
texture that exceeds the window dimensions */
GLCanvasScissor scissor(canvas);
#endif
renderer.Draw(canvas, projection);
}
示例2: renderer
void
TerrainDisplayConfigPanel::OnPreviewPaint(Canvas &canvas)
{
TerrainRenderer renderer(terrain);
renderer.SetSettings(terrain_settings);
MapWindowProjection projection =
XCSoarInterface::main_window.GetProjection();
projection.SetScreenSize(canvas.get_width(), canvas.get_height());
projection.SetScreenOrigin(canvas.get_width() / 2, canvas.get_height() / 2);
Angle sun_azimuth(Angle::Degrees(fixed(-45)));
if (terrain_settings.slope_shading == SlopeShading::SUN &&
XCSoarInterface::Calculated().sun_data_available)
sun_azimuth = XCSoarInterface::Calculated().sun_azimuth;
renderer.Generate(projection, sun_azimuth);
renderer.Draw(canvas, projection);
}