本文整理汇总了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;
}
}