本文整理汇总了C++中MyWindow::swapInterval方法的典型用法代码示例。如果您正苦于以下问题:C++ MyWindow::swapInterval方法的具体用法?C++ MyWindow::swapInterval怎么用?C++ MyWindow::swapInterval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyWindow
的用法示例。
在下文中一共展示了MyWindow::swapInterval方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sample_main
/////////////////////////////////////////////////////////////////////////
// Main initialization point
//
int sample_main(int argc, const char** argv)
{
NVPWindow::ContextFlags context(
3, //major;
3, //minor;
false, //core;
1, //MSAA;
true, //debug;
false, //robust;
false, //forward;
NULL //share;
);
g_myWindow.argc = argc;
g_myWindow.argv = argv;
if(!g_myWindow.create("bk3d viewer", &context))
return false;
g_myWindow.makeContextCurrent();
g_myWindow.swapInterval(0);
while(MyWindow::sysPollEvents(false) )
{
idle();
}
return true;
}
示例2: sample_main
//------------------------------------------------------------------------------
// Main initialization point
//------------------------------------------------------------------------------
int sample_main(int argc, const char** argv)
{
// you can create more than only one
static MyWindow myWindow;
// -------------------------------
// Basic OpenGL settings
//
NVPWindow::ContextFlags context(
4, //major;
3, //minor;
false, //core;
1, //MSAA;
24, //depth bits
8, //stencil bits
false, //debug;
false, //robust;
false, //forward;
NULL //share;
);
// -------------------------------
// Create the window
//
if(!myWindow.create("gl_vk_supersampled", &context, 1280,720))
{
LOGE("Failed to initialize the sample\n");
return false;
}
// -------------------------------
// Parse arguments/options
//
for(int i=1; i<argc; i++)
{
if(strlen(argv[i]) <= 1)
continue;
switch(argv[i][1])
{
case 's':
s_bStats = atoi(argv[++i]) ? true : false;
LOGI("s_bStats set to %s\n", s_bStats ? "true":"false");
break;
case 'q':
g_MSAA = atoi(argv[++i]);
#ifdef USESVCUI
if(g_pWinHandler) g_pWinHandler->GetCombo("MSAA")->SetSelectedByData(g_MSAA);
#endif
LOGI("g_MSAA set to %d\n", g_MSAA);
break;
case 'r':
g_Supersampling = atof(argv[++i]);
#ifdef USESVCUI
if(g_pWinHandler) g_pWinHandler->GetCombo("SS")->SetSelectedByData(g_Supersampling*10);
#endif
LOGI("g_Supersampling set to %.2f\n", g_Supersampling);
break;
case 'd':
#ifdef USESVCUI
if(g_pTweakContainer) g_pTweakContainer->SetVisible(atoi(argv[++i]) ? 1 : 0);
#endif
break;
default:
LOGE("Wrong command-line\n");
case 'h':
LOGI(s_sampleHelpCmdLine);
break;
}
}
s_pCurRenderer = g_renderers[s_curRenderer];
s_pCurRenderer->initGraphics(myWindow.getWidth(), myWindow.getHeight(), g_Supersampling, g_MSAA);
g_profiler.init();
g_profiler.setDefaultGPUInterface(s_pCurRenderer->getTimerInterface());
s_pCurRenderer->setDownSamplingMode(g_downSamplingMode);
// -------------------------------
// Message pump loop
//
myWindow.makeContextCurrent();
myWindow.swapInterval(0);
myWindow.reshape();
while(MyWindow::sysPollEvents(false) )
{
myWindow.idle();
}
return true;
}