当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseGroundDrawer::DrawTrees方法代码示例

本文整理汇总了C++中CBaseGroundDrawer::DrawTrees方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseGroundDrawer::DrawTrees方法的具体用法?C++ CBaseGroundDrawer::DrawTrees怎么用?C++ CBaseGroundDrawer::DrawTrees使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBaseGroundDrawer的用法示例。


在下文中一共展示了CBaseGroundDrawer::DrawTrees方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Draw

void CWorldDrawer::Draw()
{
	SCOPED_TIMER("WorldDrawer::Total");

	CBaseGroundDrawer* gd = readmap->GetGroundDrawer();

	if (globalRendering->drawSky) {
		sky->Draw();
	}

	if (globalRendering->drawGround) {
		SCOPED_TIMER("WorldDrawer::Terrain");
		gd->Draw(DrawPass::Normal);
		smoothHeightMeshDrawer->Draw(1.0f);
		treeDrawer->DrawGrass();
		gd->DrawTrees();
	}

	if (globalRendering->drawWater && !mapInfo->map.voidWater) {
		SCOPED_TIMER("WorldDrawer::Water");

		water->OcclusionQuery();
		if (water->IsDrawSolid()) {
			water->UpdateWater(game);
			water->Draw();
		}
	}

	selectedUnits.Draw();
	eventHandler.DrawWorldPreUnit();

	{
		SCOPED_TIMER("WorldDrawer::Models");
		DebugColVolDrawer::Draw();
		unitDrawer->Draw(false);
		modelDrawer->Draw();
		featureDrawer->Draw();

		pathDrawer->DrawAll();
	}

	//! transparent stuff
	glEnable(GL_BLEND);
	glDepthFunc(GL_LEQUAL);

	const bool noAdvShading = shadowHandler->shadowsLoaded;

	static const double plane_below[4] = {0.0f, -1.0f, 0.0f, 0.0f};
	static const double plane_above[4] = {0.0f,  1.0f, 0.0f, 0.0f};

	{
		glClipPlane(GL_CLIP_PLANE3, plane_below);
		glEnable(GL_CLIP_PLANE3);

		//! draw cloaked objects below water surface
		unitDrawer->DrawCloakedUnits(noAdvShading);
		featureDrawer->DrawFadeFeatures(noAdvShading);

		glDisable(GL_CLIP_PLANE3);
	}

	//! draw water
	if (globalRendering->drawWater && !mapInfo->map.voidWater) {
		SCOPED_TIMER("WorldDrawer::Water");

		if (!water->IsDrawSolid()) {
			//! Water rendering will overwrite features, so save them
			featureDrawer->SwapFeatures();
			water->UpdateWater(game);
			water->Draw();
			featureDrawer->SwapFeatures();
		}
	}

	{
		glClipPlane(GL_CLIP_PLANE3, plane_above);
		glEnable(GL_CLIP_PLANE3);

		//! draw cloaked objects above water surface
		unitDrawer->DrawCloakedUnits(noAdvShading);
		featureDrawer->DrawFadeFeatures(noAdvShading);

		glDisable(GL_CLIP_PLANE3);
	}

	{
		SCOPED_TIMER("WorldDrawer::Projectiles");
		projectileDrawer->Draw(false);
	}

	if (globalRendering->drawSky) {
		sky->DrawSun();
	}

	eventHandler.DrawWorld();

	LuaUnsyncedCtrl::DrawUnitCommandQueues();
	if (cmdColors.AlwaysDrawQueue() || guihandler->GetQueueKeystate()) {
		selectedUnits.DrawCommands();
	}
//.........这里部分代码省略.........
开发者ID:TheMak,项目名称:spring,代码行数:101,代码来源:WorldDrawer.cpp


注:本文中的CBaseGroundDrawer::DrawTrees方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。