PDA

View Full Version : freesing the background



rhs
05-01-2002, 02:36 AM
Hi guy's
I am currently programming a gauge for a boat engine. The old gauges needle was very ugly when it was around 90 degrease because it was without anti aliasing. Now the gauge is almost finished but Id like to draw the background of the gauge independently of the needle. Is that possible with OpenGL and if so than how can I do it, where can I find a tutorial or sample-code?

With kind regards Gerben Prins

Furrage
05-01-2002, 06:36 AM
Sure you can. Best bet is create the guage background as a texture. Then draw that followed by your needle code.

rhs
05-01-2002, 08:22 PM
i'm sorry let me rephrase my question : because the gauge needs to use minimal processor usage Id like to refresh the needle and not draw the background plate every time I change de needle value

Furrage
05-02-2002, 05:12 AM
You can't do that if you are swapping buffers. Once the buffer is swapped the back buffer is left in an indeterminate state and any image for the next frame should be redrawn. Even if you are not swapping buffers the last image of the needle will become embedded in the image of the gauge so you'll have to redraw it anyway. Whether you want to use rendering, texture maps or DrawImage is up to you.

nexusone
05-02-2002, 06:22 AM
You can not do that, you have to redraw the screen every time a object changes position.
I do not think in the overall scheme of things that drawing the needle movement will take a lot of extra CPU time.


http://www.opengl.org/discussion_boards/ubb/smile.gif


Originally posted by rhs:
i'm sorry let me rephrase my question : because the gauge needs to use minimal processor usage Id like to refresh the needle and not draw the background plate every time I change de needle value