本文整理汇总了C++中MainMenu::Resize方法的典型用法代码示例。如果您正苦于以下问题:C++ MainMenu::Resize方法的具体用法?C++ MainMenu::Resize怎么用?C++ MainMenu::Resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainMenu
的用法示例。
在下文中一共展示了MainMenu::Resize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessEvent
void WindowManager::ProcessEvent(SDL_Event *event)
{
MainMenu *mainmenu = (MainMenu *)SM->GetSceneByName("Main Menu");
OptionsMenu *optionsmenu = (OptionsMenu *)SM->GetSceneByName("Options Menu");
switch(event->type) // See which event it is
{
// When window is resized or is toggled between window and fullscreen
case SDL_VIDEORESIZE:
//Cleanup();
InitOpenGL();
IsGLErrors("Video Resize");
if(!WM->IsFullscreen())
{
SetWindowedMode(0, 0, event->resize.w, event->resize.h);
}
glViewport(0,0,event->resize.w,event->resize.h); // Resize OpenGL Viewport to fit the screen/window
SM->InitAll();
break;
// When user quits the game
case SDL_VIDEOEXPOSE:
if(Game->GetCurrentMode() != GM_PLAY)
{
mainmenu->Resize();
optionsmenu->Resize();
}
break;
case SDL_QUIT:
_Running=false;
break;
case SDL_ACTIVEEVENT:
if(event->active.state & SDL_APPACTIVE)
{
if(event->active.gain)
_Active = true;
else
_Active = false;
}
break;
default:
break;
}
}