Results 1 to 4 of 4

Thread: Windows & glut

  1. #1
    Member Newbie
    Join Date
    Jan 2005
    Location
    Lexington, KY
    Posts
    48

    Windows & glut

    I've got a C/C++ program running on Windows XP that initializes/displays 4 windows using glut. We added some Windows code that displays some other debug windows. So my question is, do windows created with Windows coexist well with windows created with glut? The reason I'm asking is that after creating all of the windows, and simply idling, nothing being rendered, the task manager sez my program is using a whopping 75% of the processors time!

    A version of my program using glut, but without the Windows code uses between 0 and 1% when idling. What gives?

    I'm using openGlut and glutMainLoopEvent() by the way. glutMainLoopEvent() exits instead of staying permanently in a loop.

    Thanks in advance.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    586

    Re: Windows & glut

    Does your added Windows code include using WM_IDLE? If so then your code is being called whenever the computer is idling which would be most of the time. Otherwise there shouldn't be any issues with having win32(or other APIs) and glut working together.

  3. #3
    Member Newbie
    Join Date
    Jan 2005
    Location
    Lexington, KY
    Posts
    48

    Re: Windows & glut

    Ok thanks. How do I specify WM_IDLE?

    Since I am only really using glut to create the windows and am using Windows and OpenGL for everything else, I was actually considering abandoning glut altogether and simply doing everythings in Windows/OpenGL. Is this a bad idea?

  4. #4
    Member Newbie
    Join Date
    Jan 2005
    Location
    Lexington, KY
    Posts
    48

    Re: Windows & glut

    Oops. Just realized something. The Windows code does NOT use WM_IDLE. And when I minimize the 4 windows created with openGlut, the Cpu usage falls from 75% to 0%, but the Windows windows are still merrily updating!

    Somehow, I have to tell glut to stop messing with those 4 glut windows when nothing is being rendered.

    But when I run the same 4 glut windows as a simple application with 'main' instead of 'WinMain', and NO Windows windows, Cpu usage is 0%! Something I'm doing is making Windows + glut a deadly combination.

Similar Threads

  1. GLUT/windows.h
    By KeSh in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-13-2004, 12:15 PM
  2. NEED HELP IN GLUT IN WINDOWS!!!
    By alex_r in forum OpenGL: General
    Replies: 0
    Last Post: 08-19-2002, 08:47 AM
  3. GLUT in Windows 95
    By Starpost in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-04-2002, 07:12 PM
  4. 4 glut windows in 1
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-05-2002, 11:56 PM
  5. glut and windows.h
    By dosenpfand in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 07-24-2001, 07:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean