CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    164

    Smile 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-&gt;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>

  2. #2
    Join Date
    Jul 2002
    Posts
    2,543

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured