本文整理汇总了C++中VideoPtr::EndSpriteScene方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoPtr::EndSpriteScene方法的具体用法?C++ VideoPtr::EndSpriteScene怎么用?C++ VideoPtr::EndSpriteScene使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoPtr
的用法示例。
在下文中一共展示了VideoPtr::EndSpriteScene方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wmain
int wmain(int argc, gs2d::str_type::char_t* argv[])
#endif
{
Platform::FileManagerPtr fileManager(new Platform::StdFileManager());
Platform::FileIOHubPtr fileIOHub = Platform::CreateFileIOHub(fileManager, GS_L("data/"));
VideoPtr video;
if ((video = CreateVideo(1024, 768, GS_L("temp"), true, true, fileIOHub, Texture::PF_UNKNOWN, false)))
{
InputPtr input = CreateInput(0, false);
AudioPtr audio = CreateAudio(0);
Video::APP_STATUS status;
while ((status = video->HandleEvents()) != Video::APP_QUIT)
{
if (status == Video::APP_SKIP)
continue;
input->Update();
video->BeginSpriteScene();
video->EndSpriteScene();
}
}
return 0;
}
示例2: DrawSplashScreen
static void DrawSplashScreen()
{
video->BeginSpriteScene(gs2d::constant::BLACK);
if (splashSprite)
{
splashSprite->SetOrigin(gs2d::Sprite::EO_CENTER);
const Vector2 screenSize(video->GetScreenSizeF());
const float scale = ComputeSplashScale(screenSize);
splashSprite->Draw(screenSize * 0.5f, gs2d::constant::WHITE, 0.0f, Vector2(scale, scale));
}
video->EndSpriteScene();
}
示例3: PlayCutscene
GS_PLAYER_INFO PlayCutscene(VideoPtr pVideo, const std::wstring& fileName,
InputPtr pInput, const GS_KEY escapeKey)
{
if (!pVideo)
{
ShowMessage(L"Invalid video handler - gs2d::PlayCutscene", GSMT_ERROR);
return GSPI_FAILED;
}
GS_PLAYER_INFO info = GSPI_FINISHED;
//pVideo->TurnLoopManagerOff();
const bool rendering = pVideo->Rendering();
if (rendering)
pVideo->EndSpriteScene();
PlayerPtr player = CreatePlayer(pVideo, fileName);
if (!player)
{
ShowMessage(L"Failed while trying to load the video - gs2d::PlayCutscene", GSMT_ERROR);
if (rendering)
pVideo->BeginSpriteScene();
return GSPI_FAILED;
}
pVideo->EnableMediaPlaying(true);
player->SetFullscreen();
player->Rewind();
player->Play();
while (!player->IsFinished())
{
player->UpdateVideo();
const Video::APP_STATUS status = pVideo->HandleEvents();
if (status == Video::APP_QUIT)
{
info = GSPI_CLOSE_WINDOW;
break;
}
else
{
if (status == Video::APP_SKIP)
continue;
}
if (pInput)
{
pInput->Update();
if (pInput->GetKeyState(escapeKey) == GSKS_HIT)
{
info = GSPI_SKIPPED;
break;
}
}
}
if (rendering)
pVideo->BeginSpriteScene();
pVideo->EnableMediaPlaying(false);
return info;
}