本文整理汇总了C++中TIMER::Pause方法的典型用法代码示例。如果您正苦于以下问题:C++ TIMER::Pause方法的具体用法?C++ TIMER::Pause怎么用?C++ TIMER::Pause使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TIMER
的用法示例。
在下文中一共展示了TIMER::Pause方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Keyboard
//Called when a key is pressed
void Keyboard(unsigned char key, int x, int y)
{
//If escape is pressed, exit
if(key==27)
exit(0);
//Use P to pause the animation and U to unpause
if(key=='P' || key=='p')
timer.Pause();
if(key=='U' || key=='u')
timer.Unpause();
}
示例2: UpdateFrame
//Perform per frame updates
void UpdateFrame()
{
window.Update();
camera.Update();
//Change anisotropy level
if( window.isKeyPressed(VK_UP) && EXT_texture_filter_anisotropic_supported &&
currentAnisotropy<maxAnisotropy)
{
window.MakeCurrent();
currentAnisotropy*=2;
glBindTexture(GL_TEXTURE_2D, pbufferTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, currentAnisotropy);
window.SetKeyReleased(VK_UP);
}
if( window.isKeyPressed(VK_DOWN) && EXT_texture_filter_anisotropic_supported &&
currentAnisotropy>1)
{
window.MakeCurrent();
currentAnisotropy/=2;
glBindTexture(GL_TEXTURE_2D, pbufferTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, currentAnisotropy);
window.SetKeyReleased(VK_DOWN);
}
//toggle mipmaps
if( window.isKeyPressed('M') && useMipmapFilter==false && SGIS_generate_mipmap_supported)
{
window.MakeCurrent();
glBindTexture(GL_TEXTURE_2D, pbufferTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, true);
useMipmapFilter=true;
}
if( window.isKeyPressed('L') && useMipmapFilter==true && SGIS_generate_mipmap_supported)
{
window.MakeCurrent();
glBindTexture(GL_TEXTURE_2D, pbufferTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, false);
useMipmapFilter=false;
}
//Pause/unpause
if(window.isKeyPressed('P'))
timer.Pause();
if(window.isKeyPressed('U'))
timer.Unpause();
//Swap between scenes in the pbuffer
if(window.isKeyPressed('1') && drawTextured)
{
//Draw wire tori
drawTextured=false;
}
if(window.isKeyPressed('2') && !drawTextured)
{
//draw textured sphere
drawTextured=true;
}
}