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


C++ CircleShape::getFillColor方法代码示例

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


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

示例1: onPose

    // onPose() is called whenever the Myo detects that the person wearing it has changed their pose, for example,
    // making a fist, or not making a fist anymore.
    void onPose(myo::Myo* myo, uint64_t timestamp, myo::Pose pose)
    {
        currentPose = pose;

        // Vibrate the Myo whenever we've detected that the user has made a fist.
        if (pose == myo::Pose::waveIn) {
            myo->vibrate(myo::Myo::vibrationMedium);
			std::cout << "RGB Colour (" << (float)shape.getFillColor().r << " , " << (float)shape.getFillColor().g << " , " << (float)shape.getFillColor().b << ")" << std::endl;
			if(color_input == true)
			{	color_input = false; 
			}
			else
			{	color_input = true;
			}
		}
		else if(pose == myo::Pose::waveOut)
		{	//myo->vibrate(myo::Myo::vibrationMedium);		// this proved to be a bit of a distraction
			INPUT ip;
			ip.type = INPUT_MOUSE;
			ip.mi.dx = 0; 
			ip.mi.dy = 0;
			ip.mi.time = 0.2;
			ip.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
			SendInput(1, &ip, sizeof(INPUT));
			ip.mi.dwFlags = MOUSEEVENTF_RIGHTUP; // KEYEVENTF_KEYUP for key release
			SendInput(1, &ip, sizeof(INPUT));
		}
		else if((pose == myo::Pose::fist)||(pose == myo::Pose::thumbToPinky))
		{	//myo->vibrate(myo::Myo::vibrationMedium);
			INPUT ip;
			ip.type = INPUT_MOUSE;
			ip.mi.dx = 0; 
			ip.mi.dy = 0;
			ip.mi.time = 0.2;
			ip.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
			SendInput(1, &ip, sizeof(INPUT));
			ip.mi.dwFlags = MOUSEEVENTF_LEFTUP; // KEYEVENTF_KEYUP for key release
			SendInput(1, &ip, sizeof(INPUT));

		}	
    }
开发者ID:BruceJohnJennerLawso,项目名称:myohack,代码行数:43,代码来源:mhaaaaaaaaaaaaaaaaaaaaackkkk.cpp


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