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


C++ Stopwatch::msF方法代码示例

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


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

示例1: drawScene

		/// <summary>
		/// シーンを描画します。
		/// </summary>
		/// <returns>
		/// なし
		/// </returns>
		void drawScene() const
		{
			if (!m_current)
			{
				return;
			}

			if (m_transitionState == TransitionState::Active || !m_transitionTimeMillisec)
			{
				m_current->draw();
			}

			const double elapsed = m_stopwatch.msF();

			if (m_transitionState == TransitionState::FadeIn)
			{
				m_current->drawFadeIn(elapsed / m_transitionTimeMillisec);
			}
			else if (m_transitionState == TransitionState::FadeOut)
			{
				m_current->drawFadeOut(elapsed / m_transitionTimeMillisec);
			}
			else if (m_transitionState == TransitionState::FadeInOut)
			{
				m_current->drawFadeOut(elapsed / m_transitionTimeMillisec);

				if (m_next)
				{
					m_next->drawFadeIn(elapsed / m_transitionTimeMillisec);
				}
			}
		}
开发者ID:azaika,项目名称:OpenSiv3D,代码行数:38,代码来源:SceneManager.hpp

示例2: updateSingle

		bool updateSingle()
		{
			double elapsed = m_stopwatch.msF();

			if (m_transitionState == TransitionState::FadeOut && elapsed >= m_transitionTimeMillisec)
			{
				m_current = nullptr;

				m_current = m_factories[m_nextState]();

				if (hasError())
				{
					return false;
				}

				m_currentState = m_nextState;

				m_transitionState = TransitionState::FadeIn;

				m_stopwatch.restart();

				elapsed = 0.0;
			}

			if (m_transitionState == TransitionState::FadeIn && elapsed >= m_transitionTimeMillisec)
			{
				m_stopwatch.reset();

				m_transitionState = TransitionState::Active;
			}

			switch (m_transitionState)
			{
			case TransitionState::FadeIn:
				assert(m_transitionTimeMillisec);
				m_current->updateFadeIn(elapsed / m_transitionTimeMillisec);
				return !hasError();
			case TransitionState::Active:
				m_current->update();
				return !hasError();
			case TransitionState::FadeOut:
				assert(m_transitionTimeMillisec);
				m_current->updateFadeOut(elapsed / m_transitionTimeMillisec);
				return !hasError();
			default:
				return false;
			}
		}
开发者ID:azaika,项目名称:OpenSiv3D,代码行数:48,代码来源:SceneManager.hpp

示例3: updateCross

		bool updateCross()
		{
			const double elapsed = m_stopwatch.msF();

			if (m_transitionState == TransitionState::FadeInOut)
			{
				if (elapsed >= m_transitionTimeMillisec)
				{
					m_current = m_next;

					m_next = nullptr;

					m_stopwatch.reset();

					m_transitionState = TransitionState::Active;
				}
			}

			if (m_transitionState == TransitionState::Active)
			{
				m_current->update();

				return !hasError();
			}
			else
			{
				assert(m_transitionTimeMillisec);

				const double t = elapsed / m_transitionTimeMillisec;

				m_current->updateFadeOut(t);

				if (hasError())
				{
					return false;
				}

				m_next->updateFadeIn(t);

				return !hasError();
			}
		}
开发者ID:azaika,项目名称:OpenSiv3D,代码行数:42,代码来源:SceneManager.hpp


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