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


C++ Frame::Draw方法代码示例

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


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

示例1: idle

void idle (Test& test, Entity& entity, Frame& frame)
{
  try
  {
//    static size_t start = common::milliseconds ();

    static size_t last_fps = 0;
    static size_t frames_count = 0;

//    float t = float (common::milliseconds () - start) / 1000.f;

    if (common::milliseconds () - last_fps > 1000)
    {
      printf ("FPS: %.2f\n", float (frames_count)/float (common::milliseconds () - last_fps)*1000.f);
      fflush (stdout);

      last_fps = common::milliseconds ();
      frames_count = 0;        
      
      return;
    }    
    
    frames_count++;

    common::PropertyMap entity_dependent_properties = frame.EntityDependentProperties ();

    entity_dependent_properties.SetProperty ("myObjectMatrix", math::mat4f (1.0f));
    
    common::PropertyMap frame_properties = frame.Properties ();
    common::PropertyMap entity_properties = entity.Properties ();  

//    float angle = t * 3.1415926f / 4.0f;
    
////    entity.SetWorldMatrix (math::rotate (math::radian (angle), math::vec3f (0, 0, 1)));
//    entity.SetWorldMatrix (math::rotate (math::radian (angle), math::vec3f (0, 0, 1)) *
//      math::rotate (math::radian (angle*0.2f), math::vec3f (1, 0, 0)));

    frame.Draw ();
      
    test.Window ().SwapBuffers ();
  }
  catch (std::exception& e)
  {
    printf ("exception: %s\n    at idle\n", e.what ());
  }
  catch (...)
  {
    printf ("unknown exception\n    at idle\n");
  }
}
开发者ID:untgames,项目名称:funner,代码行数:50,代码来源:sprite1.cpp

示例2: StartAudioPlayer

void AntiMoustiqueMainForm::StartAudioPlayer()
{
	result r = E_SUCCESS;

	Frame *pFrame = (Frame *)GetParent();
	if( !pFrame )
	{
		AppLog(">>>>>>  GetParent has failed.\n");
		return ;
	}

	if ( !g_pAudioPlayer )
	{
		g_pAudioPlayer = new AntiMoustiqueAudioPlayer();
		if( !g_pAudioPlayer )
		{
			AppLog( ">>>>>> new AudioPlay() has been failed\n");
			return;
		}

		if( g_pAudioPlayer->ConstructAudioPlayer() == false )
		{
			AppLog( ">>>>>>ConstructVideoPlay has been failed\n");
			delete g_pAudioPlayer;
			g_pAudioPlayer= null;
			return;
		}

		//------------------------------
		// Attach Form to Frame
		//------------------------------
		r = pFrame->AddControl( *g_pAudioPlayer );
		if( IsFailed(r))
		{
			AppLog( ">>>>>> pFrame->AddControl( *g_pAudioPlayer ) has been failed\n");
			delete g_pAudioPlayer;
			g_pAudioPlayer= null;
			return;
		}
	}

	//Assign the current form as Form1
	r = pFrame->SetCurrentForm( *g_pAudioPlayer );
	if( IsFailed(r))
	{
		AppLog(">>>>>>  SetCurrentForm( *g_pAudioPlayer ) has failed.\n");
		return ;
	}

	//Redraw form
	pFrame->Draw();
	r = pFrame->Show();
	if( IsFailed(r))
	{
		AppLog(">>>>>>  Show() has failed.\n");
		return ;
	}

	g_pAudioPlayer->AudioPlayerOpen();

}
开发者ID:yanndanielou,项目名称:yanndanielou-programmation,代码行数:61,代码来源:AntiMoustiqueMainForm.cpp


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