Monster Evolution in Qt: Episode 3 (Revenge of the Cylinders)
April 15, 2009 by Ariya Hidayat | Comments
Seems nobody is interested in free drinks these days. At last that is my impression since not many guesses have been thrown for the title of this episode. Of course, that could also mean that this monster series is really boring anyway.
Can't wait to see the code? Check out the git repository under cymonster subdirectory. Grab the archive (find the snapshot link) if you do not use git. Make sure to open the README file and follow the instructions there, this is absolutely mandatory as this code requires a working V8 shared library. Don't be shocked to see that the code is still as short as the previous examples. Despite our use of V8, the book-keeping and binding parts are kept to minimum.
Since V8 is claimed to have a fantastic performance, don't be surprised if now you will a very fast rotating monster, unlike in the previous episodes. Typically you should easily reach 25 fps in modern machines these days. For the fun of it, the frame rate is capped at 50 fps (I didn't bother to do it in the previous episodes, it won't be reachable anyway). On a high-end machine with fast graphics card and running the demo with OpenGL graphics system, a stunning 30 fps is not so uncommon. If you follow this series faithfully and try all these three episodes, care to share the frame rate you got from each of the episodes?
As a side note, the use of OpaquePaintEvent to avoid offscreen buffer (since we stick to SourceOver composition mode all the time) seems to work only on Windows and Linux/X11, the latter often also depends on the composition manager and good graphics driver, or a combination thereof. Thus, I decided to enable the use of offscreen buffer for Mac OS X. You can still enable it by hand on other platforms if you experience the lack of said effect. Mind you, this would cost you few fps, but that is the price you need to pay.
Last but not least, writing this monster series has been the source of fun and learning for me. I hope you enjoy reading it as much as I enjoy preparing it. May the Script be with you!
The final FAQ:
Q: Since V8 is so fast, don't you want a V8-based Qt Script?
Q: But you use it already in this example?
A: To use V8 is different that to build a full-blown Qt Script implementation using V8. The former is a fun hacking session for one afternoon, the latter is a real engineer project that spans weeks.
Q: Will there be The Monkey Traces Back?
A: Unlikely, I am exhausted.
Postscript: No monsters were harmed in the making of these demos.
Subscribe to our newsletter
Try Qt 6.4 Now!
Download the latest release here: www.qt.io/download.
Qt 6 is the productivity platform for the future, with next-gen 2D & 3D UX and limitless scalability.
Explore Qt World
Check our Qt demos and case studies in the virtual Qt World
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Näytä tämä julkaisu Instagramissa.
Want to build something for tomorrow, join #QtPeople today! We have loads of cool jobs you don't want to miss! http://qt.io/careers #builtwithQt #software #developers #coding #framework #tool #tooling #C++ #QML #engineers #sales #tech #technology #UI #UX #CX #Qt #Qtdev #global #openpositions #careers #job
Henkilön Qt (@theqtcompany) jakama julkaisu