本文整理汇总了C++中Keyboard::Down方法的典型用法代码示例。如果您正苦于以下问题:C++ Keyboard::Down方法的具体用法?C++ Keyboard::Down怎么用?C++ Keyboard::Down使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Keyboard
的用法示例。
在下文中一共展示了Keyboard::Down方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
}
if (x>=0 && y>=0 && x<MAXX && y<MAXY) {
unsigned value = x | (y<<16);
pMortonTable[ofs++] = value;
if (ofs == MAXX*MAXY)
break;
}
}
SAFE( cudaMemcpy(cudaMortonTable, pMortonTable, ofs*sizeof(unsigned), cudaMemcpyHostToDevice) );
//
// Game time...
//
pLight->_x = LightDistanceFactor*maxi*cos(angle3);
pLight->_y = LightDistanceFactor*maxi*sin(angle3);
g_benchmark = bench;
ModeDescription();
watch.reset();
while(!keys.Abort()) {
framesDrawn++;
if (bench && framesDrawn>benchFrames)
break;
if (!bench) {
// Only allow keyboard control if we are not benchmarking
if (keys.Left())
angle1-=dAngle;
if (keys.Right())
angle1+=dAngle;
if (keys.Up())
angle2=min(angle2+dAngle, DEGREES_TO_RADIANS(89.0f));
if (keys.Down())
angle2=max(angle2-dAngle, DEGREES_TO_RADIANS(-89.0f));
if (keys.Forward() || keys.Backward()) {
Vector3 fromEyeToLookat(lookat);
fromEyeToLookat -= eye;
if (autoRotate)
fromEyeToLookat *= 0.05f;
else
fromEyeToLookat *= 0.05f*maxi;
/*
cout << "At " << eye._x << " " << eye._y << " " << eye._z << endl;
cout << "Looking at " << lookat._x << " " << lookat._y << " " << lookat._z << endl;
cout << "Adding " << fromEyeToLookat._x << " " << fromEyeToLookat._y << " " << fromEyeToLookat._z << endl;
*/
if (keys.Forward())
eye += fromEyeToLookat;
else
eye -= fromEyeToLookat;
}
if (keys.isF4()) {
watch.reset(); framesDrawn = 1;
while (keys.isF4()) keys.poll(); g_bUsePoints = !g_bUsePoints; ModeDescription(); }
if (keys.isF5()) {
watch.reset(); framesDrawn = 1;
while (keys.isF5()) keys.poll(); g_bUseSpecular = !g_bUseSpecular; ModeDescription(); }
if (keys.isF6()) {
watch.reset(); framesDrawn = 1;
while (keys.isF6()) keys.poll(); g_bUsePhongInterp = !g_bUsePhongInterp; ModeDescription(); }
if (keys.isF7()) {
watch.reset(); framesDrawn = 1;
while (keys.isF7()) keys.poll(); g_bUseReflections = !g_bUseReflections; ModeDescription(); }
if (keys.isF8()) {
watch.reset(); framesDrawn = 1;