|
virtual void | renderIteration (int mmsec)=0 |
| renderIteration This method is called in each iteration of the render loop. This method must be implemented in the derived class.
|
|
| Async (QThread *thread, QObject *ptr=nullptr) |
| Async This is default constructor of the async object.
|
|
| ~Async () |
|
bool | waitFor (bool *condition, int timeout=WAIT_TIME, bool freaze=true) const |
| waitFor This is base wait function.
|
|
bool | waitFor (const Job &condition, int timeout=WAIT_TIME, bool freaze=true) const |
| waitFor This is base wait function.
|
|
The AsyncRenderLoop is a class for asynchronous rendering. This class is used to create a render loop that is executed in a separate thread. To use this class, you must inherit from it and implement the renderIteration method. example: :
{
public:
MyRenderLoop(QThread* thread, QObject* ptr =
nullptr):
AsyncRenderLoop(thread, ptr) {}
void renderIteration(int msec) override {
}
};
int main (int argc, char* argv[]) {
QCoreApplication app(argc, argv);
MyRenderLoop loop(new thread());
loop.run();
loop.stop();
return app.exec();
The AsyncRenderLoop is a class for asynchronous rendering. This class is used to create a render loop...
- Warning
- This class may be broken if you use it as a QSharedPointer and push WeackPointer to the child objects. To solve this issue use the AsyncRenderLoop::MainSharedPtr class.
Example:
{
...
};
int main (int argc, char* argv[]) {
auto loop = QSharedPointer<MyRenderLoop>(new MyRenderLoop(new QThread()));
auto loop = MyRenderLoop::MainSharedPtr<MyRenderLoop>>(new QThread());
auto loop = MyRenderLoop::createMainPtr<MyRenderLoop>(new QThread());
...
return app.exec();
}
Definition at line 58 of file asyncrenderloop.h.