Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 951565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:45:19+00:00 2026-05-15T23:45:19+00:00

I have a program that uses GLUT for its OpenGL rendering. Now I need

  • 0

I have a program that uses GLUT for its OpenGL rendering. Now I need it to be inside of a MFC project so that it can work with another program component.

I’ve followed this tutorial: http://www.codeguru.com/cpp/g-m/opengl/openfaq/article.php/c10975__1/Setting-Up-OpenGL-in-an-MFC-Control.htm

I am calling the function that was the GLUT display callback when the timer fires, but that’s not working because the rendering depends on something that happens in the GLUT idle callback. I don’t understand where I should call the GLUT idle callback in my MFC program. Is there a separate event handler I should make for it, and if so, which event? Or am I doing something else completely wrong? I’m fairly familiar with OpenGL but this is my first experience with MFC so I am probably erring on that side.

Thanks so much for your time; I really appreciate it!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:45:20+00:00Added an answer on May 15, 2026 at 11:45 pm

    I just browsed the tutorial you’ve linked to; on page two, something along the following lines can be found (I cleaned up the code a little bit):

    void COpenGLControl::OnTimer(UINT nIDEvent)
    {
       if(nIDEvent==1)
       {
             glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);    
             oglDrawScene();
             // try to insert your idle function code here
             SwapBuffers(hdc);    
       }
       CWnd::OnTimer(nIDEvent);
    }
    

    So, basically this is the replacement for glutIdleFunc suggested by the tutorial. I’d simply try to insert the code called in your idle function before the call to SwapBuffers.

    I hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that uses a licence system for its users. Now I
I have a vb.net program that uses mysql as its database. And it works
I have a program that uses the GPU for performing certain computations. I can
I have a program that uses an external API which uses its own state.
I have a program that uses the Now.ToFileTime() function in .NET to get a
I have a program that uses JAMA and need to test is a matrix
I have a program that uses a Microsoft Access database for its back-end. I
I have a program that uses OpenGL combined with Cocoa and Python using PyObjC.
I have a program that uses pthread library to do the matrix multiplication of
I have a program that uses: ThreadPool.QueueUserWorkItem(new WaitCallback(FireAttackProc), fireResult); On Windows7 and Vista it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.