freesing the background

Hi guy’s
I am currently programming a gauge for a boat engine. The old gauge’s needle was very ugly when it was around 90 degrease because it was without anti aliasing. Now the gauge is almost finished but I’d 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

Sure you can. Best bet is create the guage background as a texture. Then draw that followed by your needle code.

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

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.

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.

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