本文整理汇总了C++中PlatformWindow::isCursorVisible方法的典型用法代码示例。如果您正苦于以下问题:C++ PlatformWindow::isCursorVisible方法的具体用法?C++ PlatformWindow::isCursorVisible怎么用?C++ PlatformWindow::isCursorVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlatformWindow
的用法示例。
在下文中一共展示了PlatformWindow::isCursorVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: messageBox
S32 Platform::messageBox(const UTF8 *title, const UTF8 *message, MBButtons buttons, MBIcons icon)
{
PlatformWindow *pWindow = WindowManager->getFirstWindow();
// Get us rendering while we're blocking.
winState.renderThreadBlocked = true;
// We don't keep a locked mouse or else we're going
// to end up possibly locking our mouse out of the
// message box area
bool cursorLocked = pWindow && pWindow->isMouseLocked();
if( cursorLocked )
pWindow->setMouseLocked( false );
// Need a visible cursor to click stuff accurately
bool cursorVisible = !pWindow || pWindow->isCursorVisible();
if( !cursorVisible )
pWindow->setCursorVisible(true);
#ifdef UNICODE
const UTF16 *msg = createUTF16string(message);
const UTF16 *t = createUTF16string(title);
#else
const UTF8 *msg = message;
const UTF8 *t = title;
#endif
HWND parent = pWindow ? static_cast<Win32Window*>(pWindow)->getHWND() : NULL;
S32 ret = ::MessageBox( parent, msg, t, getMaskFromID(sgButtonMap, buttons) | getMaskFromID(sgIconMap, icon));
#ifdef UNICODE
delete [] msg;
delete [] t;
#endif
// Dialog is gone.
winState.renderThreadBlocked = false;
if( cursorVisible == false )
pWindow->setCursorVisible( false );
if( cursorLocked == true )
pWindow->setMouseLocked( true );
return getMaskFromID(sgMsgBoxRetMap, ret);
}