Here's the code: http://www.file-upload.net/download-...atrix.zip.html
The Problem is the high processor waste. I think i implemented the QThread wrong. Thanks for help!
Here's the code: http://www.file-upload.net/download-...atrix.zip.html
The Problem is the high processor waste. I think i implemented the QThread wrong. Thanks for help!
You're scheduling way too much paint events... every 100ms and every 20ms => 60 paint events/second.
and using the threads matrix streams that way is not really safe.
the paint event is asynvhronous and you read there the streams from the worker... but the in the same time the thread could update the streams.
also, what is the point of that mutex in the two update methods? I don't really see its use.
one last thing: you're creating the matrix streams in the thread's constructor, therefore they will live in the main thread. I don't think that causes any damage in your case...
ok.. so the problem is the painting. i think i have to use opengl? or can i speed up the Qt paint engine?
Just wanna mention - you can use profiler to find possible bottlenecks. Or in your case prove its really painting.
http://wiki.qtcentre.org/index.php?t...with_GNU_gprof
Yes, it's probably the renderering that's your bottleneck. OpenGL would be faster if you want to keep the frame rate, but you should cache the font as display lists instead of rendering every single letter(caching the font is probably a good idea even if you decide against opengl). Also, your usage of threads doesn't seem justified since you are controlling the animation with timers anyway.
Bookmarks