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


C++ Cameras::prev方法代码示例

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


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

示例1: keyboard_ctrl

/**
 * keyboard_ctrl is registered as a GLUT callback.
 * It is responsible for catching when special keys are pressed.
 *
 * @param key The key pressed.
 * @param x The x coordinate of the mouse when the key was pressed.
 * @param y The y coordinate of the mouse when the key was pressed.
 */
void keyboard_ctrl( int key, int x, int y ) {

  Scene *theScene = Engine::instance()->rootScene();
  Cameras *camList = Engine::instance()->cams();
  
  switch ( key ) {
  //Cycle between active Objects ...
  case GLUT_KEY_LEFT:
    theScene->prev();
    break;
  case GLUT_KEY_RIGHT:
    theScene->next();
    break;

    //Change the Draw Mode ...
  case GLUT_KEY_F1:
    theScene->active()->Mode( GL_POINTS );
    break;
  case GLUT_KEY_F2:
    theScene->active()->Mode( GL_LINE_STRIP );
    break;
  case GLUT_KEY_F3:
    theScene->active()->Mode( GL_TRIANGLE_STRIP );
    break;
  case GLUT_KEY_F4:
    theScene->active()->Mode( GL_TRIANGLES );
    break;
  }

  // If there are no Cameras, don't muck around with this section.
  if ( camList->numCameras() < 1 ) return;

  switch ( key ) {
  case GLUT_KEY_PAGE_UP:
    camList->prev();
    break;

  case GLUT_KEY_PAGE_DOWN:
    camList->next();
    break;
  }
}
开发者ID:DMC413,项目名称:GraphicsProject,代码行数:50,代码来源:glut_callbacks.cpp


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