-
animation in opengl
I am trying to animate my object like below, the object should move back and forth, but with this i can't see the movement. please tell me whats going wrong in this code below. Thanks Sujan
Code:
<pre lang="cs">// TODO: Add your command handler code here
CDC* pDC = GetDC();
wglMakeCurrent(pDC->m_hDC, m_hrc);
transObj2[0]=transObj2[0] - 40.0f;
Invalidate();
Sleep(5000);
transObj2[0]=transObj2[0] + 40.0f;
Invalidate();
Sleep(5000);
wglMakeCurrent(NULL,NULL);</pre>
-
Re: animation in opengl
Window is updated only in the end of this code. Use timer, or DoEvents before Sleep:
http://stackoverflow.com/questions/1...uivalent-for-c