kinect 응용 프로그램에서 C + +,하지만 내 glut 기능, void glutKeyboard, glutDisplay, glutIdle 같은 오류가 있습니다. 다음 예제에서는 모든 함수가 기본 파일에서 선언되므로 클래스가 필요하지 않지만 내 응용 프로그램에서는 클래스가 함수의 범위를 선언하여 오류를 생성합니다.'void (classname :: unsigned char, int, int)'형식으로 'classname :: glutKeyboard'를 'void (classname ::) (unsigned char, int, int)'형식으로 변환 할 수 없습니다.
이와 함수 헤더의 선언 :
class VideoOpenGL : public QGLWidget
{
Q_OBJECT
public:
explicit VideoOpenGL(QWidget *parent = 0);
protected:
// /*
void initializeGL();
//void resizeGL(int w, int h);
//void paintGL();
void glutKeyboard (unsigned char key, int /*x*/, int /*y*/);
void glutDisplay(void);
void glutIdle (void);
void CleanupExit();
void LoadCalibration();
void SaveCalibration();
// */
signals:
public slots:
};
이것은 기능 내 기능 glutKeyboard
void VideoOpenGL::glutKeyboard (unsigned char key, int /*x*/, int /*y*/)
{
switch (key)
{
case 27:
CleanupExit();
case 'b':
// Draw background?
g_bDrawBackground = !g_bDrawBackground;
break;
case 'x':
// Draw pixels at all?
g_bDrawPixels = !g_bDrawPixels;
break;
case 's':
// Draw Skeleton?
g_bDrawSkeleton = !g_bDrawSkeleton;
break;
case 'i':
// Print label?
g_bPrintID = !g_bPrintID;
break;
case 'l':
// Print ID & state as label, or only ID?
g_bPrintState = !g_bPrintState;
break;
case 'f':
// Print FrameID
g_bPrintFrameID = !g_bPrintFrameID;
break;
case 'j':
// Mark joints
g_bMarkJoints = !g_bMarkJoints;
break;
case'p':
g_bPause = !g_bPause;
break;
case 'S':
SaveCalibration();
break;
case 'L':
LoadCalibration();
break;
}
}
지금 호출입니다
glutKeyboardFunc(glutKeyboard);
감사합니다. – user3651443