当前位置: 首页>>代码示例>>C++>>正文


C++ CrtRender::SetAnimationPaused方法代码示例

本文整理汇总了C++中CrtRender::SetAnimationPaused方法的典型用法代码示例。如果您正苦于以下问题:C++ CrtRender::SetAnimationPaused方法的具体用法?C++ CrtRender::SetAnimationPaused怎么用?C++ CrtRender::SetAnimationPaused使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CrtRender的用法示例。


在下文中一共展示了CrtRender::SetAnimationPaused方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProcessInput

// Call ProcessInput once per frame to process input keys
void ProcessInput( bool	keys[] )
{
	// These keys we don't want to auto-repeat, so we clear them in "keys" after handling them once
	if (keys['E'] && amplitudeGlobalParameter)
	{
		float value;
		cgGetParameterValuefc(amplitudeGlobalParameter, 1, &value);
		value += 0.1f;
		cgSetParameter1f(amplitudeGlobalParameter, value);
		keys['E'] = false;
	}
	if (keys['R'] && amplitudeGlobalParameter)
	{
		float value;
		cgGetParameterValuefc(amplitudeGlobalParameter,1, &value);
		value -= 0.1f;
		cgSetParameter1f(amplitudeGlobalParameter, value);
		keys['R'] = false;
	}
	if (keys[VK_TAB] )
	{
		// When 'C' is pressed, change cameras
		_CrtRender.SetNextCamera();
		keys[VK_TAB] = false;
	}

	if ( keys['M'] )
	{
		// Speed up UI by 25%
		AdjustUISpeed(1.25f);  
		keys['M'] = false;
	}
	if ( keys['N'] )
	{
		// Slow down UI by 25%
		AdjustUISpeed(0.75f);  // Go 25% slower
		keys['N'] = false;
	}
	if (keys['Q'])
	{
		if (togglewireframe) {
			glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
			togglewireframe = FALSE;
		} else {
			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
			togglewireframe = TRUE;
		}
		keys['Q'] = false;
	}

	if (keys['K'])
	{
		if (togglehiearchy) {
			_CrtRender.SetShowHiearchy(CrtTrue);	
			togglehiearchy = FALSE;
		} else {
			_CrtRender.SetShowHiearchy(CrtFalse);
			togglehiearchy = TRUE;
		}
		keys['K'] = false;
	}
	if (keys['L'])
	{
		if (togglelighting) {
			glDisable(GL_LIGHTING);
			togglelighting = FALSE;
		} else {
			glEnable(GL_LIGHTING);
			togglelighting = TRUE;
		}
		keys['L'] = false;
	}

	if (keys['P'] )
	{
		if (sAnimationEnable) {
			_CrtRender.SetAnimationPaused( CrtTrue );
			sAnimationEnable = false;
		}
		else { 
			_CrtRender.SetAnimationPaused( CrtFalse ); 
			sAnimationEnable = true;
		}
		keys['P'] = false;
	}
	if (keys[VK_F1])		
	{
		keys[VK_F1]=FALSE;		
		_CrtRender.Destroy();
		DestroyGLWindow();			
		fullscreen=!fullscreen;		
		// Recreate Our OpenGL Window
		if (!CreateGLWindow("Collada Viewer for PC", _CrtRender.GetScreenWidth(), _CrtRender.GetScreenHeight(),32,fullscreen))
		{
			exit(1);
		}
		if ( !_CrtRender.Load( cleaned_file_name ))
		{
			exit(0);
//.........这里部分代码省略.........
开发者ID:mDibyo,项目名称:docker-files,代码行数:101,代码来源:mainPC.cpp

示例2: KeyboardCallback

static void KeyboardCallback(const unsigned char key, const int x, const int y)
{
    (void)x;
    (void)y;

    switch (key)
    {
    case 9 :    /* TAB key */
        _CrtRender.SetNextCamera();
        break;
    case 'k' :
    case 'K' :
        sHierarchy = !sHierarchy;
        if (!sHierarchy) {
            _CrtRender.SetShowHiearchy( CrtFalse );
        }
        else {
            _CrtRender.SetShowHiearchy( CrtTrue );
        }
        break;
    case 'l' :
    case 'L' :
        sGlLighting = !sGlLighting;
        if (sGlLighting) {
            glEnable(GL_LIGHTING);
        } else {
            glDisable(GL_LIGHTING);
        }
        break;
    case 'm' :
    case 'M' :
        AdjustUISpeed(1.25f);
        break;
    case 'n' :
    case 'N' :
        AdjustUISpeed(0.75f);
        break;
    case 'p' :
    case 'P' :
        sAnimation = !sAnimation;
        if (!sAnimation) {
            _CrtRender.SetAnimationPaused( CrtTrue );
        }
        else {
            _CrtRender.SetAnimationPaused( CrtFalse );
        }
        break;
    case 'q' :
    case 'Q' :
        sWireframe = !sWireframe;
        if (sWireframe) {
            glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
        } else {
            glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
        }
        break;
    case 's' :  //zoom in
    case 'S' :
        _CrtRender.ActiveInstanceCamera->MoveTransform(_CrtRender.GetAnimDelta() * KeyboardTranslateSpeed *0.5f, 0.0f, 0.0f);
        break;
    case 'w' :  // zoom out
    case 'W' :
        _CrtRender.ActiveInstanceCamera->MoveTransform(- _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed * 0.5f, 0.0f, 0.0f);
        break;
    case 32 :   // space key, UP
        // UI code to move the camera farther up
        _CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, 0.0f, _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed);
        break;
    case 'x' :  // down
    case 'X' :
        _CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, 0.0f, - _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed);
        break;
    case 'd' :  // right
    case 'D' :
        _CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, - _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed, 0.0f);
        break;
    case 'a' :  // left
    case 'A' :
        _CrtRender.ActiveInstanceCamera->MoveTransform(0.0f, _CrtRender.GetAnimDelta() * KeyboardTranslateSpeed, 0.0f);
        break;
    case 'f' :
    case 'F' :
        if(sCulling == 0)
        {   // turn it front
            glEnable( GL_CULL_FACE );
            glCullFace(GL_FRONT);
            sCulling = 1;
        } else if(sCulling == 1)
        {   // turn it both
            glDisable( GL_CULL_FACE );
            sCulling = 2;
        } else
        {   // turn it back
            glEnable( GL_CULL_FACE );
            glCullFace(GL_BACK);
            sCulling = 0;
        }
        break;
    default:
        printf("unused key : %i\n",  key );
//.........这里部分代码省略.........
开发者ID:sbarthelemy,项目名称:collada-dom,代码行数:101,代码来源:main.cpp


注:本文中的CrtRender::SetAnimationPaused方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。