すいません。これvjoyっツールのSDKにあったPOVの指定なんですが、何をしているのかさっぱりわかりません。これに入れるためのXとYの値があった場合、どう処理したらよいのでしょうか /*** Create the data packet that holds the entire position info ***/ // Set the device ID id = (BYTE)iInterface; iReport.bDevice = id; // Set values in four axes (Leave the rest in default state) iReport.wAxisX=X;iReport.wAxisY=Y;iReport.wAxisZ=Z;iReport.wAxisZRot=ZR; // Set buttons one by one iReport.lButtons = 1<<count/20; if (ContinuousPOV){ // Make Continuous POV Hat spin iReport.bHats = (DWORD)(count*70); iReport.bHatsEx1 = (DWORD)(count*70)+3000; iReport.bHatsEx2 = (DWORD)(count*70)+5000; iReport.bHatsEx3 = 15000 - (DWORD)(count*70); if ((count*70) > 36000){ iReport.bHats = -1; // Neutral state iReport.bHatsEx1 = -1; // Neutral state iReport.bHatsEx2 = -1; // Neutral state iReport.bHatsEx3 = -1; // Neutral state }; }else{ // Make 5-position POV Hat spin unsigned char pov[4]; pov[0] = ((count/20) + 0)%4;pov[1] = ((count/20) + 1)%4; pov[2] = ((count/20) + 2)%4;pov[3] = ((count/20) + 3)%4; iReport.bHats = (pov[3]<<12) | (pov[2]<<8) | (pov[1]<<4) | pov[if ((count) > 550) iReport.bHats = -1; // Neutral state };
std::vector<MyClass*> containerが宣言されてるとして、 for (std::vector<MyClass*>::reverse_iterator it = container.rbegin(); it != container.rend(); ++it){ container.erase(it); } 上記の
for (std::vector<MyClass*>::reverse_iterator it = container.rbegin(); it != container.rend(); ++it) ここを for (std::vector<MyClass*>::iterator it = container.begin(); it != container.end(); ++it) こうするとエラーは出なくなりますが、想定している動きになりません。
>>50 Feed vJoy Device: The time has come to do some real work: feed the vJoy device with position data. There are two approaches: 1. Efficient: Collect position data, place the data in a position structure then finally send the data to the device. 2. Robust: Reset the device once then send the position data for every control (axis, button,POV) at a time. The first approach is more efficient but requires more code to deal with the position structure. The second approach hides the details of the data fed to the device at the expence of exessive calls to the device driver. とreadmeに書いてあるので、二種類の指定方法があって、好きに選んでということかもしれません