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


C++ GHOST_ISystem::setCursorPosition方法代码示例

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


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

示例1: GHOST_SetCursorPosition

GHOST_TSuccess GHOST_SetCursorPosition(GHOST_SystemHandle systemhandle,
                                       GHOST_TInt32 x,
                                       GHOST_TInt32 y)
{
	GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
	
	return system->setCursorPosition(x, y);
}
开发者ID:floored,项目名称:blender,代码行数:8,代码来源:GHOST_C-api.cpp

示例2: SetMousePosition

void GPG_Canvas::SetMousePosition(int x, int y)
{
	GHOST_ISystem* system = GHOST_ISystem::getSystem();
	if (system && m_window)
	{
		GHOST_TInt32 gx = (GHOST_TInt32)x;
		GHOST_TInt32 gy = (GHOST_TInt32)y;
		GHOST_TInt32 cx;
		GHOST_TInt32 cy;
		m_window->clientToScreen(gx, gy, cx, cy);
		system->setCursorPosition(cx, cy);
	}
}
开发者ID:Andrewson3D,项目名称:blender-for-vray,代码行数:13,代码来源:GPG_Canvas.cpp

示例3: processEvent

bool Application::processEvent(GHOST_IEvent* event)
{
    GHOST_IWindow* window = event->getWindow();
    bool handled = true;

    switch (event->getType()) {
    /*	case GHOST_kEventUnknown:
    		break;
    	case GHOST_kEventCursorButton:
    		std::cout << "GHOST_kEventCursorButton"; break;
    	case GHOST_kEventCursorMove:
    		std::cout << "GHOST_kEventCursorMove"; break;
    */
    case GHOST_kEventWheel:
    {
        GHOST_TEventWheelData* wheelData = (GHOST_TEventWheelData*) event->getData();
        if (wheelData->z > 0)
        {
            view_rotz += 5.f;
        }
        else
        {
            view_rotz -= 5.f;
        }
    }
    break;

    case GHOST_kEventKeyUp:
        break;

    case GHOST_kEventKeyDown:
    {
        GHOST_TEventKeyData* keyData = (GHOST_TEventKeyData*) event->getData();
        switch (keyData->key) {
        case GHOST_kKeyC:
        {
            int cursor = m_cursor;
            cursor++;
            if (cursor >= GHOST_kStandardCursorNumCursors) {
                cursor = GHOST_kStandardCursorFirstCursor;
            }
            m_cursor = (GHOST_TStandardCursor)cursor;
            window->setCursorShape(m_cursor);
        }
        break;

        case GHOST_kKeyE:
        {
            int x = 200, y= 200;
            m_system->setCursorPosition(x,y);
            break;
        }

        case GHOST_kKeyF:
            if (!m_system->getFullScreen()) {
                // Begin fullscreen mode
                GHOST_DisplaySetting setting;

                setting.bpp = 16;
                setting.frequency = 50;
                setting.xPixels = 640;
                setting.yPixels = 480;
                m_system->beginFullScreen(setting, &m_fullScreenWindow, false /* stereo flag */);
            }
            else {
                m_system->endFullScreen();
                m_fullScreenWindow = 0;
            }
            break;

        case GHOST_kKeyH:
            window->setCursorVisibility(!window->getCursorVisibility());
            break;

        case GHOST_kKeyM:
        {
            bool down = false;
            m_system->getModifierKeyState(GHOST_kModifierKeyLeftShift,down);
            if (down) {
                std::cout << "left shift down\n";
            }
            m_system->getModifierKeyState(GHOST_kModifierKeyRightShift,down);
            if (down) {
                std::cout << "right shift down\n";
            }
            m_system->getModifierKeyState(GHOST_kModifierKeyLeftAlt,down);
            if (down) {
                std::cout << "left Alt down\n";
            }
            m_system->getModifierKeyState(GHOST_kModifierKeyRightAlt,down);
            if (down) {
                std::cout << "right Alt down\n";
            }
            m_system->getModifierKeyState(GHOST_kModifierKeyLeftControl,down);
            if (down) {
                std::cout << "left control down\n";
            }
            m_system->getModifierKeyState(GHOST_kModifierKeyRightControl,down);
            if (down) {
                std::cout << "right control down\n";
//.........这里部分代码省略.........
开发者ID:BHCLL,项目名称:blendocv,代码行数:101,代码来源:GHOST_Test.cpp


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