PDA

View Full Version : Newbie Help: Thread Texture Rendering



Talguy
12-16-2010, 07:42 AM
I am trying to create a program that will replace my car's instrument cluster with and all in one HUD. Right now I am only working on displaying vehicle information in a few different forms (Gages, Bar, Text), The user also had the ability to configure the screen to their liking and create their own graphics w/ photoshop to use. Before I was using gtkmm and Cairo vector graphics lib for my gui. I am in the process of switching to Qt and OpenGL for portability and performace reasons. How I had my program structured before was the main thread and a hardware comm thread shared a ring buffer when new data was present in the buffer the main thread would pull from it and render the screen. I am new to OpenGL and haven't played around with it a whole lot and was wondering if it would be better for me to add a third thread to the party that would render textures i.e. text, LED bar graphs, etc. then notify the main thread that the updated textures are available and maps them to a bunch of rectangles based on the configuration file the user created.

Does this sound about right or would it be better to some how render the whole scene off screen and the display it in a QGLWidget or just do all the rendering in the QGLWidget's paint event? I would like to be able to display data as close to realtime as possible.