i use QT and am programming for a Native program which draw figures(like triangles) and user can select one of the figures and the figures can be changed.
so i want to use glutMouseFunc, searched google and found this source.
https://www.opengl.org/archives/reso...ok/pickdepth.c
and i am making [QT Widget App] which use Mainwindow and my code is just this.
but it's not working.
what's the Reason?
i want to know the usage.
//maint.cpp
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
//openglwidget.cpp, it use QOpenGlView of QT UI
void pickRects(int button, int state, int x, int y)
{
qDebug()<<"pickRects";
printf("pickRects\n");
}
OpenGLWidget::OpenGLWidget(QWidget *parent): QGLWidget(parent)
{
glutMouseFunc(pickRects);
}
Bookmarks