PDA

View Full Version : Structuring QGLWidget Program



Talguy
17th December 2010, 17:31
I am working on my senior design project for a BSEE and we're builting a system that will display your vehicles data on a computer screen inplace of your instrument cluster. The screen will completely reconfigurable to best suite the end user. I am new to Qt, OpenGL, and Threads. I'm a decient programmer but being a EE student we're not the best right out of the box. I am book smart when it comes to the terms and some concepts just can't execute them thats why I'm asking for some help here.

Ok so as the lead programmer for this project I have layed out the program structure as follows: 3 threads; main thread for GUI (openGL) displays prerendered frame, second thread for offscreen rendering pulls data from ring buffer, and third thread for hardware comm data to be pushed in a ring buffer. with the interface the user can load in their own 2d graphics (jpegs) which I read would just get mapped as a texture to rectangle. Would rendering off screen give me a performance boost or should all the drawing be done in the Widget's paint event, I'm trying to achieve a refresh rate of 30fps? We do have a default interface that we're planning to code straight into the program in case the user's file does not meet certain safety rules that will be in place.

Any help would be most appreciated,
Talguy

wysota
18th December 2010, 15:44
It really depends how much you have to render. Bearing the fact that most of recent computer games are still single-threaded I take it that rendering in the main thread should be sufficient :)