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 4053500
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:27:18+00:00 2026-05-20T14:27:18+00:00

I have created a simple Visual Studio Express 2010 C++ project using GLUT and

  • 0

I have created a simple Visual Studio Express 2010 C++ project using GLUT and OpenGL,
it compiles and runs ok, except that the window it creates receives no events..
the close/minimize buttons don’t do anything (not even mouseover) no context menu on the task bar on right click, and the window doesn’t come to the foreground when clicked if partially covered.

The project is set up as a console application, I can close the program by closing the console.

I have this in main:

int main(int argc, char** argv) 
{
    glutInit(&argc, argv);
    glutInitWindowSize(window_width, window_height);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
    glutCreateWindow("MyApp");
    glutIdleFunc(main_loop_function);


    GLenum err = glewInit();
    if (GLEW_OK != err)
    {
      /* Problem: glewInit failed, something is seriously wrong. */
      fprintf(stderr, "Error: %s\n", glewGetErrorString(err));

    }
    if (GLEW_VERSION_1_3)
    {
      fprintf(stdout, "OpenGL 1.3 is supported \n");
    }
    fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));



    GL_Setup(window_width, window_height);
    glutMainLoop();
}
  • 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-20T14:27:19+00:00Added an answer on May 20, 2026 at 2:27 pm

    You miss a display callback. Could you try:

    void display();
    
    int main(int argc, char** argv) 
    {
        glutInit(&argc, argv);
        glutInitWindowSize(window_width, window_height);
        glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
        glutCreateWindow("MyApp");
        /// glutIdleFunc(main_loop_function);
        glutDisplayFunc(display);
    
        // ...
    
        glutMainLoop();
    }
    
    void display(){
        glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    
        glutSwapBuffers();
    }
    

    Also, your idle function seems bad, if you effectively loop inside that function. Glut is callback oriented. You don’t need to create a loop, but rather rely on idle, mouse, keyboard, display and resize callbacks. If you don’t do so, you are going to miss window manager events.

    EDIT:

    If you want to create an animation, you could use:

    glutIdleFunc(idleFunc);
    
    void idleFunc(){
        glutPostRedisplay();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VERY simple C# Winforms project that I made using Visual Studio
I have created a very simple window service using visual studio 2010 and .NُET
I am creating a simple C++ DLL project using Visual Studio 2008 Express Edition.
I have created this simple window with Visual Studio 2010: #include <stdio.h> #include <string.h>
I am using Visual Studio 2008 Express and I tried creating a simple console
I am new to visual studio.I have created a simple console application and then
I am trying to build a C project in Visual C++ 2010 Express as
I am trying to build a C project in Visual C++ 2010 Express as
I am fairly new to development, and Visual Studio 2010. I have a solution
I have created a simple wcf service which used the WCF Service Library template.

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.