本文整理汇总了C++中MyWindow::isVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ MyWindow::isVisible方法的具体用法?C++ MyWindow::isVisible怎么用?C++ MyWindow::isVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyWindow
的用法示例。
在下文中一共展示了MyWindow::isVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onKeyboardButtonPressed
virtual void onKeyboardButtonPressed(Keyboard& source, const KeyboardEvent& e) {
if(e.getButton() == KeyboardButtonType::KEY_F1) {
std::cout << "Camera Position:" << std::endl <<
" X: " << camera->position.x << std::endl <<
" Y: " << camera->position.y << std::endl <<
" Z: " << camera->position.z << std::endl <<
" X Rotation: " << camera->rotation.x << std::endl <<
" Y Rotation: " << camera->rotation.y << std::endl;
}
if(e.getButton() == KeyboardButtonType::KEY_F) {
if(cameraLight->diffuse.r == 0) {
cameraLight->diffuse = Color(1, 1, 1, 1);
} else {
cameraLight->diffuse = Color(0, 0, 0, 0);
}
}
if(source.isPressed(KeyboardButtonType::KEY_CONTROL)) {
if(e.getButton() == KeyboardButtonType::KEY_ADD) {
this->setSize(this->getWidth() + 16, this->getHeight() + 12);
std::cout << "Window enlarged!" << std::endl;
} else if(e.getButton() == KeyboardButtonType::KEY_SUBTRACT) {
this->setSize(this->getWidth() - 16, this->getHeight() - 12);
std::cout << "Window shrinked!" << std::endl;
} else if(e.getButton() == KeyboardButtonType::KEY_R) {
this->setResizable(!this->isResizable());
std::cout << "This window is " <<
(this->isResizable() ? "now resizable." : "not resizable anymore.") <<
std::endl;
} else if(e.getButton() == KeyboardButtonType::KEY_I) {
this->showWindowInformation();
} else if(e.getButton() == KeyboardButtonType::KEY_Q) {
showHelp();
} else if(e.getButton() == KeyboardButtonType::KEY_X) {
this->close();
std::cout << "Window closed!" << std::endl;
} else if(e.getButton() == KeyboardButtonType::KEY_H) {
if(other == NULL) {
std::cout <<
"Can't hide the window, reason: There is no other window!" << std::endl <<
"Use CTRL+X to close this window." << std::endl;
} else if(!other->isVisible()) {
std::cout <<
"Can't hide the window, reason: The other window is not visible!" <<
std::endl << "Use CTRL+S to show the other window." << std::endl;
} else {
this->hide();
std::cout << "Window hidden!" << std::endl;
}
} else if(e.getButton() == KeyboardButtonType::KEY_S) {
if(other == NULL) {
std::cout << "Can't show the other window, reason: There is no other window!" <<
std::endl;
} else {
other->show();
std::cout << "Showing the other window!" << std::endl;
}
}
}
}