2
\$\begingroup\$

I'm new of the topic, and today, I tried my first OpenGL program. It simply drawa a particular figure to the screen, and allows the user to rotate around it with buttons.

Writing code, I was thinking about rendering. When I create a list with glBeginList and I rotate, I cancel the figure on the screen and rotate the camera, before redrawing the figure.

Do I have to cancel everything and redraw for animation, or is there another way?

\$\endgroup\$
1
  • 2
    \$\begingroup\$ I can't understand what you are asking about starting with "When I create a list...". From then on is unclear, could you try to clear that up by chance? \$\endgroup\$
    – Alan Wolfe
    Dec 1, 2016 at 22:27

1 Answer 1

4
\$\begingroup\$

This is a common query among beginners, and yes, it can seem wrong that you have to redraw everything rather than just the parts that have changed.

However, your GPU prefers it if you do this. It can make assumptions, throw away previous frames, not have to worry about preserving old data, and take faster code paths.

So yes, you should redraw everything, and don't worry about performance if you do so.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .