Originally Posted by
smurrish
So, you're saying put all my objects inside
Yes.
and put the game loop code inside of the paint function I'll override in GLScreen's implementation?
No. You have Qt event loop for that. paint function should just do painting.
I suppose I could handle the 3D button thing by having two objects for the button. One could be a QGLWidget to show it and the other could be a QPushbutton with a transparent picture so it won't be seen. I could have the QGLWidget signal the button when it's moused over and clicked.
What do you need the QPushButton for?
//...
signals:
void startClicked();
void stopClicked();
void someOtherButtonClicked();
// ...
};
//...
GLScreen *glscr = new GLScreen(...);
//...
connect(glscr, SIGNAL(startClicked()), this, SLOT(startWasClickedSlot()));
//...
class GLScreen : public QGLWidget {
//...
signals:
void startClicked();
void stopClicked();
void someOtherButtonClicked();
// ...
};
//...
GLScreen *glscr = new GLScreen(...);
//...
connect(glscr, SIGNAL(startClicked()), this, SLOT(startWasClickedSlot()));
//...
To copy to clipboard, switch view to plain text mode
Bookmarks