本文整理汇总了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");
}
}
示例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();
}